Documentation
¶
Index ¶
- Variables
- func AddOwnerRefToObject(obj metav1.Object, ownerRef metav1.OwnerReference)
- func AsOwner(m *v1alpha1.PerconaServerMongoDB) metav1.OwnerReference
- func DeletePersistentVolumeClaim(client sdk.Client, m *v1alpha1.PerconaServerMongoDB, pvcName string) error
- func EnvVarSourceFromSecret(name, key string) *corev1.EnvVarSource
- func GetContainerResourceRequirements(reqs corev1.ResourceRequirements) corev1.ResourceRequirements
- func GetContainerRunUID(m *v1alpha1.PerconaServerMongoDB, serverVersion *v1alpha1.ServerVersion) *int64
- func GetLabelSelectorListOpts(m *v1alpha1.PerconaServerMongoDB, replset *v1alpha1.ReplsetSpec) *metav1.ListOptions
- func GetPersistentVolumeClaims(client sdk.Client, m *v1alpha1.PerconaServerMongoDB, ...) ([]corev1.PersistentVolumeClaim, error)
- func GetPlatform(m *v1alpha1.PerconaServerMongoDB, serverVersion *v1alpha1.ServerVersion) v1alpha1.Platform
- func GetPodContainer(pod *corev1.Pod, containerName string) *corev1.Container
- func GetPodContainerStatus(status *corev1.PodStatus, containerName string) *corev1.ContainerStatus
- func GetPodNames(pods []corev1.Pod) []string
- func GetPodSpecContainer(spec *corev1.PodSpec, containerName string) *corev1.Container
- func GetSecret(m *v1alpha1.PerconaServerMongoDB, client sdk.Client, secretName string) (*corev1.Secret, error)
- func GetServerVersion() (*v1alpha1.ServerVersion, error)
- func IsContainerAndPodRunning(pod corev1.Pod, containerName string) bool
- func IsContainerTerminated(podStatus *corev1.PodStatus, containerName string) (bool, error)
- func IsPodReady(pod corev1.Pod) bool
- func IsStatefulSetUpdating(set *appsv1.StatefulSet) bool
- func LabelsForPerconaServerMongoDB(m *v1alpha1.PerconaServerMongoDB, labels map[string]string) map[string]string
- func LabelsForPerconaServerMongoDBReplset(m *v1alpha1.PerconaServerMongoDB, replset *v1alpha1.ReplsetSpec) map[string]string
- func NewPersistentVolumeClaim(m *v1alpha1.PerconaServerMongoDB, resources corev1.ResourceRequirements, ...) corev1.PersistentVolumeClaim
- func NewSecret(m *v1alpha1.PerconaServerMongoDB, name string, data map[string]string) *corev1.Secret
- func NewStatefulSet(m *v1alpha1.PerconaServerMongoDB, name string) *appsv1.StatefulSet
- func ParseResourceSpecRequirements(specLimits, specRequests *v1alpha1.ResourceSpecRequirements) (corev1.ResourceRequirements, error)
- func PodList() *corev1.PodList
- func ReplsetStatusHasPod(status *v1alpha1.ReplsetStatus, podName string) bool
Constants ¶
This section is empty.
Variables ¶
var FalseVar = false
var TrueVar = true
Functions ¶
func AddOwnerRefToObject ¶
func AddOwnerRefToObject(obj metav1.Object, ownerRef metav1.OwnerReference)
AddOwnerRefToObject appends the desired OwnerReference to the object
func AsOwner ¶
func AsOwner(m *v1alpha1.PerconaServerMongoDB) metav1.OwnerReference
AsOwner returns an OwnerReference set as the PerconaServerMongoDB CR
func DeletePersistentVolumeClaim ¶
func DeletePersistentVolumeClaim(client sdk.Client, m *v1alpha1.PerconaServerMongoDB, pvcName string) error
DeletePersistentVolumeClaim deletes a Persistent Volume Claim
func EnvVarSourceFromSecret ¶
func EnvVarSourceFromSecret(name, key string) *corev1.EnvVarSource
EnvVarSourceFromSecret returns an corev1.EnvVarSource based on a secret key
func GetContainerResourceRequirements ¶
func GetContainerResourceRequirements(reqs corev1.ResourceRequirements) corev1.ResourceRequirements
GetContainerResourceRequirements returns a corev1.ResourceRequirements with the 'storage' type (not needed in corev1.Container) removed
func GetContainerRunUID ¶
func GetContainerRunUID(m *v1alpha1.PerconaServerMongoDB, serverVersion *v1alpha1.ServerVersion) *int64
GetContainerRunUID returns an int64-pointer reflecting the user ID a container should run as
func GetLabelSelectorListOpts ¶
func GetLabelSelectorListOpts(m *v1alpha1.PerconaServerMongoDB, replset *v1alpha1.ReplsetSpec) *metav1.ListOptions
GetLabelSelectorListOpts returns metav1.ListOptions with a label-selector for a given replset
func GetPersistentVolumeClaims ¶
func GetPersistentVolumeClaims(client sdk.Client, m *v1alpha1.PerconaServerMongoDB, replset *v1alpha1.ReplsetSpec) ([]corev1.PersistentVolumeClaim, error)
GetPersistentVolumeClaims returns a list of Persistent Volume Claims for a given replset
func GetPlatform ¶
func GetPlatform(m *v1alpha1.PerconaServerMongoDB, serverVersion *v1alpha1.ServerVersion) v1alpha1.Platform
GetPlatform returns the Kubernetes platform type, first using the Spec 'platform' field or the serverVersion.Platform field if the Spec 'platform' field is not set
func GetPodContainer ¶
GetPodContainer returns a container, if it exists
func GetPodContainerStatus ¶
func GetPodContainerStatus(status *corev1.PodStatus, containerName string) *corev1.ContainerStatus
GetPodContainerStatus returns a container status from a pod status, if it exists
func GetPodNames ¶
GetPodNames returns the pod names of the array of pods passed in
func GetPodSpecContainer ¶
GetPodSpecContainer returns a container from a pod spec, if it exists
func GetSecret ¶
func GetSecret(m *v1alpha1.PerconaServerMongoDB, client sdk.Client, secretName string) (*corev1.Secret, error)
GetSecret retrieves a Kubernetes Secret
func GetServerVersion ¶
func GetServerVersion() (*v1alpha1.ServerVersion, error)
GetServerVersion returns server version and platform (k8s|oc) stolen from: https://github.com/openshift/origin/blob/release-3.11/pkg/oc/cli/version/version.go#L106
func IsContainerAndPodRunning ¶
IsContainerAndPodRunning returns a boolean reflecting if a container and pod are in a running state
func IsContainerTerminated ¶
IsContainerTerminated returns a boolean reflecting if a container has terminated
func IsPodReady ¶
IsPodReady returns a boolean reflecting if a pod is in a "ready" state
func IsStatefulSetUpdating ¶
func IsStatefulSetUpdating(set *appsv1.StatefulSet) bool
IsStatefulSetUpdating returns a boolean reflecting if a StatefulSet is updating or scaling. If the currentRevision is different than the updateRevision or if the number of readyReplicas is different than currentReplicas, the set is updating
func LabelsForPerconaServerMongoDB ¶
func LabelsForPerconaServerMongoDB(m *v1alpha1.PerconaServerMongoDB, labels map[string]string) map[string]string
LabelsForPerconaServerMongoDB returns the labels for selecting the resources belonging to the given PerconaServerMongoDB CR name.
func LabelsForPerconaServerMongoDBReplset ¶
func LabelsForPerconaServerMongoDBReplset(m *v1alpha1.PerconaServerMongoDB, replset *v1alpha1.ReplsetSpec) map[string]string
LabelsForPerconaServerMongoDBReplset returns the labels for selecting the resources belonging to the given PerconaServerMongoDB Replset.
func NewPersistentVolumeClaim ¶
func NewPersistentVolumeClaim(m *v1alpha1.PerconaServerMongoDB, resources corev1.ResourceRequirements, claimName, storageClass string) corev1.PersistentVolumeClaim
NewPersistentVolumeClaim returns a Persistent Volume Claims for Mongod pod
func NewSecret ¶
func NewSecret(m *v1alpha1.PerconaServerMongoDB, name string, data map[string]string) *corev1.Secret
NewSecret returns a Core API Secret structure
func NewStatefulSet ¶
func NewStatefulSet(m *v1alpha1.PerconaServerMongoDB, name string) *appsv1.StatefulSet
NewStatefulSet returns a StatefulSet object configured for a name
func ParseResourceSpecRequirements ¶
func ParseResourceSpecRequirements(specLimits, specRequests *v1alpha1.ResourceSpecRequirements) (corev1.ResourceRequirements, error)
ParseResourceSpecRequirements parses the resource section of the spec to a corev1.ResourceRequirements object
func ReplsetStatusHasPod ¶
func ReplsetStatusHasPod(status *v1alpha1.ReplsetStatus, podName string) bool
ReplsetStatusHasPod returns a boolean reflecting if a ReplsetSTatus contains a pod name
Types ¶
This section is empty.