kubeutil

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2022 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DeploymentGVK = schema.GroupVersionKind{
		Group:   appsv1.GroupName,
		Version: "v1",
		Kind:    "Deployment",
	}
	ServiceGVK = schema.GroupVersionKind{
		Group:   corev1.GroupName,
		Version: "v1",
		Kind:    "Service",
	}
	IngressGVK = schema.GroupVersionKind{
		Group:   netv1.GroupName,
		Version: "v1",
		Kind:    "Ingress",
	}
)

Functions

func Apply

func Apply(ctx context.Context, c client.Client, obj *unstructured.Unstructured, fieldManager string, dryrun, force bool) (patched *unstructured.Unstructured, err error)

func GetUnstructured

func GetUnstructured(ctx context.Context, c client.Client, gvk schema.GroupVersionKind, name, namespace string) (*unstructured.Unstructured, error)

func IsGVKEqual

func IsGVKEqual(a, b schema.GroupVersionKind) bool

func ListTemplatesByType

func ListTemplatesByType(ctx context.Context, c client.Client, tmplTypes []string) ([]cosmov1alpha1.Template, error)

func LooseDeepEqual

func LooseDeepEqual(xObj, yObj Comparable, opts ...DeepEqualOption) bool

LooseDeepEqual deep equal objects without dynamic values

func PodStatusReason

func PodStatusReason(pod corev1.Pod) string

func RemoveDynamicFields

func RemoveDynamicFields(obj Comparable)

Types

type Comparable

type Comparable interface {
	runtime.Object
	SetGroupVersionKind(gvk schema.GroupVersionKind)
	GetManagedFields() []metav1.ManagedFieldsEntry
	SetManagedFields(managedFields []metav1.ManagedFieldsEntry)
	SetResourceVersion(resourceVersion string)
}

type DeepEqualOption

type DeepEqualOption interface {
	Apply(x, y Comparable)
}

func WithFixGVK

func WithFixGVK(scheme *runtime.Scheme) DeepEqualOption

func WithPrintDiff

func WithPrintDiff(w io.Writer) DeepEqualOption

Directories

Path Synopsis
test

Jump to

Keyboard shortcuts

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