From c1b1082c5549116da3d6d55beb08f308750e6737 Mon Sep 17 00:00:00 2001 From: Matt Moyer Date: Thu, 22 Apr 2021 11:47:05 -0500 Subject: [PATCH] Fix some minor linter style warnings. Signed-off-by: Matt Moyer --- internal/controller/kubecertagent/deleter.go | 1 - internal/controller/kubecertagent/deleter_test.go | 1 - test/integration/concierge_kubecertagent_test.go | 11 +++++------ 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/internal/controller/kubecertagent/deleter.go b/internal/controller/kubecertagent/deleter.go index 9dc2f6c1..82268565 100644 --- a/internal/controller/kubecertagent/deleter.go +++ b/internal/controller/kubecertagent/deleter.go @@ -90,7 +90,6 @@ func (c *deleterController) Sync(ctx controllerlib.Context) error { func inTerminalState(pod *corev1.Pod) bool { switch pod.Status.Phase { - // Running and Pending are non-terminal states. We should not delete pods in these states. case corev1.PodRunning, corev1.PodPending: return false diff --git a/internal/controller/kubecertagent/deleter_test.go b/internal/controller/kubecertagent/deleter_test.go index d71bd4e8..029a2031 100644 --- a/internal/controller/kubecertagent/deleter_test.go +++ b/internal/controller/kubecertagent/deleter_test.go @@ -501,7 +501,6 @@ func TestDeleterControllerSync(t *testing.T) { // The matching controller-manager pod exists. r.NoError(kubeSystemInformerClient.Tracker().Add(controllerManagerPod)) r.NoError(kubeAPIClient.Tracker().Add(controllerManagerPod)) - }) when("in a Failed state", func() { diff --git a/test/integration/concierge_kubecertagent_test.go b/test/integration/concierge_kubecertagent_test.go index 57cf0b20..8a01bf45 100644 --- a/test/integration/concierge_kubecertagent_test.go +++ b/test/integration/concierge_kubecertagent_test.go @@ -39,7 +39,7 @@ func TestKubeCertAgent(t *testing.T) { // Make sure the agent pods are running and healthy before the tests begin. t.Logf("waiting for agent pods to become running before tests") - waitForAllAgentsRunning(t, kubeClient, env, ctx) + waitForAllAgentsRunning(ctx, t, kubeClient, env) // Get the current number of kube-cert-agent pods. // @@ -119,7 +119,7 @@ func TestKubeCertAgent(t *testing.T) { // Make sure the pods all become healthy. t.Logf("waiting for agent pods to become running") - waitForAllAgentsRunning(t, kubeClient, env, ctx) + waitForAllAgentsRunning(ctx, t, kubeClient, env) }) t.Run("reconcile on delete", func(t *testing.T) { @@ -140,7 +140,7 @@ func TestKubeCertAgent(t *testing.T) { // Make sure the pods all become healthy. t.Logf("waiting for agent pods to become running") - waitForAllAgentsRunning(t, kubeClient, env, ctx) + waitForAllAgentsRunning(ctx, t, kubeClient, env) }) t.Run("reconcile on unhealthy", func(t *testing.T) { @@ -194,12 +194,11 @@ func TestKubeCertAgent(t *testing.T) { // Make sure the pods all become healthy. t.Logf("waiting for agent pods to become running") - waitForAllAgentsRunning(t, kubeClient, env, ctx) + waitForAllAgentsRunning(ctx, t, kubeClient, env) }) - } -func waitForAllAgentsRunning(t *testing.T, kubeClient kubernetes.Interface, env *library.TestEnv, ctx context.Context) { +func waitForAllAgentsRunning(ctx context.Context, t *testing.T, kubeClient kubernetes.Interface, env *library.TestEnv) { library.RequireEventuallyWithoutError(t, func() (bool, error) { pods, err := kubeClient.CoreV1().Pods(env.ConciergeNamespace).List(ctx, metav1.ListOptions{ LabelSelector: kubeCertAgentLabelSelector,