diff --git a/api/v1/aerospikecluster_types.go b/api/v1/aerospikecluster_types.go index f4f50ad16..e7b01dcd3 100644 --- a/api/v1/aerospikecluster_types.go +++ b/api/v1/aerospikecluster_types.go @@ -72,7 +72,7 @@ type AerospikeClusterSpec struct { //nolint:govet // for readability // +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Seeds Finder Services" SeedsFinderServices SeedsFinderServices `json:"seedsFinderServices,omitempty"` // RosterNodeBlockList is a list of blocked nodeIDs from roster in a strong-consistency setup - // +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Roster NodeB lockList" + // +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Roster Node BlockList" RosterNodeBlockList []string `json:"rosterNodeBlockList,omitempty"` // IgnorePodList is the list of pods which are ignored by the operator while checking the cluster stability and // are not considered part of cluster. This is only useful when there are some failed pods and operator is required diff --git a/config/manifests/bases/aerospike-kubernetes-operator.clusterserviceversion.yaml b/config/manifests/bases/aerospike-kubernetes-operator.clusterserviceversion.yaml index 795d2ec4e..2b8c3c42e 100644 --- a/config/manifests/bases/aerospike-kubernetes-operator.clusterserviceversion.yaml +++ b/config/manifests/bases/aerospike-kubernetes-operator.clusterserviceversion.yaml @@ -51,7 +51,7 @@ spec: while checking the cluster stability and are not considered part of cluster. This is only useful when there are some failed pods and operator is required to do some operation on the cluster. If pods in running state are defined - in this list, they are not ignored + in this list, they are not ignored. displayName: Ignore Pod List path: ignorePodList - description: Aerospike server image @@ -69,7 +69,7 @@ spec: path: rackConfig - description: RosterNodeBlockList is a list of blocked nodeIDs from roster in a strong-consistency setup - displayName: Roster NodeB lockList + displayName: Roster Node BlockList path: rosterNodeBlockList - description: SeedsFinderServices creates additional Kubernetes service that allow clients to discover Aerospike cluster nodes. diff --git a/controllers/aero_info_calls.go b/controllers/aero_info_calls.go index 0c8ca967c..093da495b 100644 --- a/controllers/aero_info_calls.go +++ b/controllers/aero_info_calls.go @@ -30,10 +30,11 @@ import ( // Aerospike helper // ------------------------------------------------------------------------------------ -// waitForMultipleNodesSafeStopReady waits util the input pods is safe to stop, -// skipping pods that are not running and present in ignorablePods for stability check. -// The ignorablePods list should be a list of failed or pending pods that are going to be -// deleted eventually and are safe to ignore in stability checks. +// waitForMultipleNodesSafeStopReady waits until the input pods are safe to stop, +// skipping pods that are not running and present in ignorablePodNames for stability check. +// The ignorablePodNames is the list of failed or pending pods that are either:: +// 1. going to be deleted eventually and are safe to ignore in stability checks +// 2. given in ignorePodList by the user and are safe to ignore in stability checks func (r *SingleClusterReconciler) waitForMultipleNodesSafeStopReady( pods []*corev1.Pod, ignorablePodNames sets.Set[string], ) reconcileResult { diff --git a/test/cluster_test.go b/test/cluster_test.go index 4fb845dfe..186361170 100644 --- a/test/cluster_test.go +++ b/test/cluster_test.go @@ -46,7 +46,7 @@ var _ = Describe( // }, // ) Context( - "DeployClusterWithSyslog", func() { + "DeployClusterWithIgnorePodList", func() { clusterWithIgnorePodList(ctx) }, ) @@ -191,14 +191,14 @@ func clusterWithIgnorePodList(ctx goctx.Context) { By("Upgrade version") aeroCluster, err = getCluster(k8sClient, ctx, clusterNamespacedName) Expect(err).ToNot(HaveOccurred()) - aeroCluster.Spec.Image = baseImage + ":6.4.0.4" + newImage := baseImage + ":6.4.0.4" + aeroCluster.Spec.Image = newImage err = updateCluster(k8sClient, ctx, aeroCluster) Expect(err).ToNot(HaveOccurred()) By("Scale up") aeroCluster, err = getCluster(k8sClient, ctx, clusterNamespacedName) Expect(err).ToNot(HaveOccurred()) - aeroCluster.Spec.IgnorePodList = []string{ignorePodName} aeroCluster.Spec.Size++ err = updateCluster(k8sClient, ctx, aeroCluster) Expect(err).ToNot(HaveOccurred()) @@ -209,6 +209,20 @@ func clusterWithIgnorePodList(ctx goctx.Context) { Expect(err).ToNot(HaveOccurred()) Expect(*pod.Status.ContainerStatuses[0].Started).To(BeFalse()) Expect(pod.Status.ContainerStatuses[0].Ready).To(BeFalse()) + + By("Remove pod from IgnorePodList and verify pod 2-0 is in running state") + aeroCluster, err = getCluster(k8sClient, ctx, clusterNamespacedName) + Expect(err).ToNot(HaveOccurred()) + aeroCluster.Spec.IgnorePodList = []string{} + err = updateCluster(k8sClient, ctx, aeroCluster) + Expect(err).ToNot(HaveOccurred()) + + err = k8sClient.Get(ctx, types.NamespacedName{Name: ignorePodName, + Namespace: clusterNamespacedName.Namespace}, pod) + Expect(err).ToNot(HaveOccurred()) + Expect(*pod.Status.ContainerStatuses[0].Started).To(BeTrue()) + Expect(pod.Status.ContainerStatuses[0].Ready).To(BeTrue()) + Expect(pod.Spec.Containers[0].Image).To(Equal(newImage)) }, ) },