Skip to content

Commit

Permalink
trim ingress annotation (#4317)
Browse files Browse the repository at this point in the history
  • Loading branch information
Feroze Mohideen authored Feb 22, 2024
1 parent 2bf0da2 commit 0af525e
Showing 1 changed file with 16 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,22 @@ const IngressCustomAnnotations: React.FC<Props> = ({ index }) => {
// Otherwise, the backend will merge the old set of keys with the new set, and the original key
// will still exist.
onChange: (e) => {
if (
e.target.value &&
e.target.value !== annotation.key
) {
setValue(
`app.services.${index}.config.ingressAnnotations.${i}.key`,
e.target.value
);
if (
!fieldsAnnotationDeletion.find(
(d) => d.key === annotation.key
)
) {
appendAnnotationDeletion({ key: annotation.key });
if (e.target.value) {
const newValue = e.target.value.trim();
if (newValue !== annotation.key) {
setValue(
`app.services.${index}.config.ingressAnnotations.${i}.key`,
newValue
);
if (
!fieldsAnnotationDeletion.find(
(d) => d.key === annotation.key
)
) {
appendAnnotationDeletion({
key: annotation.key,
});
}
}
}
},
Expand Down

0 comments on commit 0af525e

Please sign in to comment.