Documentation ¶
Index ¶
- Variables
- func CompareObjectMeta(t *testing.T, got, want metav1.ObjectMeta)
- func GetTestClientWithObjects(predefinedObjects []runtime.Object) client.Client
- func HandleDeployUpdate(ctx context.Context, rclient client.Client, newDeploy *appsv1.Deployment) error
- func HandleSTSUpdate(ctx context.Context, rclient client.Client, cr STSOptions, ...) error
- func IsHPAV2BetaSupported() bool
- func IsPDBV1APISupported() bool
- func IsPSPSupported() bool
- func MergeAnnotations(prev, current map[string]string) map[string]string
- func MergePatchContainers(base, patches []v1.Container) ([]v1.Container, error)
- func MustConvertObjectVersionsJSON[A, B any](src *A, objectName string) *B
- func NewHPAEmptyObject(opts ...func(obj client.Object)) client.Object
- func PodIsFailedWithReason(pod corev1.Pod) (bool, string)
- func PodIsReady(pod corev1.Pod) bool
- func RenderPlaceholders[T any](resource *T, placeholders map[string]string) (*T, error)
- func SanitizeVolumeName(name string) string
- func SetKubernetesVersionWithDefaults(vi *version.Info, defaultMinor, defaultMajor uint64) error
- func UpdatePodAnnotations(ctx context.Context, rclient client.Client, selector map[string]string, ...) error
- type STSOptions
Constants ¶
This section is empty.
Variables ¶
var ( ServerMajorVersion uint64 ServerMinorVersion uint64 )
Functions ¶
func CompareObjectMeta ¶
func CompareObjectMeta(t *testing.T, got, want metav1.ObjectMeta)
func HandleDeployUpdate ¶ added in v0.22.1
func HandleSTSUpdate ¶ added in v0.20.0
func HandleSTSUpdate(ctx context.Context, rclient client.Client, cr STSOptions, newSts *appsv1.StatefulSet, c *config.BaseOperatorConf) error
HandleSTSUpdate performs create and update operations for given statefulSet with STSOptions
func IsHPAV2BetaSupported ¶ added in v0.30.3
func IsHPAV2BetaSupported() bool
IsHPAV2BetaSupported checks if new Beta deprecated since 1.26 https://kubernetes.io/blog/2021/12/07/kubernetes-1-23-release-announcement/#horizontalpodautoscaler-v2-graduates-to-ga
func IsPDBV1APISupported ¶ added in v0.23.0
func IsPDBV1APISupported() bool
IsPDBV1APISupported check if new v1 API is supported by kubernetes API server deprecated since 1.21 https://kubernetes.io/docs/reference/using-api/deprecation-guide/#poddisruptionbudget-v125
func IsPSPSupported ¶ added in v0.23.0
func IsPSPSupported() bool
IsPSPSupported check if PodSecurityPolicy is supported by kubernetes API server https://kubernetes.io/docs/reference/using-api/deprecation-guide/#psp-v125
func MergeAnnotations ¶ added in v0.22.0
MergeAnnotations adds annotations with kubernetes.io/ to the current map from prev It's needed for kubectl restart, correct updates such annotations managed by kubernetes controller and shouldn't be changed by operator
func MergePatchContainers ¶
MergePatchContainers adds patches to base using a strategic merge patch and iterating by container name, failing on the first error
func MustConvertObjectVersionsJSON ¶ added in v0.30.3
MustConvertObjectVersionsJSON objects with json serialize and deserialize it could be used only for converting BETA apis to Stable version
func NewHPAEmptyObject ¶ added in v0.30.3
NewHPAEmptyObject returns HorizontalPodAutoscaler object for given kubernetes version
func PodIsFailedWithReason ¶ added in v0.26.0
PodIsFailedWithReason reports if pod failed and the reason of fail
func PodIsReady ¶ added in v0.20.0
PodIsReady check is pod is ready
func RenderPlaceholders ¶ added in v0.31.0
RenderPlaceholders replaces placeholders at resource with given values placeholder must be in %NAME% format resource must be reference to json serializable struct
func SanitizeVolumeName ¶
func SetKubernetesVersionWithDefaults ¶ added in v0.23.2
SetKubernetesVersionWithDefaults parses kubernetes version response with given default versions
Types ¶
type STSOptions ¶ added in v0.20.0
type STSOptions struct { HasClaim bool SelectorLabels func() map[string]string VolumeName func() string UpdateStrategy func() appsv1.StatefulSetUpdateStrategyType HPA *victoriametricsv1beta1.EmbeddedHPA UpdateReplicaCount func(count *int32) }
STSOptions options for StatefulSet update HPA and UpdateReplicaCount optional