Documentation ¶
Index ¶
- Constants
- func CheckPodFailed(pod *corev1.Pod) error
- func CheckPodImageFailed(pod *corev1.Pod) error
- func ClusterNamespacedName(aeroCluster *asdbv1.AerospikeCluster) string
- func ContainsString(slice []string, s string) bool
- func Exec(podNamespacedName types.NamespacedName, container string, cmd []string, ...) (stdoutStr, stderrStr string, err error)
- func GetDesiredImage(aeroCluster *asdbv1.AerospikeCluster, containerName string) (string, error)
- func GetHash(str string) (string, error)
- func GetNamespacedName(obj meta.Object) types.NamespacedName
- func GetNamespacedNameForSTSOrConfigMap(aeroCluster *asdbv1.AerospikeCluster, rackID int) types.NamespacedName
- func GetRackIDFromPodName(podName string) (*int, error)
- func GetRackIDFromSTSName(statefulSetName string) (*int, error)
- func IsImageEqual(image1, image2 string) bool
- func IsPVCTerminating(pvc *corev1.PersistentVolumeClaim) bool
- func IsPodReasonUnschedulable(pod *corev1.Pod) (isPodUnschedulable bool, reason string)
- func IsPodRunningAndReady(pod *corev1.Pod) bool
- func IsPodTerminating(pod *corev1.Pod) bool
- func LabelsForAerospikeBackupService(clName string) map[string]string
- func LabelsForAerospikeCluster(clName string) map[string]string
- func LabelsForAerospikeClusterRack(clName string, rackID int) map[string]string
- func LabelsForPodAntiAffinity(clName string) map[string]string
- func MergeLabels(operatorLabels, userLabels map[string]string) map[string]string
- func NamespacedName(namespace, name string) string
- func ParseDockerImageTag(tag string) (registry string, name string, version string)
- func RemoveString(slice []string, s string) (result []string)
Constants ¶
const ( DockerHubImagePrefix = "docker.io/" // ReasonImagePullBackOff when pod status is Pending as container image pull failed. ReasonImagePullBackOff = "ImagePullBackOff" // ReasonImageInspectError is error inspecting image. ReasonImageInspectError = "ImageInspectError" // ReasonErrImagePull is general image pull error. ReasonErrImagePull = "ErrImagePull" ReasonRegistryUnavailable = "RegistryUnavailable" )
Variables ¶
This section is empty.
Functions ¶
func CheckPodFailed ¶
CheckPodFailed checks if pod has failed or has terminated or is in an irrecoverable waiting state.
func CheckPodImageFailed ¶
CheckPodImageFailed checks if pod has failed or has terminated or is in an irrecoverable waiting state due to an image related error.
func ClusterNamespacedName ¶
func ClusterNamespacedName(aeroCluster *asdbv1.AerospikeCluster) string
ClusterNamespacedName return namespaced name
func ContainsString ¶
ContainsString returns true if a string exists in a slice of strings.
func Exec ¶
func Exec(podNamespacedName types.NamespacedName, container string, cmd []string, kubeClient *kubernetes.Clientset, kubeConfig *rest.Config) (stdoutStr, stderrStr string, err error)
Exec executes a non interactive command on a pod.
func GetDesiredImage ¶
func GetDesiredImage( aeroCluster *asdbv1.AerospikeCluster, containerName string, ) (string, error)
GetDesiredImage returns the desired image for the input containerName from the aeroCluster spec.
func GetNamespacedName ¶
func GetNamespacedName(obj meta.Object) types.NamespacedName
func GetNamespacedNameForSTSOrConfigMap ¶
func GetNamespacedNameForSTSOrConfigMap( aeroCluster *asdbv1.AerospikeCluster, rackID int, ) types.NamespacedName
func GetRackIDFromPodName ¶
GetRackIDFromPodName returns the rack id given a pod name.
func GetRackIDFromSTSName ¶
func IsImageEqual ¶
IsImageEqual returns true if image name image1 is equal to image name image2.
func IsPVCTerminating ¶
func IsPVCTerminating(pvc *corev1.PersistentVolumeClaim) bool
IsPVCTerminating returns true if pvc's DeletionTimestamp has been set
func IsPodRunningAndReady ¶
IsPodRunningAndReady returns true if pod is in the PodRunning Phase, if it has a condition of PodReady. TODO: check if its is properly running, error crashLoop also passed in this
func IsPodTerminating ¶
IsPodTerminating returns true if pod's DeletionTimestamp has been set
func LabelsForAerospikeBackupService ¶
LabelsForAerospikeBackupService returns the labels for selecting the resources belonging to the given AerospikeBackupService CR name.
func LabelsForAerospikeCluster ¶
LabelsForAerospikeCluster returns the labels for selecting the resources belonging to the given AerospikeCluster CR name.
func LabelsForAerospikeClusterRack ¶
LabelsForAerospikeClusterRack returns the labels for specific rack
func LabelsForPodAntiAffinity ¶
LabelsForPodAntiAffinity returns the labels to use for setting pod anti-affinity.
func MergeLabels ¶
MergeLabels merges operator an user defined labels
func NamespacedName ¶
NamespacedName return namespaced name
func ParseDockerImageTag ¶
ParseDockerImageTag parses input tag into registry, name and version.
func RemoveString ¶
RemoveString removes a string from a slice of strings.
Types ¶
This section is empty.