Documentation ¶
Overview ¶
Package resmap implements a map from ResId to Resource that tracks all resources in a kustomization.
Index ¶
- type Factory
- func (rmF *Factory) FromFiles(loader ifc.Loader, paths []string) (ResMap, error)
- func (rmF *Factory) NewResMapFromBytes(b []byte) (ResMap, error)
- func (rmF *Factory) NewResMapFromConfigMapArgs(argList []types.ConfigMapArgs, options *types.GeneratorOptions) (ResMap, error)
- func (rmF *Factory) NewResMapFromSecretArgs(argsList []types.SecretArgs, options *types.GeneratorOptions) (ResMap, error)
- func (rmF *Factory) RF() *resource.Factory
- func (rmF *Factory) Set(ldr ifc.Loader)
- type IdMatcher
- type IdSlice
- type ResMap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Factory ¶ added in v1.0.9
type Factory struct {
// contains filtered or unexported fields
}
Factory makes instances of ResMap.
func NewFactory ¶ added in v1.0.9
NewFactory returns a new resmap.Factory.
func (*Factory) NewResMapFromBytes ¶
newResMapFromBytes decodes a list of objects in byte array format.
func (*Factory) NewResMapFromConfigMapArgs ¶ added in v1.0.9
func (rmF *Factory) NewResMapFromConfigMapArgs(argList []types.ConfigMapArgs, options *types.GeneratorOptions) (ResMap, error)
NewResMapFromConfigMapArgs returns a Resource slice given a configmap metadata slice from kustomization file.
func (*Factory) NewResMapFromSecretArgs ¶ added in v1.0.9
func (rmF *Factory) NewResMapFromSecretArgs(argsList []types.SecretArgs, options *types.GeneratorOptions) (ResMap, error)
NewResMapFromSecretArgs takes a SecretArgs slice, generates secrets from each entry, and accumulates them in a ResMap.
type ResMap ¶
ResMap is a map from ResId to Resource.
func MergeWithErrorOnIdCollision ¶
MergeWithErrorOnIdCollision combines multiple ResMap instances, failing on key collision and skipping nil maps. If all of the maps are nil, an empty ResMap is returned.
func MergeWithOverride ¶
MergeWithOverride combines multiple ResMap instances, allowing and sometimes demanding certain collisions and skipping nil maps. A collision would be demanded, say, when a generated ConfigMap has the "replace" option in its generation instructions, meaning it is supposed to replace something from the raw resources list. If all of the maps are nil, an empty ResMap is returned. When looping over the instances to combine them, if a resource id for resource X is found to be already in the combined map, then the behavior field for X must be BehaviorMerge or BehaviorReplace. If X is not in the map, then it's behavior cannot be merge or replace.
func (ResMap) EncodeAsYaml ¶
EncodeAsYaml encodes a ResMap to YAML; encoded objects separated by `---`.
func (ResMap) ErrorIfNotEqual ¶
ErrorIfNotEqual returns error if maps are not equal.