mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-07-17 01:39:06 +00:00
Set common labels and annotations as strings
This commit is contained in:
@@ -19,11 +19,18 @@ func SetScalar(value string) SetFn {
|
||||
}
|
||||
|
||||
// SetEntry returns a SetFn to set an entry in a map
|
||||
func SetEntry(key, value string) SetFn {
|
||||
func SetEntry(key, value, tag string) SetFn {
|
||||
return func(node *yaml.RNode) error {
|
||||
return node.PipeE(yaml.FieldSetter{
|
||||
Name: key, StringValue: value})
|
||||
Name: key,
|
||||
Value: yaml.NewRNode(&yaml.Node{
|
||||
Kind: yaml.ScalarNode,
|
||||
Value: value,
|
||||
Tag: tag,
|
||||
}),
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
var _ yaml.Filter = Filter{}
|
||||
|
||||
Reference in New Issue
Block a user