From ab029be7d7923b1e7e068e1760adbf0750562b7f Mon Sep 17 00:00:00 2001 From: Abhisek Dwivedi Date: Thu, 30 Nov 2023 09:58:14 +0530 Subject: [PATCH] Fixed go-lint --- api/v1/aerospikecluster_types.go | 5 ----- api/v1/zz_generated.deepcopy.go | 5 ----- .../bases/asdb.aerospike.com_aerospikeclusters.yaml | 10 ---------- ...efinition_aerospikeclusters.asdb.aerospike.com.yaml | 10 ---------- test/cluster_test.go | 9 ++++++--- 5 files changed, 6 insertions(+), 33 deletions(-) diff --git a/api/v1/aerospikecluster_types.go b/api/v1/aerospikecluster_types.go index 17e19f2bd..60ef8f55b 100644 --- a/api/v1/aerospikecluster_types.go +++ b/api/v1/aerospikecluster_types.go @@ -624,11 +624,6 @@ type AerospikeClusterStatusSpec struct { //nolint:govet // for readability SeedsFinderServices SeedsFinderServices `json:"seedsFinderServices,omitempty"` // RosterNodeBlockList is a list of blocked nodeIDs from roster in a strong-consistency setup RosterNodeBlockList []string `json:"rosterNodeBlockList,omitempty"` - // IgnorePodList is a list of pods that the operator will ignore while assessing cluster stability. - // Pods specified in this list are not considered part of the cluster. This is particularly useful when - // there are failed pods and the operator needs to perform certain operations on the cluster. Note that - // running pods included in this list will not be ignored. - IgnorePodList []string `json:"ignorePodList,omitempty"` } // AerospikeClusterStatus defines the observed state of AerospikeCluster diff --git a/api/v1/zz_generated.deepcopy.go b/api/v1/zz_generated.deepcopy.go index 892f93d8b..76d5c6591 100644 --- a/api/v1/zz_generated.deepcopy.go +++ b/api/v1/zz_generated.deepcopy.go @@ -255,11 +255,6 @@ func (in *AerospikeClusterStatusSpec) DeepCopyInto(out *AerospikeClusterStatusSp *out = make([]string, len(*in)) copy(*out, *in) } - if in.IgnorePodList != nil { - in, out := &in.IgnorePodList, &out.IgnorePodList - *out = make([]string, len(*in)) - copy(*out, *in) - } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AerospikeClusterStatusSpec. diff --git a/config/crd/bases/asdb.aerospike.com_aerospikeclusters.yaml b/config/crd/bases/asdb.aerospike.com_aerospikeclusters.yaml index dda91cbf1..ca804bf58 100644 --- a/config/crd/bases/asdb.aerospike.com_aerospikeclusters.yaml +++ b/config/crd/bases/asdb.aerospike.com_aerospikeclusters.yaml @@ -8900,16 +8900,6 @@ spec: - customInterface type: string type: object - ignorePodList: - description: IgnorePodList is a list of pods that the operator will - ignore while assessing cluster stability. Pods specified in this - list are not considered part of the cluster. This is particularly - useful when there are failed pods and the operator needs to perform - certain operations on the cluster. Note that running pods included - in this list will not be ignored. - items: - type: string - type: array image: description: Aerospike server image type: string diff --git a/helm-charts/aerospike-kubernetes-operator/crds/customresourcedefinition_aerospikeclusters.asdb.aerospike.com.yaml b/helm-charts/aerospike-kubernetes-operator/crds/customresourcedefinition_aerospikeclusters.asdb.aerospike.com.yaml index dda91cbf1..ca804bf58 100644 --- a/helm-charts/aerospike-kubernetes-operator/crds/customresourcedefinition_aerospikeclusters.asdb.aerospike.com.yaml +++ b/helm-charts/aerospike-kubernetes-operator/crds/customresourcedefinition_aerospikeclusters.asdb.aerospike.com.yaml @@ -8900,16 +8900,6 @@ spec: - customInterface type: string type: object - ignorePodList: - description: IgnorePodList is a list of pods that the operator will - ignore while assessing cluster stability. Pods specified in this - list are not considered part of the cluster. This is particularly - useful when there are failed pods and the operator needs to perform - certain operations on the cluster. Note that running pods included - in this list will not be ignored. - items: - type: string - type: array image: description: Aerospike server image type: string diff --git a/test/cluster_test.go b/test/cluster_test.go index 6075fb963..57ee9e823 100644 --- a/test/cluster_test.go +++ b/test/cluster_test.go @@ -9,6 +9,7 @@ import ( v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" "k8s.io/apimachinery/pkg/types" + "k8s.io/apimachinery/pkg/util/intstr" asdbv1 "github.com/aerospike/aerospike-kubernetes-operator/api/v1" ) @@ -155,7 +156,8 @@ func clusterWithIgnorePodList(ctx goctx.Context) { By("Set IgnorePodList and scale down 1 pod") aeroCluster, err = getCluster(k8sClient, ctx, clusterNamespacedName) Expect(err).ToNot(HaveOccurred()) - aeroCluster.Spec.IgnorePodList = []string{ignorePodName} + val := intstr.FromInt(1) + aeroCluster.Spec.RackConfig.MaxIgnorableFailedPods = &val aeroCluster.Spec.Size-- err = updateCluster(k8sClient, ctx, aeroCluster) Expect(err).ToNot(HaveOccurred()) @@ -193,7 +195,7 @@ func clusterWithIgnorePodList(ctx goctx.Context) { "Remove pod from IgnorePodList and verify pod %s is in running state", ignorePodName)) aeroCluster, err = getCluster(k8sClient, ctx, clusterNamespacedName) Expect(err).ToNot(HaveOccurred()) - aeroCluster.Spec.IgnorePodList = []string{} + aeroCluster.Spec.RackConfig.MaxIgnorableFailedPods = nil err = updateCluster(k8sClient, ctx, aeroCluster) Expect(err).ToNot(HaveOccurred()) @@ -254,7 +256,8 @@ func clusterWithIgnorePodList(ctx goctx.Context) { By("Delete rack with id 2") aeroCluster, err = getCluster(k8sClient, ctx, clusterNamespacedName) Expect(err).ToNot(HaveOccurred()) - aeroCluster.Spec.IgnorePodList = []string{ignorePodName} + val := intstr.FromInt(1) + aeroCluster.Spec.RackConfig.MaxIgnorableFailedPods = &val aeroCluster.Spec.RackConfig = asdbv1.RackConfig{Racks: getDummyRackConf(1)} err = updateCluster(k8sClient, ctx, aeroCluster) Expect(err).ToNot(HaveOccurred())