From 46ce1aebe99313c435dc3d48b1c78db371f198c6 Mon Sep 17 00:00:00 2001 From: Tanmay Jain Date: Thu, 28 Mar 2024 12:06:59 +0530 Subject: [PATCH] address comments --- test/cluster_test.go | 2 +- test/dynamic_config_test.go | 5 +++-- test/utils.go | 4 +--- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/test/cluster_test.go b/test/cluster_test.go index 752437dbc..a612386e2 100644 --- a/test/cluster_test.go +++ b/test/cluster_test.go @@ -184,7 +184,7 @@ func clusterWithMaxIgnorablePod(ctx goctx.Context) { Expect(err).ToNot(HaveOccurred()) val := intstr.FromInt32(1) aeroCluster.Spec.RackConfig.MaxIgnorablePods = &val - aeroCluster.Spec.AerospikeConfig.Value["security"].(map[string]interface{})["enable-quotas"] = false + aeroCluster.Spec.AerospikeConfig.Value["security"].(map[string]interface{})["enable-quotas"] = true // As pod is in pending state, CR object will be won't reach the final phase. // So expectedPhases can be InProgress or Completed diff --git a/test/dynamic_config_test.go b/test/dynamic_config_test.go index 29e3959b5..df87c5681 100644 --- a/test/dynamic_config_test.go +++ b/test/dynamic_config_test.go @@ -163,7 +163,7 @@ var _ = Describe( podPIDMap, err := getPodIDs(ctx, aeroCluster) Expect(err).ToNot(HaveOccurred()) - aeroCluster.Spec.AerospikeConfig.Value["security"].(map[string]interface{})["enable-quotas"] = false + aeroCluster.Spec.AerospikeConfig.Value["security"].(map[string]interface{})["enable-quotas"] = true dc := map[string]interface{}{ "name": "dc2", "auth-mode": "internal", @@ -194,7 +194,7 @@ var _ = Describe( enableQuotas, ok := conf["enable-quotas"].(bool) Expect(ok).ToNot(BeFalse()) - Expect(enableQuotas).To(BeFalse()) + Expect(enableQuotas).To(BeTrue()) conf, err = getAerospikeConfigFromNode(logger, k8sClient, ctx, clusterNamespacedName, "xdr", &pod) @@ -221,6 +221,7 @@ func validateServerRestart(ctx goctx.Context, cluster *asdbv1.AerospikeCluster, for podName, pid := range pidMap { if newPodPidMap[podName].podUID != pid.podUID || newPodPidMap[podName].asdPID != pid.asdPID { restarted = true + break } } diff --git a/test/utils.go b/test/utils.go index 62eeac2ee..7db639344 100644 --- a/test/utils.go +++ b/test/utils.go @@ -791,7 +791,5 @@ func getAerospikeConfigFromNode(log logr.Logger, k8sClient client.Client, ctx go return nil, err } - svcConfs := confs[configContext].(lib.Stats) - - return svcConfs, nil + return confs[configContext].(lib.Stats), nil }