Documentation ¶
Overview ¶
Package resmap implements a map from ResId to Resource that tracks all resources in a kustomization.
Index ¶
- func NewResourceSliceFromPatches(loader loader.Loader, paths []patch.PatchStrategicMerge) ([]*resource.Resource, error)
- type IdSlice
- type ResMap
- func MergeWithOverride(maps ...ResMap) (ResMap, error)
- func MergeWithoutOverride(maps ...ResMap) (ResMap, error)
- func NewResMapFromConfigMapArgs(f *configmapandsecret.ConfigMapFactory, cmArgsList []types.ConfigMapArgs) (ResMap, error)
- func NewResMapFromFiles(loader loader.Loader, paths []string) (ResMap, error)
- func NewResMapFromSecretArgs(f *configmapandsecret.SecretFactory, secretList []types.SecretArgs) (ResMap, error)
- func (m ResMap) DeepCopy() ResMap
- func (m ResMap) DemandOneMatchForId(inputId resource.ResId) (*resource.Resource, bool)
- func (m ResMap) EncodeAsYaml() ([]byte, error)
- func (m ResMap) ErrorIfNotEqual(m2 ResMap) error
- func (m ResMap) FilterBy(inputId resource.ResId) ResMap
- func (m ResMap) FindByGVKN(inputId resource.ResId) []resource.ResId
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewResourceSliceFromPatches ¶
func NewResourceSliceFromPatches( loader loader.Loader, paths []patch.PatchStrategicMerge) ([]*resource.Resource, error)
NewResourceSliceFromPatches returns a slice of resources given a patch path slice from a kustomization file.
Types ¶
type ResMap ¶
ResMap is a map from ResId to Resource.
func MergeWithOverride ¶
MergeWithOverride combines multiple ResMap instances, allowing and sometimes demanding certain collisions and skipping nil maps. In case 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 MergeWithoutOverride ¶
MergeWithoutOverride combines multiple ResMap instances, failing on key collision and skipping nil maps. In case if all of the maps are nil, an empty ResMap is returned.
func NewResMapFromConfigMapArgs ¶
func NewResMapFromConfigMapArgs( f *configmapandsecret.ConfigMapFactory, cmArgsList []types.ConfigMapArgs) (ResMap, error)
NewResMapFromConfigMapArgs returns a Resource slice given a configmap metadata slice from kustomization file.
func NewResMapFromFiles ¶
NewResMapFromFiles returns a ResMap given a resource path slice.
func NewResMapFromSecretArgs ¶
func NewResMapFromSecretArgs( f *configmapandsecret.SecretFactory, secretList []types.SecretArgs) (ResMap, error)
NewResMapFromSecretArgs takes a SecretArgs slice, generates secrets from each entry, and accumulates them in a ResMap.
func (ResMap) DemandOneMatchForId ¶ added in v1.0.6
DemandOneMatchForId find the matched resource by Group/Version/Kind and Name
func (ResMap) EncodeAsYaml ¶
EncodeAsYaml encodes a ResMap to YAML; encoded objects separated by `---`.
func (ResMap) ErrorIfNotEqual ¶
ErrorIfNotEqual returns error if maps are not equal.