util

package
v1.4.0-alpha.0 Latest Latest
Warning

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

Go to latest
Published: May 28, 2021 License: Apache-2.0 Imports: 17 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 GetStatefulSetForRack added in v1.1.0

func GetStatefulSetForRack(ctx context.Context, rack scyllav1.RackSpec, cluster *scyllav1.ScyllaCluster, kubeClient kubernetes.Interface) (*appsv1.StatefulSet, error)

GetStatefulSetForRack returns rack underlying StatefulSet.

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 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

type StrategicMergePatchFunc added in v1.1.0

type StrategicMergePatchFunc func(obj runtime.Object) ([]byte, error)

The StrategicMergePatchFunc type is an adapter to allow the use of ordinary functions as Strategic Merge Patch.

func (StrategicMergePatchFunc) Data added in v1.1.0

func (f StrategicMergePatchFunc) Data(obj runtime.Object) ([]byte, error)

Data returns the raw data representing the patch.

func (StrategicMergePatchFunc) Type added in v1.1.0

Type returns PatchType of Strategic Merge Patch

Jump to

Keyboard shortcuts

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