Documentation
¶
Overview ¶
Package values merges values the way Helm and Argo CD do and remembers where every key came from, so findings can point at a file and line.
Index ¶
- func Copy(v interface{}) interface{}
- func CopyMap(m map[string]interface{}) map[string]interface{}
- func Delete(m map[string]interface{}, path []string)
- func Display(path []string) string
- func Key(path []string) string
- func Leaves(m map[string]interface{}, path []string, fn func(path []string, v interface{}))
- func Lookup(m map[string]interface{}, path []string) (interface{}, bool)
- func Merge(a, b map[string]interface{}) map[string]interface{}
- func Resolve(m map[string]interface{}, dotted string) ([]string, bool)
- func SetPath(m map[string]interface{}, path []string, v interface{})
- type Origin
- type Set
- func (s *Set) AddAt(path []string, v interface{}, origin Origin)
- func (s *Set) AddAttributed(m map[string]interface{}, label string, attribute func(path []string) []Origin)
- func (s *Set) AddFile(path string) error
- func (s *Set) AddMap(m map[string]interface{}, origin string)
- func (s *Set) AddNode(n *yaml.Node, file string, doc int, prefix []string) error
- func (s *Set) AddSet(expr, origin string, forceString bool) error
- func (s *Set) AddYAML(data []byte, origin string) error
- func (s *Set) ExactOrigins(path []string) []Origin
- func (s *Set) Origins(path []string) []Origin
- func (s *Set) ValuesFiles() []string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Origin ¶
type Origin struct {
File string `json:"file"`
Line int `json:"line,omitempty"`
IsFile bool `json:"-"`
Doc int `json:"-"`
Prefix []string `json:"-"`
}
Origin is where a key was set: a values file and line, or a synthetic source such as "--set" or an Application's inline values. For values embedded in a manifest (a HelmRelease's spec.values), Doc is the YAML document inside File and Prefix the path of the values block in it.
type Set ¶
type Set struct {
Values map[string]interface{}
Sources []string
// contains filtered or unexported fields
}
func (*Set) AddAttributed ¶
func (s *Set) AddAttributed(m map[string]interface{}, label string, attribute func(path []string) []Origin)
AddAttributed merges m with origins computed per key, for values whose final content comes from a kustomize build but whose keys can be traced back to the files that define them.
func (*Set) AddNode ¶
AddNode merges a values block embedded in a manifest, such as a HelmRelease's spec.values. n must come from parsing the whole file so its line numbers are the file's.
func (*Set) ExactOrigins ¶
ExactOrigins returns only the places that set path itself.
func (*Set) Origins ¶
Origins returns every place that set path, falling back to the closest ancestor when the exact key was set as part of a larger value.
func (*Set) ValuesFiles ¶
ValuesFiles returns the sources that are plain values files: files that several apps can load as a whole, unlike values embedded in a manifest.