kubeutils

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2024 License: Apache-2.0 Imports: 39 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Apply

func Apply(ctx context.Context, rcg genericclioptions.RESTClientGetter, root, manifestPath string) (string, error)

Apply is the equivalent of 'kubectl apply --server-side -f'. If the given manifest is a kustomization.yaml, then apply performs the equivalent of 'kubectl apply --server-side -k'.

func FilterUnstructured

func FilterUnstructured(objs []*unstructured.Unstructured, filter func(*unstructured.Unstructured) bool) []*unstructured.Unstructured

FilterUnstructured returns a slice of unstructured objects that match the given filter.

func KubeClient

KubeClient returns a new Kubernetes client.

func KubeConfig

KubeConfig returns a new Kubernetes rest config.

func MustInstallKustomization

func MustInstallKustomization(ctx context.Context, kubeClient client.Client, name, namespace string) bool

MustInstallKustomization returns true if the given kustomization is not installed.

func MustInstallNS

func MustInstallNS(ctx context.Context, kubeClient client.Client, namespace string) bool

MustInstallNS returns true if the given namespace is not installed.

func NSFilter

func NSFilter(ns string) func(*unstructured.Unstructured) bool

NSFilter returns a filter that filters out the given namespace.

func NewScheme

func NewScheme() (scheme *apiruntime.Scheme, err error)

NewScheme creates the Scheme methods for serializing and deserializing API objects

func ReconcileGitrepository

func ReconcileGitrepository(ctx context.Context, kubeClient client.Client, name, namespace string) error

ReconcileGitrepository reconciles the given git repository.

func ReconcileKustomization

func ReconcileKustomization(ctx context.Context, kubeClient client.Client, name, namespace string) error

ReconcileKustomization reconciles the given kustomization.

func ReportComponentsHealth

func ReportComponentsHealth(ctx context.Context, rcg genericclioptions.RESTClientGetter, timeout time.Duration, components []string, ns string) error

ReportComponentsHealth reconciles the health of the given components.

func ReportGitrepositoryHealth

func ReportGitrepositoryHealth(ctx context.Context, kubeClient client.Client, name, namespace, expectedRevision string, pollInterval, timeout time.Duration) error

ReportGitrepositoryHealth reconciles the health of the given git repository.

func ReportKustomizationHealth

func ReportKustomizationHealth(ctx context.Context, kubeClient client.Client, name, namespace, expectedRevision string, pollInterval, timeout time.Duration) error

ReportKustomizationHealth reconciles the health of the given kustomization.

func UnstructuredToYaml

func UnstructuredToYaml(objs []*unstructured.Unstructured) ([]byte, error)

func YamlToUnstructructured

func YamlToUnstructructured(data []byte) ([]*unstructured.Unstructured, error)

YamlToUnstructructured converts the given yaml to a slice of unstructured objects.

Types

This section is empty.

Jump to

Keyboard shortcuts

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