env

package
v0.15.1 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Configuration for drone-helm itself
	Command            string   `envconfig:"mode"`                   // Helm command to run
	DroneEvent         string   `envconfig:"drone_build_event"`      // Drone event that invoked this plugin.
	UpdateDependencies bool     `split_words:"true"`                 // [Deprecated] Call `helm dependency update` before the main command (deprecated, use dependencies_action: update instead)
	DependenciesAction string   `split_words:"true"`                 // Call `helm dependency build` or `helm dependency update` before the main command
	AddRepos           []string `split_words:"true"`                 // Call `helm repo add` before the main command
	RepoCertificate    string   `envconfig:"repo_certificate"`       // The Helm chart repository's self-signed certificate (must be base64-encoded)
	RepoCACertificate  string   `envconfig:"repo_ca_certificate"`    // The Helm chart repository CA's self-signed certificate (must be base64-encoded)
	Debug              bool     ``                                   // Generate debug output and pass --debug to all helm commands
	Values             string   ``                                   // Argument to pass to --set in applicable helm commands
	StringValues       string   `split_words:"true"`                 // Argument to pass to --set-string in applicable helm commands
	ValuesFiles        []string `split_words:"true"`                 // Arguments to pass to --values in applicable helm commands
	Namespace          string   ``                                   // Kubernetes namespace for all helm commands
	CreateNamespace    bool     `split_words:"true"`                 // Pass --create-namespace to `helm upgrade`
	KubeToken          string   `split_words:"true"`                 // Kubernetes authentication token to put in .kube/config
	SkipKubeconfig     bool     `envconfig:"skip_kubeconfig"`        // Skip kubeconfig creation
	SkipTLSVerify      bool     `envconfig:"skip_tls_verify"`        // Put insecure-skip-tls-verify in .kube/config
	Certificate        string   `envconfig:"kube_certificate"`       // The Kubernetes cluster CA's self-signed certificate (must be base64-encoded)
	APIServer          string   `envconfig:"kube_api_server"`        // The Kubernetes cluster's API endpoint
	ServiceAccount     string   `envconfig:"kube_service_account"`   // Account to use for connecting to the Kubernetes cluster
	ChartVersion       string   `split_words:"true"`                 // Specific chart version to use in `helm upgrade`
	DryRun             bool     `split_words:"true"`                 // Pass --dry-run to applicable helm commands
	Wait               bool     `envconfig:"wait_for_upgrade"`       // Pass --wait to applicable helm commands
	ReuseValues        bool     `split_words:"true"`                 // Pass --reuse-values to `helm upgrade`
	KeepHistory        bool     `split_words:"true"`                 // Pass --keep-history to `helm uninstall`
	HistoryMax         int      `split_words:"true"`                 // Pass --history-max option
	Timeout            string   ``                                   // Argument to pass to --timeout in applicable helm commands
	Chart              string   ``                                   // Chart argument to use in applicable helm commands
	Release            string   ``                                   // Release argument to use in applicable helm commands
	Force              bool     `envconfig:"force_upgrade"`          // Pass --force to applicable helm commands
	AtomicUpgrade      bool     `split_words:"true"`                 // Pass --atomic to `helm upgrade`
	CleanupOnFail      bool     `envconfig:"cleanup_failed_upgrade"` // Pass --cleanup-on-fail to `helm upgrade`
	LintStrictly       bool     `split_words:"true"`                 // Pass --strict to `helm lint`
	SkipCrds           bool     `split_words:"true"`                 // Pass --skip-crds to `helm upgrade`

	Stdout io.Writer `ignored:"true"`
	Stderr io.Writer `ignored:"true"`
}

The Config struct captures the `settings` and `environment` blocks in the application's drone config. Configuration in drone's `settings` block arrives as uppercase env vars matching the config key, prefixed with `PLUGIN_`. Config from the `environment` block is uppercased, but does not have the `PLUGIN_` prefix.

func NewConfig

func NewConfig(stdout, stderr io.Writer) (*Config, error)

NewConfig creates a Config and reads environment variables into it, accounting for several possible formats.

func NewTestConfig added in v0.15.0

func NewTestConfig(t *testing.T) *Config

NewTestConfig is a helper for setting up a Config object and error checking

Jump to

Keyboard shortcuts

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