apply

package
v0.3.18 Latest Latest
Warning

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

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

Documentation

Overview

Package apply applies Hel Releases

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompareAsJSON

func CompareAsJSON(one, two interface{}) bool

Types

type KubectlLayerApplier

type KubectlLayerApplier struct {
	// contains filtered or unexported fields
}

KubectlLayerApplier applies an AddonsLayer to a Kubernetes cluster using the kubectl command.

func (KubectlLayerApplier) Adopt added in v0.3.0

Adopt sets an orphaned HelmRelease to a new owner. It returns a bool value set to true if the HelmRelease is still waiting for adoption or false if the adoption period has expired.

func (KubectlLayerApplier) Apply

func (a KubectlLayerApplier) Apply(ctx context.Context, layer layers.Layer) (err error)

Apply an AddonLayer to the cluster.

func (KubectlLayerApplier) ApplyIsRequired

func (a KubectlLayerApplier) ApplyIsRequired(ctx context.Context, layer layers.Layer) (applyIsRequired bool, err error)

ApplyIsRequired returns true if any resources need to be applied for this AddonsLayer

func (KubectlLayerApplier) ApplyWasSuccessful

func (a KubectlLayerApplier) ApplyWasSuccessful(ctx context.Context, layer layers.Layer) (applyIsRequired bool, hrName string, err error)

ApplyWasSuccessful returns true if all of the resources in this AddonsLayer are in the Success phase

func (KubectlLayerApplier) GetHelmReleases added in v0.3.0

func (a KubectlLayerApplier) GetHelmReleases(ctx context.Context, layer layers.Layer) (foundHrs map[string]*helmctlv2.HelmRelease, err error)

func (KubectlLayerApplier) GetOrphanedHelmReleases added in v0.3.0

func (a KubectlLayerApplier) GetOrphanedHelmReleases(ctx context.Context, layer layers.Layer) (foundHrs map[string]*helmctlv2.HelmRelease, err error)

GetOrphanedHelmReleases returns a map of HelmReleases that are labeled as orphaned and not owned by layer

func (KubectlLayerApplier) GetResources

func (a KubectlLayerApplier) GetResources(ctx context.Context, layer layers.Layer) (resources []kraanv1alpha1.Resource, err error)

GetResources returns a list of resources for this AddonsLayer

func (KubectlLayerApplier) GetSourceAndClusterHelmReleases added in v0.3.0

func (a KubectlLayerApplier) GetSourceAndClusterHelmReleases(ctx context.Context, layer layers.Layer) (sourceHrs, clusterHrs map[string]*helmctlv2.HelmRelease, err error)

GetSourceAndClusterHelmReleases returns source and cluster helmreleases

func (KubectlLayerApplier) Orphan added in v0.3.0

func (a KubectlLayerApplier) Orphan(ctx context.Context, layer layers.Layer, hr *helmctlv2.HelmRelease) (pending bool, err error)

Orphan adds an 'orphan' label to a HelmRelease if not already present. It returns a bool value set to true if the HelmRelease is still waiting for adoption or false if the adoption period has expired.

func (KubectlLayerApplier) Prune

func (a KubectlLayerApplier) Prune(ctx context.Context, layer layers.Layer, pruneHrs []*helmctlv2.HelmRelease) (err error)

Prune the AddonsLayer by removing the Addons found in the cluster that have since been removed from the Layer.

func (KubectlLayerApplier) PruneIsRequired

func (a KubectlLayerApplier) PruneIsRequired(ctx context.Context, layer layers.Layer) (pruneRequired bool, pruneHrs []*helmctlv2.HelmRelease, err error)

PruneIsRequired returns true if any resources need to be pruned for this AddonsLayer

type LayerApplier

type LayerApplier interface {
	Apply(ctx context.Context, layer layers.Layer) (err error)
	Prune(ctx context.Context, layer layers.Layer, pruneHrs []*helmctlv2.HelmRelease) (err error)
	PruneIsRequired(ctx context.Context, layer layers.Layer) (pruneRequired bool, pruneHrs []*helmctlv2.HelmRelease, err error)
	ApplyIsRequired(ctx context.Context, layer layers.Layer) (applyIsRequired bool, err error)
	ApplyWasSuccessful(ctx context.Context, layer layers.Layer) (applyIsRequired bool, hrName string, err error)
	GetResources(ctx context.Context, layer layers.Layer) (resources []kraanv1alpha1.Resource, err error)
	GetSourceAndClusterHelmReleases(ctx context.Context, layer layers.Layer) (sourceHrs, clusterHrs map[string]*helmctlv2.HelmRelease, err error)
	Orphan(ctx context.Context, layer layers.Layer, hr *helmctlv2.HelmRelease) (bool, error)
	GetOrphanedHelmReleases(ctx context.Context, layer layers.Layer) (foundHrs map[string]*helmctlv2.HelmRelease, err error)
	Adopt(ctx context.Context, layer layers.Layer, hr *helmctlv2.HelmRelease) error

	GetHelmReleases(ctx context.Context, layer layers.Layer) (foundHrs map[string]*helmctlv2.HelmRelease, err error)
	// contains filtered or unexported methods
}

LayerApplier defines methods for managing the Addons within an AddonLayer in a cluster.

func NewApplier

func NewApplier(client client.Client, logger logr.Logger, scheme *runtime.Scheme) (applier LayerApplier, err error)

NewApplier returns a LayerApplier instance.

Jump to

Keyboard shortcuts

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