helm

package
v0.0.0-...-81d30be Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsRouteNoHostError

func IsRouteNoHostError(err error) bool

func RenderChart

func RenderChart(chartPath, namespace, kubeVersion string, values interface{}) (map[string][]manifest.Manifest, map[string]interface{}, error)

RenderChart renders the helm charts, returning a map of rendered templates. key names represent the chart from which the template was processed. Subcharts will be keyed as <root-name>/charts/<subchart-name>, e.g. istio/charts/galley. The root chart would be simply, istio.

func SortByKind

func SortByKind(manifests []manifest.Manifest) []manifest.Manifest

SortByKind sorts manifests in InstallOrder

Types

type ManifestProcessor

type ManifestProcessor struct {
	common.ControllerResources
	PatchFactory *PatchFactory
	// contains filtered or unexported fields
}

func NewManifestProcessor

func NewManifestProcessor(controllerResources common.ControllerResources, patchFactory *PatchFactory,
	appInstance, appVersion string, owner types.NamespacedName,
	preprocessObjectFunc func(ctx context.Context, obj *unstructured.Unstructured) (bool, error),
	postProcessObjectFunc func(ctx context.Context, obj *unstructured.Unstructured) error,
	preprocessObjectForPatchFunc func(ctx context.Context, oldObj, newObj *unstructured.Unstructured) (*unstructured.Unstructured, error),
) *ManifestProcessor

func (*ManifestProcessor) ProcessManifest

func (p *ManifestProcessor) ProcessManifest(ctx context.Context, man manifest.Manifest, component string) (madeChanges bool, allErrors []error)

func (*ManifestProcessor) ProcessManifests

func (p *ManifestProcessor) ProcessManifests(ctx context.Context, manifests []manifest.Manifest, component string) (madeChanges bool, err error)

type Patch

type Patch interface {
	Apply(ctx context.Context) (*unstructured.Unstructured, error)
}

Patch represents a "patch" for an object

type PatchFactory

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

PatchFactory wraps the objects needed to create Patch objects.

func NewPatchFactory

func NewPatchFactory(k8sClient client.Client) *PatchFactory

NewPatchFactory creates a new PatchFactory

func (*PatchFactory) CreatePatch

func (p *PatchFactory) CreatePatch(oldObj, newObj *unstructured.Unstructured) (Patch, error)

CreatePatch creates a patch based on the current and new versions of an object

type SortOrder

type SortOrder []string

SortOrder is an ordering of Kinds.

var InstallOrder SortOrder = []string{
	"Namespace",
	"NetworkPolicy",
	"ResourceQuota",
	"LimitRange",
	"PodSecurityPolicy",
	"PodDisruptionBudget",
	"Secret",
	"ConfigMap",
	"StorageClass",
	"PersistentVolume",
	"PersistentVolumeClaim",
	"ServiceAccount",
	"CustomResourceDefinition",
	"ClusterRole",
	"ClusterRoleList",
	"ClusterRoleBinding",
	"ClusterRoleBindingList",
	"Role",
	"RoleList",
	"RoleBinding",
	"RoleBindingList",
	"Service",
	"DaemonSet",
	"Pod",
	"ReplicationController",
	"ReplicaSet",
	"Deployment",
	"HorizontalPodAutoscaler",
	"StatefulSet",
	"Job",
	"CronJob",
	"Ingress",
	"APIService",
}

InstallOrder is the order in which manifests should be installed (by Kind).

Those occurring earlier in the list get installed before those occurring later in the list.

var UninstallOrder SortOrder = []string{
	"APIService",
	"Ingress",
	"Service",
	"CronJob",
	"Job",
	"StatefulSet",
	"HorizontalPodAutoscaler",
	"Deployment",
	"ReplicaSet",
	"ReplicationController",
	"Pod",
	"DaemonSet",
	"RoleBindingList",
	"RoleBinding",
	"RoleList",
	"Role",
	"ClusterRoleBindingList",
	"ClusterRoleBinding",
	"ClusterRoleList",
	"ClusterRole",
	"CustomResourceDefinition",
	"ServiceAccount",
	"PersistentVolumeClaim",
	"PersistentVolume",
	"StorageClass",
	"ConfigMap",
	"Secret",
	"PodDisruptionBudget",
	"PodSecurityPolicy",
	"LimitRange",
	"ResourceQuota",
	"NetworkPolicy",
	"Namespace",
}

UninstallOrder is the order in which manifests should be uninstalled (by Kind).

Those occurring earlier in the list get uninstalled before those occurring later in the list.

Jump to

Keyboard shortcuts

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