conf

package
Version: v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2020 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppConfig

type AppConfig struct {
	Log log.ConfigSet `json:"log" yaml:"log"`

	DebugHelm bool `json:"debugHelm" yaml:"debugHelm"`

	// ChartsDir for chart cache
	ChartsDir string `json:"chartsDir" yaml:"chartsDir"`

	// EnvironmentsDir for environment values
	EnvironmentsDir string `json:"environmentsDir" yaml:"environmentsDir"`

	// LocalChartsDir for charts stored locally
	LocalChartsDir string `json:"localChartsDir" yaml:"localChartsDir"`
}

func (*AppConfig) Override

func (c *AppConfig) Override(o *AppConfig) *AppConfig

type ChartFromGitRepo

type ChartFromGitRepo struct {
	// URL for repo (git/http)
	URL string `json:"url" yaml:"url"`
	// Path in the repo
	Path string `json:"path" yaml:"path"`
}

func (*ChartFromGitRepo) Validate

func (g *ChartFromGitRepo) Validate() error

type ChartFromLocalPath

type ChartFromLocalPath struct {
}

func (*ChartFromLocalPath) Validate

func (l *ChartFromLocalPath) Validate() error

type ChartSource

type ChartSource struct {
	Git   *ChartFromGitRepo   `json:"git" yaml:"git"`
	Local *ChartFromLocalPath `json:"local" yaml:"local"`
}

type ChartSpec

type ChartSpec struct {
	Name string `json:"name" yaml:"name"`

	// Source of the chart, if nil, the Name MUST be in <repo-name>/<chart-name> format
	*ChartSource `json:",inline" yaml:",inline"`

	// NamespaceInTemplate means there is already proper namespace information defined in its templates
	// and apply with `kubectl --namespace` will fail (mostly for rbac resources)
	NamespaceInTemplate bool `json:"namespaceInTemplate" yaml:"namespaceInTemplate"`
}

func (ChartSpec) Dir

func (c ChartSpec) Dir(chartsDir, localChartsDir string, subChartName string) string

func (ChartSpec) Ensure

func (c ChartSpec) Ensure(
	ctx context.Context,
	forcePull bool,
	chartsDir, localChartsDir string,
	repos map[string]*RepoSpec,
) error

nolint:gocyclo

func (ChartSpec) SubChartNames

func (c ChartSpec) SubChartNames(chartsDir, localChartsDir string) ([]string, error)

func (ChartSpec) Validate

func (c ChartSpec) Validate(repos map[string]*RepoSpec) error

type Config

type Config struct {
	App AppConfig `json:"app" yaml:"app"`

	Repos        []RepoSpec    `json:"repos" yaml:"repos"`
	Charts       []ChartSpec   `json:"charts" yaml:"charts"`
	Environments []Environment `json:"environments" yaml:"environments"`
}

type DeploymentSpec

type DeploymentSpec struct {
	// Name value for <namespace>/<fullnameOverride>
	Name string `json:"name" yaml:"name"`
	// Chart name listed in the configuration
	Chart string `json:"chart" yaml:"chart"`

	State string `json:"state" yaml:"state"`

	// BaseValues the values file name
	BaseValues string `json:"baseValues" yaml:"baseValues"`

	// ExcludeChartCRDs to apply crds dir in chart
	ExcludeChartCRDs bool `json:"excludeChartCRDs" yaml:"excludeChartCRDs"`
}

func (DeploymentSpec) Filename

func (c DeploymentSpec) Filename(subChart string) string

func (DeploymentSpec) GetState

func (c DeploymentSpec) GetState() DeploymentState

func (DeploymentSpec) NamespaceAndName

func (c DeploymentSpec) NamespaceAndName() (namespace, name string)

func (DeploymentSpec) Validate

func (c DeploymentSpec) Validate(charts map[string]*ChartSpec) error

type DeploymentState

type DeploymentState struct {
	Present    bool
	CRDPresent bool

	// set --validate=false to kubectl
	DisableValidation bool

	UnknownStates string
}

func (DeploymentState) Validate

func (s DeploymentState) Validate() error

type Environment

type Environment struct {
	Name        string           `json:"name" yaml:"name"`
	KubeContext string           `json:"kubeContext" yaml:"kubeContext"`
	Deployments []DeploymentSpec `json:"deployments" yaml:"deployments"`
}

func (Environment) Apply

func (e Environment) Apply(ctx context.Context, dryRunArg, envDir string, charts map[string]*ChartSpec) error

func (Environment) CustomManifestsDir

func (e Environment) CustomManifestsDir(envDir string, dep *DeploymentSpec) string

func (Environment) Ensure

func (e Environment) Ensure(
	ctx context.Context,
	chartsDir, localChartsDir, envDir string,
	charts map[string]*ChartSpec,
) error

func (Environment) Gen

func (e Environment) Gen(
	ctx context.Context,
	chartsDir, localChartsDir, envDir string,
	charts map[string]*ChartSpec,
) error

nolint:gocyclo

func (Environment) ManifestsDir

func (e Environment) ManifestsDir(envDir string) string

func (Environment) Validate

func (e Environment) Validate(charts map[string]*ChartSpec) error

func (Environment) ValuesDir

func (e Environment) ValuesDir(envDir string) string

type RepoSpec

type RepoSpec struct {
	Name string `json:"name" yaml:"name"`
	URL  string `json:"url" yaml:"url"`
	Auth struct {
		HTTPBasic struct {
			Username string `json:"username" yaml:"username"`
			Password string `json:"password" yaml:"password"`
		} `json:"httpBasic" yaml:"httpBasic"`
	} `json:"auth" yaml:"auth"`

	TLS tlshelper.TLSConfig `json:"tls" yaml:"tls"`
}

func (RepoSpec) Validate

func (r RepoSpec) Validate() error

type ResolvedConfig

type ResolvedConfig struct {
	App          *AppConfig
	Repos        map[string]*RepoSpec
	Charts       map[string]*ChartSpec
	Environments map[string]*Environment
}

func NewEmptyResolvedConfig

func NewEmptyResolvedConfig() *ResolvedConfig

Jump to

Keyboard shortcuts

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