utils

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// CreateEventFilter is the predicate for CreateEvent only.
	CreateEventFilter = predicate.Funcs{
		CreateFunc: func(event event.CreateEvent) bool {
			return true
		},
		DeleteFunc: func(event event.DeleteEvent) bool {
			return false
		},
		UpdateFunc: func(event event.UpdateEvent) bool {
			return false
		},
		GenericFunc: func(event event.GenericEvent) bool {
			return false
		},
	}

	// DeleteEventFilter is the predicate for DeleteEvent only.
	DeleteEventFilter = predicate.Funcs{
		CreateFunc: func(event event.CreateEvent) bool {
			return false
		},
		DeleteFunc: func(event event.DeleteEvent) bool {
			return true
		},
		UpdateFunc: func(event event.UpdateEvent) bool {
			return false
		},
		GenericFunc: func(event event.GenericEvent) bool {
			return false
		},
	}

	// UpdateEventFilter is the predicate for UpdateEvent only.
	UpdateEventFilter = predicate.Funcs{
		CreateFunc: func(event event.CreateEvent) bool {
			return false
		},
		DeleteFunc: func(event event.DeleteEvent) bool {
			return false
		},
		UpdateFunc: func(event event.UpdateEvent) bool {
			return true
		},
		GenericFunc: func(event event.GenericEvent) bool {
			return false
		},
	}

	// GenericEventFilter is the predicate for GenericEvent only.
	GenericEventFilter = predicate.Funcs{
		CreateFunc: func(event event.CreateEvent) bool {
			return false
		},
		DeleteFunc: func(event event.DeleteEvent) bool {
			return false
		},
		UpdateFunc: func(event event.UpdateEvent) bool {
			return false
		},
		GenericFunc: func(event event.GenericEvent) bool {
			return true
		},
	}
)

Functions

func GetNamespacedName

func GetNamespacedName(obj client.Object) types.NamespacedName

func IsAdvancedStatefulSetRolledOut added in v0.2.4

func IsAdvancedStatefulSetRolledOut(statefulSet *kruiseappsv1beta1.StatefulSet) bool

func IsCloneSetRolledOut added in v0.2.4

func IsCloneSetRolledOut(cloneSet *kruiseappsv1alpha1.CloneSet) bool

func IsDeleted

func IsDeleted(obj client.Object) bool

func IsDeploymentRolledOut

func IsDeploymentRolledOut(deploy *appsv1.Deployment) bool

func IsServiceReady

func IsServiceReady(svc *corev1.Service) bool

func IsStatefulSetRolledOut

func IsStatefulSetRolledOut(statefulSet *appsv1.StatefulSet) bool

func IsVersionServingInCustomResourceDefinition

func IsVersionServingInCustomResourceDefinition(crd *apiextensionsv1.CustomResourceDefinition, version string) bool

Types

type EnvVarSlice

type EnvVarSlice []corev1.EnvVar

func (EnvVarSlice) Len

func (s EnvVarSlice) Len() int

func (EnvVarSlice) Less

func (s EnvVarSlice) Less(i, j int) bool

func (EnvVarSlice) Swap

func (s EnvVarSlice) Swap(i, j int)

type VolumeDeviceSlice

type VolumeDeviceSlice []corev1.VolumeDevice

func (VolumeDeviceSlice) Len

func (s VolumeDeviceSlice) Len() int

func (VolumeDeviceSlice) Less

func (s VolumeDeviceSlice) Less(i, j int) bool

func (VolumeDeviceSlice) Swap

func (s VolumeDeviceSlice) Swap(i, j int)

type VolumeMountSlice

type VolumeMountSlice []corev1.VolumeMount

func (VolumeMountSlice) Len

func (s VolumeMountSlice) Len() int

func (VolumeMountSlice) Less

func (s VolumeMountSlice) Less(i, j int) bool

func (VolumeMountSlice) Swap

func (s VolumeMountSlice) Swap(i, j int)

type VolumeSlice

type VolumeSlice []corev1.Volume

func (VolumeSlice) Len

func (s VolumeSlice) Len() int

func (VolumeSlice) Less

func (s VolumeSlice) Less(i, j int) bool

func (VolumeSlice) Swap

func (s VolumeSlice) Swap(i, j int)

type WebhookType added in v0.2.2

type WebhookType string

WebhookType defines an immutable type for a webhook. Use NewWebhookType to instantiate.

const (
	ValidatingWebhookType WebhookType = "validating"
	MutatingWebhookType   WebhookType = "mutating"
)

Valid webhook types.

func (WebhookType) IsMutating added in v0.2.2

func (wt WebhookType) IsMutating() bool

IsMutating is true if wt is a mutating webhook, else false.

func (WebhookType) IsValidating added in v0.2.2

func (wt WebhookType) IsValidating() bool

IsValidating is true if wt is a validating webhook, else false.

func (WebhookType) String added in v0.2.2

func (wt WebhookType) String() string

Jump to

Keyboard shortcuts

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