clusteraddon

package
v0.1.0-alpha.7 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package clusteraddon contains function for cluster addon config operations.

Index

Constants

This section is empty.

Variables

View Source
var (
	// Apply applies a helm chart.
	Apply = Action("apply")

	// Delete deletes a helm chart.
	Delete = Action("delete")
)
View Source
var ErrConditionNotMatch = errors.New("condition don't match")

ErrConditionNotMatch is used when the specified CEL expression doesn't match in the stage.

Functions

This section is empty.

Types

type Action

type Action string

Action is the type for helm chart action (e.g. - apply, delete).

type Config

type Config struct {
	APIVersion          string              `yaml:"apiVersion"`
	ClusterAddonVersion string              `yaml:"clusterAddonVersion"`
	AddonStages         map[string][]*Stage `yaml:"addonStages"`
}

Config is a configuration for multi-stage cluster addons.

func ParseConfig

func ParseConfig(path string) (Config, error)

ParseConfig parses a file whose path is given and returns a config struct.

type Object

type Object struct {
	Key        string `yaml:"key"`
	APIVersion string `yaml:"apiVersion"`
	Name       string `yaml:"name"`
	Kind       string `yaml:"kind"`
	Namespace  string `yaml:"namespace"`
}

Object is a representation of a Kubernetes object plus a key for evaluating CEL expressions with that object.

type Stage

type Stage struct {
	Name                 string           `yaml:"name"`
	Action               Action           `yaml:"action"`
	WaitForPreCondition  WaitForCondition `yaml:"waitForPreCondition,omitempty"`
	WaitForPostCondition WaitForCondition `yaml:"waitForPostCondition,omitempty"`
}

Stage is a stage of a hook in which a certain Helm chart is applied and pre- and post-conditions are evaluated if they exist.

type WaitForCondition

type WaitForCondition struct {
	Objects    []Object `yaml:"objects"`
	Conditions string   `yaml:"conditions"`
}

WaitForCondition contains objects and conditions to use in CEL expressions.

Jump to

Keyboard shortcuts

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