replace Resource.options with annotations (#4061)

This commit is contained in:
Natasha Sarkar
2021-07-23 18:19:05 -07:00
committed by GitHub
parent 94c5096a95
commit 91f74e8d16
16 changed files with 209 additions and 83 deletions

View File

@@ -6,6 +6,8 @@ package types
import (
"strconv"
"strings"
"sigs.k8s.io/kustomize/kyaml/yaml"
)
// GenArgs is a facade over GeneratorArgs, exposing a few readonly properties.
@@ -44,3 +46,16 @@ func (g *GenArgs) Behavior() GenerationBehavior {
}
return NewGenerationBehavior(g.args.Behavior)
}
// IsNilOrEmpty returns true if g is nil or if the args are empty
func (g *GenArgs) IsNilOrEmpty() bool {
return g == nil || g.args == nil
}
// AsYaml returns a yaml marshalling of the underlying Genargs
func (g *GenArgs) AsYaml() ([]byte, error) {
if g == nil {
return yaml.Marshal(nil)
}
return yaml.Marshal(g.args)
}