k8sutil

package
v0.4.3-release Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddNewNodeToCr

func AddNewNodeToCr(node v1alpha1.Node, crName, namespace string, client runtimeClient.Client) error

AddNewNodeToCr modifies the CR and adds a new node

func AddPvToSpecificNode

func AddPvToSpecificNode(nodeId, crName, namespace string, storageConfig *v1alpha1.StorageConfig, client runtimeClient.Client) error

AddPvToSpecificNode adds a new PV to a specific node

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 Cr

func Cr(name, namespace string, client runtimeClient.Client) (*v1alpha1.NifiCluster, error)

Cr returns the given cr object

func DeleteStatus

func DeleteStatus(c client.Client, nodeId string, cluster *v1alpha1.NifiCluster, logger logr.Logger) error

DeleteStatus deletes the given node state from the CR

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 IsPodContainsPendingContainer

func IsPodContainsPendingContainer(pod *corev1.Pod) bool

func IsPodContainsTerminatedContainer

func IsPodContainsTerminatedContainer(pod *corev1.Pod) bool

func LookupNifiCluster

func LookupNifiCluster(client runtimeClient.Client, clusterName, clusterNamespace string) (cluster *v1alpha1.NifiCluster, err error)

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

func LookupNifiParameterContext

func LookupNifiParameterContext(client runtimeClient.Client, parameterContextName, parameterContextNamespace string) (parameterContext *v1alpha1.NifiParameterContext, err error)

LookupNifiParameterContext returns the parameter context instance based on its name and namespace

func LookupNifiRegistryClient

func LookupNifiRegistryClient(client runtimeClient.Client, registryClientName, registryClientNamespace string) (registryClient *v1alpha1.NifiRegistryClient, err error)

LookupNifiRegistryClient returns the running registry client instance based on its name and namespace

func LookupNifiUser

func LookupNifiUser(client runtimeClient.Client, userName, userNamespace string) (user *v1alpha1.NifiUser, err error)

LookupNifiUser returns the user instance based on its name and namespace

func LookupSecret

func LookupSecret(client runtimeClient.Client, secretName, secretNamespace string) (secret *corev1.Secret, err error)

LookupSecret returns the secret instance based on its name and namespace

func PodReady

func PodReady(pod *corev1.Pod) bool

func Reconcile

func Reconcile(log logr.Logger, client runtimeClient.Client, desired runtimeClient.Object, cr *v1alpha1.NifiCluster) error

Reconcile reconciles K8S resources

func RemoveNodeFromCr

func RemoveNodeFromCr(nodeId, crName, namespace string, client runtimeClient.Client) error

RemoveNodeFromCr modifies the CR and removes the given node from the cluster

func UpdateCRStatus

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

UpdateCRStatus updates the cluster state

func UpdateCrWithRollingUpgrade

func UpdateCrWithRollingUpgrade(errorCount int, cr *v1alpha1.NifiCluster, client runtimeClient.Client) error

UpdateCrWithRollingUpgrade modifies CR status

func UpdateNodeStatus

func UpdateNodeStatus(c client.Client, nodeIds []string, cluster *v1alpha1.NifiCluster, state interface{}, logger logr.Logger) error

UpdateNodeStatus updates the node status with rack and configuration infos

func UpdateRollingUpgradeState

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

UpdateRollingUpgradeState updates the state of the cluster with rolling upgrade info

func UpdateRootProcessGroupIdStatus

func UpdateRootProcessGroupIdStatus(c client.Client, cluster *v1alpha1.NifiCluster, id string, logger logr.Logger) error

UpdateRootProcessGroupIdStatus updates the cluster root process group id

Types

This section is empty.

Jump to

Keyboard shortcuts

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