util

package
v1.0.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AreStatefulSetStatusesStale

func AreStatefulSetStatusesStale(ctx context.Context, c *scyllav1.ScyllaCluster, client client.Client) (bool, error)

StatefulSetStatusesStale checks if the StatefulSet Objects of a Cluster have been observed by the StatefulSet controller. If they haven't, their status might be stale, so it's better to wait and process them later.

func LoggerForCluster

func LoggerForCluster(c *scyllav1.ScyllaCluster) log.Logger

LoggerForCluster returns a logger that will log with context about the current cluster

func MarkAsReplaceCandidate added in v1.0.0

func MarkAsReplaceCandidate(ctx context.Context, member *corev1.Service, kubeClient kubernetes.Interface) error

MarkAsReplaceCandidate patches member service with special label indicating that service must be replaced.

func NewControllerRef

func NewControllerRef(c *scyllav1.ScyllaCluster) metav1.OwnerReference

NewControllerRef returns an OwnerReference to the provided Cluster Object

func PatchService

func PatchService(ctx context.Context, old, new *corev1.Service, kubeClient kubernetes.Interface) error

PatchService patches the old Service so that it matches the new Service.

func PatchStatefulSet

func PatchStatefulSet(ctx context.Context, old, new *appsv1.StatefulSet, kubeClient kubernetes.Interface) error

PatchStatefulSet patches the old StatefulSet so that it matches the new StatefulSet.

func RefFromInt32

func RefFromInt32(i int32) *int32

RefFromInt32 is a helper function that takes a int32 and outputs a reference to that int.

func RefFromString

func RefFromString(s string) *string

RefFromString is a helper function that takes a string and outputs a reference to that string. Useful for initializing a string pointer from a literal.

func ScaleStatefulSet

func ScaleStatefulSet(ctx context.Context, sts *appsv1.StatefulSet, amount int32, kubeClient kubernetes.Interface) error

ScaleStatefulSet attempts to scale a StatefulSet by the given amount

func UpgradeStatefulSetScyllaImage

func UpgradeStatefulSetScyllaImage(ctx context.Context, sts *appsv1.StatefulSet, image string, kubeClient kubernetes.Interface) error

UpgradeStatefulSetScyllaImage attempts to set the image of a StatefulSet

func VerifyOwner

func VerifyOwner(obj, owner metav1.Object) error

VerifyOwner checks if the owner Object is the controller of the obj Object and returns an error if it isn't.

Types

This section is empty.

Jump to

Keyboard shortcuts

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