k8sutil

package
v0.0.0-...-28ca6ac Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2019 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddNewBrokerToCr

func AddNewBrokerToCr(broker v1beta1.Broker, crName, namespace string, client runtimeClient.Client) error

AddNewBrokerToCr modifies the CR and adds a new broker

func AddPvToSpecificBroker

func AddPvToSpecificBroker(brokerId, crName, namespace string, storageConfig *v1beta1.StorageConfig, client runtimeClient.Client) error

AddPvToSpecificBroker adds a new PV to a specific broker

func CheckIfObjectUpdated

func CheckIfObjectUpdated(log logr.Logger, desiredType reflect.Type, current, desired runtime.Object) bool

CheckIfObjectUpdated checks if the given object is updated using K8sObjectMatcher

func DeleteStatus

func DeleteStatus(c client.Client, brokerId string, cluster *v1beta1.KafkaCluster, logger logr.Logger) error

DeleteStatus deletes the given broker state from the CR

func GetCr

func GetCr(name, namespace string, client runtimeClient.Client) (*v1beta1.KafkaCluster, error)

GetCr returns the given cr object

func IsAlreadyOwnedError

func IsAlreadyOwnedError(err error) bool

IsAlreadyOwnedError checks if a controller already own the instance

func IsMarkedForDeletion

func IsMarkedForDeletion(m metav1.ObjectMeta) bool

IsMarkedForDeletion determines if the object is marked for deletion

func LookupKafkaCluster

func LookupKafkaCluster(client runtimeClient.Client, clusterName, clusterNamespace string) (cluster *v1beta1.KafkaCluster, err error)

LookupKafkaCluster returns the running cluster instance based on its name and namespace

func Reconcile

func Reconcile(log logr.Logger, client runtimeClient.Client, desired runtime.Object, cr *v1beta1.KafkaCluster) error

Reconcile reconciles K8S resources

func RemoveBrokerFromCr

func RemoveBrokerFromCr(brokerId, crName, namespace string, client runtimeClient.Client) error

RemoveBrokerFromCr modifies the CR and removes the given broker from the cluster

func UpdateBrokerStatus

func UpdateBrokerStatus(c client.Client, brokerId string, cluster *v1beta1.KafkaCluster, state interface{}, logger logr.Logger) error

UpdateBrokerStatus updates the broker status with rack and configuration infos

func UpdateCRStatus

func UpdateCRStatus(c client.Client, cluster *v1beta1.KafkaCluster, state interface{}, logger logr.Logger) error

UpdateCRStatus updates the cluster state

func UpdateCrWithNodeAffinity

func UpdateCrWithNodeAffinity(current *corev1.Pod, cr *v1beta1.KafkaCluster, client runtimeClient.Client) error

UpdateCrWithNodeAffinity updates the given Cr with NodeAffinity status

func UpdateCrWithRackAwarenessConfig

func UpdateCrWithRackAwarenessConfig(pod *corev1.Pod, cr *v1beta1.KafkaCluster, client runtimeClient.Client) error

UpdateCrWithRackAwarenessConfig updates the CR with rack awareness config

func UpdateCrWithRollingUpgrade

func UpdateCrWithRollingUpgrade(errorCount int, cr *v1beta1.KafkaCluster, client runtimeClient.Client) error

UpdateCrWithRollingUpgrade modifies CR status

func UpdateRollingUpgradeState

func UpdateRollingUpgradeState(c client.Client, cluster *v1beta1.KafkaCluster, time time.Time, logger logr.Logger) error

UpdateRollingUpgradeState updates the state of the cluster with rolling upgrade info

Types

This section is empty.

Jump to

Keyboard shortcuts

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