clusterutils

package
v1.28.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package clusterutils provides functions to handle cluster actions

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllPodsHaveAnnotations

func AllPodsHaveAnnotations(
	ctx context.Context,
	crudClient client.Client,
	namespace, clusterName string,
	annotations map[string]string,
) (bool, error)

AllPodsHaveAnnotations verifies if the annotations defined in a map are included in all the pods of a cluster

func AllPodsHaveLabels

func AllPodsHaveLabels(
	ctx context.Context,
	crudClient client.Client,
	namespace, clusterName string,
	labels map[string]string,
) (bool, error)

AllPodsHaveLabels verifies if the labels defined in a map are included in all the pods of a cluster

func Get

func Get(
	ctx context.Context,
	crudClient client.Client,
	namespace, name string,
) (*apiv1.Cluster, error)

Get gets a cluster given name and namespace

func GetPrimary

func GetPrimary(
	ctx context.Context,
	crudClient client.Client,
	namespace, clusterName string,
) (*corev1.Pod, error)

GetPrimary gets the primary pod of a cluster

func GetReplicas

func GetReplicas(
	ctx context.Context,
	crudClient client.Client,
	namespace, clusterName string,
) (*corev1.PodList, error)

GetReplicas gets a slice containing all the replica pods of a cluster

func HasAnnotations

func HasAnnotations(
	cluster *apiv1.Cluster,
	annotations map[string]string,
) bool

HasAnnotations verifies that the annotations of a cluster contain a specified annotations map

func HasLabels

func HasLabels(
	cluster *apiv1.Cluster,
	labels map[string]string,
) bool

HasLabels verifies that the labels of a cluster contain a specified labels map

func ListPods

func ListPods(
	ctx context.Context,
	crudClient client.Client,
	namespace, clusterName string,
) (*corev1.PodList, error)

ListPods gathers the current list of instance pods for a cluster in a namespace

func ScaleSize

func ScaleSize(
	ctx context.Context,
	crudClient client.Client,
	namespace, clusterName string,
	newClusterSize int,
) error

ScaleSize scales a cluster to the requested size

Types

This section is empty.

Jump to

Keyboard shortcuts

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