config

package
v0.0.0-...-1bb2835 Latest Latest
Warning

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

Go to latest
Published: May 12, 2022 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

View Source
const StatePresent = "present"

StatePresent represents the present state

Variables

This section is empty.

Functions

This section is empty.

Types

type BinnacleConfig

type BinnacleConfig struct {
	Charts       []ChartConfig `mapstructure:"charts"`
	ConfigFile   string
	Context      string             `mapstructure:"kube-context"`
	LogLevel     string             `mapstructure:"loglevel"`
	Release      string             `mapstructure:"release"`
	Repositories []RepositoryConfig `mapstructure:"repositories"`
}

BinnacleConfig definition

func LoadAndValidateFromViper

func LoadAndValidateFromViper() (*BinnacleConfig, error)

LoadAndValidateFromViper creates a BinnacleConfig object from Viper

type BinnacleKustomization

type BinnacleKustomization struct {
	// https://kubectl.docs.kubernetes.io/references/kustomize/kustomization/resource/
	Resources []string `mapstructure:"resources,omitempty" yaml:"resources,omitempty"`

	// https://kubectl.docs.kubernetes.io/references/kustomize/kustomization/patches/
	Patches []Patch `mapstructure:"patches,omitempty" yaml:"patches,omitempty"`
}

Adapted from https://github.com/kubernetes-sigs/kustomize/blob/master/api/types/kustomization.go

func (BinnacleKustomization) Empty

func (k BinnacleKustomization) Empty() bool

type ChartConfig

type ChartConfig struct {
	Kustomize BinnacleKustomization `mapstructure:"kustomize"`
	Name      string                `mapstructure:"name"`
	Namespace string                `mapstructure:"namespace"`
	Release   string                `mapstructure:"release"`
	Repo      string                `mapstructure:"repo"`
	State     string                `mapstructure:"state"`
	URL       string                `mapstructure:"url"`
	Values    map[string]any        `mapstructure:"values"`
	Version   string                `mapstructure:"version"`
}

ChartConfig definition

func (ChartConfig) ChartURL

func (c ChartConfig) ChartURL() string

ChartURL returns a URL related to the given repo and name of the chart based off of criteria 1 through 4 of the following documentation on how to specify local and remote charts

1. By chart reference: helm install mymaria example/mariadb 2. By path to a packaged chart: helm install mynginx ./nginx-1.2.3.tgz 3. By path to an unpacked chart directory: helm install mynginx ./nginx 4. By absolute URL: helm install mynginx https://example.com/charts/nginx-1.2.3.tgz

func (ChartConfig) WriteValueFile

func (c ChartConfig) WriteValueFile(dir string) (string, error)

WriteValueFile writes the given file containing the Chart's Values

type Gvk

type Gvk struct {
	Group   string `mapstructure:"group,omitempty" yaml:"group,omitempty"`
	Version string `mapstructure:"version,omitempty" yaml:"version,omitempty"`
	Kind    string `mapstructure:"kind,omitempty" yaml:"kind,omitempty"`
}

type Patch

type Patch struct {
	Path    string          `mapstructure:"path,omitempty" yaml:"path,omitempty"`
	Patch   string          `mapstructure:"patch,omitempty" yaml:"patch,omitempty"`
	Target  *Selector       `mapstructure:"target,omitempty" yaml:"target,omitempty"`
	Options map[string]bool `mapstructure:"options,omitempty" yaml:"options,omitempty"`
}

type RepositoryConfig

type RepositoryConfig struct {
	Name  string `mapstructure:"name"`
	State string `mapstructure:"state"`
	URL   string `mapstructure:"url"`
}

RepositoryConfig definition

func (RepositoryConfig) Equal

Equal comparison operator

type ResId

type ResId struct {
	Gvk       `mapstructure:",squash,omitempty" yaml:",inline,omitempty"`
	Name      string `mapstructure:"name,omitempty" yaml:"name,omitempty"`
	Namespace string `mapstructure:"namespace,omitempty" yaml:"namespace,omitempty"`
}

type Selector

type Selector struct {
	ResId              `mapstructure:",squash,omitempty" yaml:",inline,omitempty"`
	AnnotationSelector string `mapstructure:"annotationSelector,omitempty" yaml:"annotationSelector,omitempty"`
	LabelSelector      string `mapstructure:"labelSelector,omitempty" yaml:"labelSelector,omitempty"`
}

Jump to

Keyboard shortcuts

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