overrides

package
v0.0.0-...-affaa53 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindOverrideStringValue

func FindOverrideStringValue(overrides Map, flatName string) (string, bool)

FindOverrideStringValue looks for a string value assigned to the provided flat key.

func FindOverrideValue

func FindOverrideValue(overrides Map, flatName string) interface{}

FindOverrideValue looks for a value assigned to the provided flat key.

func FlattenMap

func FlattenMap(oMap Map) map[string]string

FlattenMap flattens an Map into a map of aggregated keys and value (to entries like, for example: "istio.ingress.service.gateway: xyz")

func MergeMaps

func MergeMaps(baseMap, overridesMap Map)

MergeMaps merges all values from overridesMap map into baseMap, adding and/or overwriting final keys (string values) if both maps contain such entries. baseMap WILL be modified during merge. overridesMap won't be modified by future merges, since a deep-copy of it's nested maps are used for merging such nested maps.

func ToYaml

func ToYaml(oMap Map) (string, error)

ToYaml converts Map to YAML

Types

type ClusterStaticFile

type ClusterStaticFile struct {
	DirectoryPath *string
}

ClusterStaticFile struct defines static file overrides for cluster

func NewClusterStaticFile

func NewClusterStaticFile(dirPath string) *ClusterStaticFile

NewClusterStaticFile function creates instance of ClusterStaticFile struct for cluster overrides

func (*ClusterStaticFile) GetOverrides

func (clusterStaticFile *ClusterStaticFile) GetOverrides() (Map, error)

GetOverrides function reads cluster overrides file and returns its content

func (*ClusterStaticFile) HasOverrides

func (clusterStaticFile *ClusterStaticFile) HasOverrides() bool

HasOverrides function returns boolean whether additional overrides are defined

type LocalStaticFile

type LocalStaticFile struct{}

LocalStaticFile struct defines static file overrides for local

func NewLocalStaticFile

func NewLocalStaticFile() *LocalStaticFile

NewLocalStaticFile function creates instance of LocalStaticFile struct for cluster overrides

func (*LocalStaticFile) GetOverrides

func (localStaticFile *LocalStaticFile) GetOverrides() (Map, error)

GetOverrides .

func (*LocalStaticFile) HasOverrides

func (localStaticFile *LocalStaticFile) HasOverrides() bool

HasOverrides .

type Map

type Map map[string]interface{}

Map is a map of overrides. Values in the map can be nested maps (of the same type) or strings

func ToMap

func ToMap(value string) (Map, error)

ToMap converts yaml to Map. Supports only map-like yamls (no lists!)

func UnflattenToMap

func UnflattenToMap(sourceMap map[string]string) Map

UnflattenToMap converts external "flat" overrides into Map. Opposite of FlattenMap function.

type OverrideData

type OverrideData interface {
	ForRelease(releaseName string) (string, error)
}

OverrideData exposes methods to fetch release-specific overrides

func New

func New(client *kubernetes.Clientset) OverrideData

New returns new Data instance.

type Provider

type Provider struct {
	// contains filtered or unexported fields
}

Provider implements storage for all overrides

func (*Provider) ForRelease

func (o *Provider) ForRelease(releaseName string) (string, error)

ForRelease returns overrides for release

type StaticFile

type StaticFile interface {
	HasOverrides() bool
	GetOverrides() (Map, error)
}

StaticFile interface defines contract for overrides file representation

Jump to

Keyboard shortcuts

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