Documentation ¶
Index ¶
- Variables
- func DependsOn(a, b corev1.EnvVar) bool
- func GetContainerFromPod(pod *corev1.Pod, name string) *corev1.Container
- func GetCustomResourceDefinition(ctx context.Context, client client.Reader, gk metav1.GroupKind) (*apiextensionsv1.CustomResourceDefinition, error)
- func GetNamespacedName(obj client.Object) types.NamespacedName
- func GetPortFromContainer(container *corev1.Container, name string) (int32, bool)
- func GetVersionFromImage(image string) string
- func IsAdvancedStatefulSetRolledOut(statefulSet *kruiseappsv1beta1.StatefulSet) bool
- func IsCloneSetRolledOut(cloneSet *kruiseappsv1alpha1.CloneSet) bool
- func IsDeleted(obj client.Object) bool
- func IsDeploymentRolledOut(deploy *appsv1.Deployment) bool
- func IsPodRunning(pod *corev1.Pod) bool
- func IsStatefulSetRolledOut(statefulSet *appsv1.StatefulSet) bool
- func IsVersionServingInCustomResourceDefinition(crd *apiextensionsv1.CustomResourceDefinition, version string) bool
- func MapObjectsToNames[T any, TP ptrAsObject[T]](objects []T) []string
- func TopologicalSort(e []corev1.EnvVar)
- type VolumeDeviceSlice
- type VolumeMountSlice
- type VolumeSlice
- type WebhookType
Constants ¶
This section is empty.
Variables ¶
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 GetContainerFromPod ¶ added in v0.2.6
GetContainerFromPod gets a pointer to the container with the same name. Nil is returned when the container isn't found.
func GetCustomResourceDefinition ¶
func GetCustomResourceDefinition(ctx context.Context, client client.Reader, gk metav1.GroupKind) (*apiextensionsv1.CustomResourceDefinition, error)
GetCustomResourceDefinition is the helper function to get the CRD for the given group kind.
func GetNamespacedName ¶
func GetNamespacedName(obj client.Object) types.NamespacedName
GetNamespacedName returns the NamespacedName of the given object.
func GetPortFromContainer ¶ added in v0.2.6
GetPortFromContainer gets the specified port from the container. If the port's not found, it returns a false.
func GetVersionFromImage ¶ added in v0.2.6
GetVersionFromImage return the version from spec.image.
func IsAdvancedStatefulSetRolledOut ¶ added in v0.2.4
func IsAdvancedStatefulSetRolledOut(statefulSet *kruiseappsv1beta1.StatefulSet) bool
IsAdvancedStatefulSetRolledOut returns true when the OpenKruise StatefulSet is rolled out.
func IsCloneSetRolledOut ¶ added in v0.2.4
func IsCloneSetRolledOut(cloneSet *kruiseappsv1alpha1.CloneSet) bool
IsCloneSetRolledOut returns true when the OpenKruise CloneSet is rolled out.
func IsDeploymentRolledOut ¶
func IsDeploymentRolledOut(deploy *appsv1.Deployment) bool
IsDeploymentRolledOut returns true when the Deployment is rolled out.
func IsPodRunning ¶ added in v0.3.0
IsPodRunning returns true when Pod's phase is Running.
func IsStatefulSetRolledOut ¶
func IsStatefulSetRolledOut(statefulSet *appsv1.StatefulSet) bool
IsStatefulSetRolledOut returns true when the StatefulSet is rolled out.
func IsVersionServingInCustomResourceDefinition ¶
func IsVersionServingInCustomResourceDefinition(crd *apiextensionsv1.CustomResourceDefinition, version string) bool
IsVersionServingInCustomResourceDefinition returns true when the CRD serves the given version.
func MapObjectsToNames ¶ added in v0.5.4
MapObjectsToNames converts a list of k8s objects to their names.
func TopologicalSort ¶ added in v0.2.5
TopologicalSort runs a topological sort on given env vars.
Types ¶
type VolumeDeviceSlice ¶
type VolumeDeviceSlice []corev1.VolumeDevice
VolumeDeviceSlice is a wrapper of []corev1.VolumeDevice that implements the sort.Interface.
func (VolumeDeviceSlice) Less ¶
func (s VolumeDeviceSlice) Less(i, j int) bool
Less implements sort.Interface.
func (VolumeDeviceSlice) Swap ¶
func (s VolumeDeviceSlice) Swap(i, j int)
Swap implements sort.Interface.
type VolumeMountSlice ¶
type VolumeMountSlice []corev1.VolumeMount
VolumeMountSlice is a wrapper of []corev1.VolumeMount that implements the sort.Interface.
func (VolumeMountSlice) Less ¶
func (s VolumeMountSlice) Less(i, j int) bool
Less implements sort.Interface.
func (VolumeMountSlice) Swap ¶
func (s VolumeMountSlice) Swap(i, j int)
Swap implements sort.Interface.
type VolumeSlice ¶
VolumeSlice is a wrapper of []corev1.Volume that implements the sort.Interface.
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