Documentation ¶
Index ¶
- func ClusterLabels(c *cassandrav1alpha1.Cluster) map[string]string
- func DatacenterLabels(c *cassandrav1alpha1.Cluster) map[string]string
- func GerMemberServicesForRack(r cassandrav1alpha1.RackSpec, c *cassandrav1alpha1.Cluster, ...) ([]*corev1.Service, error)
- func GetDataDir(c *cassandrav1alpha1.Cluster) string
- func GetPodsForCluster(cluster *cassandrav1alpha1.Cluster, podLister corelisters.PodLister) ([]*corev1.Pod, error)
- func GetPodsForRack(r cassandrav1alpha1.RackSpec, c *cassandrav1alpha1.Cluster, ...) ([]*corev1.Pod, error)
- func HeadlessServiceNameForCluster(c *cassandrav1alpha1.Cluster) string
- func ImageForCluster(c *cassandrav1alpha1.Cluster) string
- func IndexFromName(n string) (int32, error)
- func IsPodUnschedulable(pod *corev1.Pod) bool
- func IsRackConditionTrue(rackStatus *cassandrav1alpha1.RackStatus, ...) bool
- func Max(x, y int64) int64
- func Min(x, y int64) int64
- func NewControllerRef(c *cassandrav1alpha1.Cluster) metav1.OwnerReference
- func PatchClusterStatus(c *cassandrav1alpha1.Cluster, rookClient versioned.Interface) error
- func PatchService(old, new *corev1.Service, kubeClient kubernetes.Interface) error
- func PatchStatefulSet(old, new *appsv1.StatefulSet, kubeClient kubernetes.Interface) error
- func RackLabels(r cassandrav1alpha1.RackSpec, c *cassandrav1alpha1.Cluster) map[string]string
- func RackSelector(r cassandrav1alpha1.RackSpec, c *cassandrav1alpha1.Cluster) labels.Selector
- func RefFromInt(i int32) *int32
- func RefFromInt32(i int32) *int32
- func RefFromInt64(i int64) *int64
- func RefFromString(s string) *string
- func ScaleStatefulSet(sts *appsv1.StatefulSet, amount int32, kubeClient kubernetes.Interface) error
- func ServiceAccountNameForMembers(c *cassandrav1alpha1.Cluster) string
- func StatefulSetForRack(r cassandrav1alpha1.RackSpec, c *cassandrav1alpha1.Cluster, rookImage string) *appsv1.StatefulSet
- func StatefulSetNameForRack(r cassandrav1alpha1.RackSpec, c *cassandrav1alpha1.Cluster) string
- func StatefulSetPodLabel(name string) map[string]string
- func StatefulSetStatusesStale(c *cassandrav1alpha1.Cluster, statefulSetLister appslisters.StatefulSetLister) (bool, error)
- func VerifyOwner(obj, owner metav1.Object) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClusterLabels ¶
func ClusterLabels(c *cassandrav1alpha1.Cluster) map[string]string
ClusterLabels returns a map of label keys and values for the given Cluster.
func DatacenterLabels ¶
func DatacenterLabels(c *cassandrav1alpha1.Cluster) map[string]string
DatacenterLabels returns a map of label keys and values for the given Datacenter.
func GerMemberServicesForRack ¶
func GerMemberServicesForRack( r cassandrav1alpha1.RackSpec, c *cassandrav1alpha1.Cluster, serviceLister corelisters.ServiceLister, ) ([]*corev1.Service, error)
GetMemberServicesForRack returns the member services for the given rack.
func GetDataDir ¶
func GetDataDir(c *cassandrav1alpha1.Cluster) string
GetDataDir returns the directory used to store the database data
func GetPodsForCluster ¶
func GetPodsForCluster(cluster *cassandrav1alpha1.Cluster, podLister corelisters.PodLister) ([]*corev1.Pod, error)
GetPodsForCluster returns the existing Pods for the given cluster
func GetPodsForRack ¶
func GetPodsForRack( r cassandrav1alpha1.RackSpec, c *cassandrav1alpha1.Cluster, podLister corelisters.PodLister, ) ([]*corev1.Pod, error)
GetPodsForRack returns the created Pods for the given rack.
func HeadlessServiceNameForCluster ¶
func HeadlessServiceNameForCluster(c *cassandrav1alpha1.Cluster) string
func ImageForCluster ¶
func ImageForCluster(c *cassandrav1alpha1.Cluster) string
func IndexFromName ¶
IndexFromName attempts to get the index from a name using the naming convention <name>-<index>.
func IsPodUnschedulable ¶
isPodUnschedulable iterates a Pod's Status.Conditions to find out if it has been deemed unschedulable
func IsRackConditionTrue ¶
func IsRackConditionTrue(rackStatus *cassandrav1alpha1.RackStatus, condType cassandrav1alpha1.RackConditionType) bool
IsRackConditionTrue checks a rack's status for the presence of a condition type and checks if it is true.
func NewControllerRef ¶
func NewControllerRef(c *cassandrav1alpha1.Cluster) metav1.OwnerReference
NewControllerRef returns an OwnerReference to the provided Cluster Object
func PatchClusterStatus ¶
func PatchClusterStatus(c *cassandrav1alpha1.Cluster, rookClient versioned.Interface) error
PatchCluster patches the old Cluster so that it matches the new Cluster.
func PatchService ¶
func PatchService(old, new *corev1.Service, kubeClient kubernetes.Interface) error
PatchService patches the old Service so that it matches the new Service.
func PatchStatefulSet ¶
func PatchStatefulSet(old, new *appsv1.StatefulSet, kubeClient kubernetes.Interface) error
PatchStatefulSet patches the old StatefulSet so that it matches the new StatefulSet.
func RackLabels ¶
func RackLabels(r cassandrav1alpha1.RackSpec, c *cassandrav1alpha1.Cluster) map[string]string
RackLabels returns a map of label keys and values for the given Rack.
func RackSelector ¶
func RackSelector(r cassandrav1alpha1.RackSpec, c *cassandrav1alpha1.Cluster) labels.Selector
RackSelector returns a LabelSelector for the given rack.
func RefFromInt ¶
RefFromInt is a helper function that takes a int and outputs a reference to that int. Useful for initializing an int pointer from a literal.
func RefFromInt32 ¶
RefFromInt32 is a helper function that takes a int32 and outputs a reference to that int.
func RefFromInt64 ¶
RefFromInt64 is a helper function that takes a int64 and outputs a reference to that int.
func RefFromString ¶
RefFromString is a helper function that takes a string and outputs a reference to that string. Useful for initializing a string pointer from a literal.
func ScaleStatefulSet ¶
func ScaleStatefulSet(sts *appsv1.StatefulSet, amount int32, kubeClient kubernetes.Interface) error
ScaleStatefulSet attempts to scale a StatefulSet by the given amount
func ServiceAccountNameForMembers ¶
func ServiceAccountNameForMembers(c *cassandrav1alpha1.Cluster) string
func StatefulSetForRack ¶
func StatefulSetForRack(r cassandrav1alpha1.RackSpec, c *cassandrav1alpha1.Cluster, rookImage string) *appsv1.StatefulSet
func StatefulSetNameForRack ¶
func StatefulSetNameForRack(r cassandrav1alpha1.RackSpec, c *cassandrav1alpha1.Cluster) string
func StatefulSetPodLabel ¶
StatefulSetPodLabel returns a map of labels to uniquely identify a StatefulSet Pod with the given name
func StatefulSetStatusesStale ¶
func StatefulSetStatusesStale(c *cassandrav1alpha1.Cluster, statefulSetLister appslisters.StatefulSetLister) (bool, error)
StatefulSetStatusesStale checks if the StatefulSet Objects of a Cluster have been observed by the StatefulSet controller. If they haven't, their status might be stale, so it's better to wait and process them later.
func VerifyOwner ¶
VerifyOwner checks if the owner Object is the controller of the obj Object and returns an error if it isn't.
Types ¶
This section is empty.