You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// 1) First pass over tp.Spec.SetValues to detect duplicates, warn, and decide which value to keep
532
+
// We choose to keep the last occurrence. The map "duplicates" maps variableName -> finalValue.
533
+
// The slice "uniqueVarOrder" tracks the first time we saw the variable (for stable iteration).
534
+
duplicates:=make(map[string]string)
535
+
uniqueVarOrder:= []string{}
536
+
537
+
fori, setValue:=rangetp.Spec.SetValues {
538
+
ifoldVal, seen:=duplicates[setValue.Name]; seen {
539
+
// We found a duplicate. Warn that we will ignore the previous usage.
540
+
r.Eventf(tp, corev1.EventTypeWarning,
541
+
"DuplicatedSetValue",
542
+
"Variable '%s' appears multiple times in setValues. The operator will keep the last usage with value '%s' (position %d), ignoring the previous value '%s'. This will fail in a future release. Please remove duplicates from setValues.",
543
+
setValue.Name, setValue.Value, i, oldVal)
544
+
} else {
545
+
// Only record order the first time we see the variable
0 commit comments