Open
Description
In PR #505, support was added to the tanka cli to control labels injection for the pruning feature.
But a regression was introduced where an already present flag in the spec will not be honoured. If it is set in the spec but not on the command line, the value will always be reset to the default value.
In the code, I believe there is a missing condition to evaluate if the setting was provided in the command line.
The fix is not that trivial, because we don't know if the default value comes from not specifying the value on the command line, or that the user explicitly said --inject-lables=false
. Otherwize it would be easy, add tmp.Spec.InjectLabels
to the condition:
// incomplete fix, but valid if we know that the user has not specified --inject-labels=false
if tmp.Spec.InjectLabels && tmp.Spec.InjectLabels != cfg.Spec.InjectLabels {
fmt.Printf("updated spec.injectLabels (`%t` -> `%t`)\n", cfg.Spec.InjectLabels, tmp.Spec.InjectLabels)
cfg.Spec.InjectLabels = tmp.Spec.InjectLabels
}
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Backlog