operation

package
v0.0.0-...-133fb1b Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2018 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Operation

type Operation struct {
	Logger              *logrus.Entry
	GardenerInfo        *gardenv1beta1.Gardener
	Secrets             map[string]*corev1.Secret
	CheckSums           map[string]string
	Garden              *garden.Garden
	Seed                *seed.Seed
	Shoot               *shoot.Shoot
	K8sGardenClient     kubernetes.Client
	K8sGardenInformers  gardeninformers.Interface
	K8sSeedClient       kubernetes.Client
	K8sShootClient      kubernetes.Client
	ChartGardenRenderer chartrenderer.ChartRenderer
	ChartSeedRenderer   chartrenderer.ChartRenderer
	ChartShootRenderer  chartrenderer.ChartRenderer
	APIServerIngresses  []corev1.LoadBalancerIngress
	APIServerAddress    string
}

Operation contains all data required to perform an operation on a Shoot cluster.

func New

func New(shoot *gardenv1beta1.Shoot, shootLogger *logrus.Entry, k8sGardenClient kubernetes.Client, k8sGardenInformers gardeninformers.Interface, gardenerInfo *gardenv1beta1.Gardener, secretsMap map[string]*corev1.Secret) (*Operation, error)

New creates a new operation object.

func (*Operation) ApplyChartGarden

func (o *Operation) ApplyChartGarden(chartPath, name, namespace string, defaultValues, additionalValues map[string]interface{}) error

ApplyChartGarden takes a path to a chart <chartPath>, name of the release <name>, release's namespace <namespace> and two maps <defaultValues>, <additionalValues>, and renders the template based on the merged result of both value maps. The resulting manifest will be applied to the Garden cluster.

func (*Operation) ApplyChartSeed

func (o *Operation) ApplyChartSeed(chartPath, name, namespace string, defaultValues, additionalValues map[string]interface{}) error

ApplyChartSeed takes a path to a chart <chartPath>, name of the release <name>, release's namespace <namespace> and two maps <defaultValues>, <additionalValues>, and renders the template based on the merged result of both value maps. The resulting manifest will be applied to the Seed cluster.

func (*Operation) ApplyChartShoot

func (o *Operation) ApplyChartShoot(chartPath, name, namespace string, defaultValues, additionalValues map[string]interface{}) error

ApplyChartShoot takes a path to a chart <chartPath>, name of the release <name>, release's namespace <namespace> and two maps <defaultValues>, <additionalValues>, and renders the template based on the merged result of both value maps. The resulting manifest will be applied to the Shoot cluster.

func (*Operation) EnsureImagePullSecretsGarden

func (o *Operation) EnsureImagePullSecretsGarden() error

EnsureImagePullSecretsGarden ensures that the image pull secrets do exist in the Garden cluster namespace in which the Shoot resource has been created, and that the default service account in that namespace contains the respective .imagePullSecrets[] field.

func (*Operation) EnsureImagePullSecretsSeed

func (o *Operation) EnsureImagePullSecretsSeed() error

EnsureImagePullSecretsSeed ensures that the image pull secrets do exist in the Seed cluster's Shoot namespace and that the default service account in that namespace contains the respective .imagePullSecrets[] field.

func (*Operation) EnsureImagePullSecretsShoot

func (o *Operation) EnsureImagePullSecretsShoot() error

EnsureImagePullSecretsShoot ensures that the image pull secrets do exist in the Shoot cluster's kube-system namespace and that the default service account in that namespace contains the respective .imagePullSecrets[] field.

func (*Operation) GetImagePullSecretsMap

func (o *Operation) GetImagePullSecretsMap() []map[string]interface{}

GetImagePullSecretsMap returns all known image pull secrets as map whereas the key is "name" and the value is the respective name of the image pull secret. The map can be used to specify a list of image pull secrets on a Kubernetes PodTemplateSpec object.

func (*Operation) GetSecretKeysOfRole

func (o *Operation) GetSecretKeysOfRole(kind string) []string

GetSecretKeysOfRole returns a list of keys which are present in the Garden Secrets map and which are prefixed with <kind>.

func (*Operation) InitializeSeedClients

func (o *Operation) InitializeSeedClients() error

InitializeSeedClients will use the Garden Kubernetes client to read the Seed Secret in the Garden cluster which contains a Kubeconfig that can be used to authenticate against the Seed cluster. With it, a Kubernetes client as well as a Chart renderer for the Seed cluster will be initialized and attached to the already existing Operation object.

func (*Operation) InitializeShootClients

func (o *Operation) InitializeShootClients() error

InitializeShootClients will use the Seed Kubernetes client to read the gardener Secret in the Seed cluster which contains a Kubeconfig that can be used to authenticate against the Shoot cluster. With it, a Kubernetes client as well as a Chart renderer for the Shoot cluster will be initialized and attached to the already existing Operation object.

func (*Operation) ReportShootProgress

func (o *Operation) ReportShootProgress(progress int, currentFunctions string)

ReportShootProgress will update the last operation object in the Shoot manifest `status` section by the current progress of the Flow execution.

Jump to

Keyboard shortcuts

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