Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClearEntry ¶
func ClearEntry(key string) filtersutil.SetFn
ClearEntry returns a SetFn to clear a map entry
Types ¶
type KeysClearer ¶
type KeysClearer struct { Kind string `yaml:"kind,omitempty"` Keys []string `yaml:"keys,omitempty"` // FsSlice identifies the location of the maps. FsSlice types.FsSlice `yaml:"fieldSpecs,omitempty"` }
KeysClearer removes the key from the maps located at the entries specified by FsSlice.
N.B. this implements kio.Filter which takes returns []*yaml.RNode not yaml.Filter which takes/returns a single RNode; there's no good reason for this. Its just based on copying https://github.com/kubernetes-sigs/kustomize/blob/5993eae1aa78017c9e5922b41f2dba911e03ce6a/api/filters/labels/labels.go#L28
N.B jeremy@ couldn't get this to work when you have a list of maps and want to modify a field in the map e.g. spec:
items: - name: item1 valuetokeep: v labels: toremove: a
Specifying a FieldSpec with path spec/items[] doesn't work; we get the wrong type of value Specifying a FieldSpec with path spec/items[]/labels does work but removes values from the nested nictionary.