config

package
v0.0.0-...-6a1c4ee Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2021 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

View Source
const (
	//LABEL_KEY_ORIGIN is used for marking where resource comes from.
	LABEL_KEY_ORIGIN = "origin"

	//LABEL_VALUE_KYMA indicates that resource is managed by Kyma.
	//Used for marking CRDs, so they can be deleted during uninstallation.
	LABEL_VALUE_KYMA = "kyma"
)

Variables

This section is empty.

Functions

func RestConfig

func RestConfig(kubeconfigSource KubeconfigSource) (*rest.Config, error)

RestConfig returns a kubeconfig REST Config used by k8s clients.

Types

type CleanupFunc

type CleanupFunc func() error

CleanupFunc defines the contract for removing a temporary kubeconfig file.

func Path

func Path(kubeconfigSource KubeconfigSource) (resPath string, cf CleanupFunc, err error)

Path returns a filesystem path to the kubeconfig file. It may render the kubeconfig to a temporary file. In order to ensure proper cleanup you should always call the returned CleanupFunc using `defer` statement.

type ComponentDefinition

type ComponentDefinition struct {
	Name      string
	Namespace string
}

ComponentDefinition defines a component in components list

type ComponentList

type ComponentList struct {
	Prerequisites []ComponentDefinition
	Components    []ComponentDefinition
}

ComponentList collects component definitions

func NewComponentList

func NewComponentList(componentsListPath string) (*ComponentList, error)

NewComponentList creates a new component list

func (*ComponentList) Add

func (cl *ComponentList) Add(compName, namespace string)

Add creates a new component definition and adds it to the component list If namespace is an empty string, then the default namespace is used

func (*ComponentList) Remove

func (cl *ComponentList) Remove(compName string)

Remove drops any component definition with this particular name (independent whether it is listed as prequisite or component)

type ComponentListData

type ComponentListData struct {
	DefaultNamespace string `yaml:"defaultNamespace" json:"defaultNamespace"`
	Prerequisites    []ComponentDefinition
	Components       []ComponentDefinition
}

ComponentListData is the raw component list

type Config

type Config struct {
	//Number of parallel workers used for an install/uninstall operation
	WorkersCount int
	//After this time workers' context is canceled. Pending worker goroutines (if any) may continue if blocked by Helm client.
	CancelTimeout time.Duration
	//After this time install/delete operation is aborted and returns an error to the user.
	//Worker goroutines may still be working in the background.
	//Must be greater than CancelTimeout.
	QuitTimeout time.Duration
	//Timeout for the underlying Helm client
	HelmTimeoutSeconds int
	//Initial interval used for exponent backoff retry policy
	BackoffInitialIntervalSeconds int
	//Maximum time used for exponent backoff retry policy
	BackoffMaxElapsedTimeSeconds int
	//Logger to use
	Log logger.Interface
	//Maximum number of Helm revision saved per release
	HelmMaxRevisionHistory int
	//Installation / Upgrade profile: evaluation|production
	Profile string
	// Kyma components list
	ComponentList *ComponentList
	// Path to Kyma resources
	ResourcePath string
	// Path to Kyma installation resources
	InstallationResourcePath string
	// Kubeconfig source
	KubeconfigSource KubeconfigSource
	//Kyma version
	Version string
	// Reuse Helm chart values for upgrade
	ReuseHelmValues bool
	// Atomic deployment
	Atomic bool
	// Keep Kyma CRDs during deletion
	KeepCRDs bool
}

Configures various install/uninstall operation parameters. There are no different parameters for the "install" and "delete" operations. If you need different configurations, just use two different Installation instances.

func (*Config) ValidateDeletion

func (c *Config) ValidateDeletion() error

ValidateDeletion verifies that deletion specific options are provided

func (*Config) ValidateDeployment

func (c *Config) ValidateDeployment() error

ValidateDeployment verifies that deployment specific options are provided

type KubeconfigSource

type KubeconfigSource struct {
	// Path to the Kubeconfig file
	Path string
	// Kubeconfig content in YAML format
	Content string
}

KubeconfigSource aggregates kubeconfig in a form of either a path or a raw content. If both Path and Content are being provided, then path takes precedence.

Jump to

Keyboard shortcuts

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