resmap

package
v1.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 17, 2018 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Overview

Package resmap implements a map from ResId to Resource that tracks all resources in a kustomization.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewResourceSliceFromPatches

func NewResourceSliceFromPatches(
	loader loader.Loader, paths []string) ([]*resource.Resource, error)

NewResourceSliceFromPatches returns a slice of resources given a patch path slice from a kustomization file.

Types

type IdSlice

type IdSlice []resource.ResId

IdSlice implements the sort interface.

func (IdSlice) Len

func (a IdSlice) Len() int

func (IdSlice) Less

func (a IdSlice) Less(i, j int) bool

func (IdSlice) Swap

func (a IdSlice) Swap(i, j int)

type ResMap

type ResMap map[resource.ResId]*resource.Resource

ResMap is a map from ResId to Resource.

func MergeWithOverride

func MergeWithOverride(maps ...ResMap) (ResMap, error)

MergeWithOverride combines multiple ResMap instances, allowing and sometimes demanding certain collisions. 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

func MergeWithoutOverride(maps ...ResMap) (ResMap, error)

MergeWithoutOverride combines multiple ResMap instances, failing on key collision.

func NewResMapFromConfigMapArgs

func NewResMapFromConfigMapArgs(loader loader.Loader, cmList []types.ConfigMapArgs) (ResMap, error)

NewResMapFromConfigMapArgs returns a Resource slice given a configmap metadata slice from kustomization file.

func NewResMapFromFiles

func NewResMapFromFiles(loader loader.Loader, paths []string) (ResMap, error)

NewResMapFromFiles returns a ResMap given a resource path slice.

func NewResMapFromSecretArgs

func NewResMapFromSecretArgs(p string, secretList []types.SecretArgs) (ResMap, error)

NewResMapFromSecretArgs takes a SecretArgs slice and executes its command in directory p then writes the output to a Resource slice and return it.

func (ResMap) EncodeAsYaml

func (m ResMap) EncodeAsYaml() ([]byte, error)

EncodeAsYaml encodes a ResMap to YAML; encoded objects separated by `---`.

func (ResMap) ErrorIfNotEqual

func (m ResMap) ErrorIfNotEqual(m2 ResMap) error

ErrorIfNotEqual returns error if maps are not equal.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL