Fix some minor linter style warnings.

Signed-off-by: Matt Moyer <moyerm@vmware.com>
This commit is contained in:
Matt Moyer 2021-04-22 11:47:05 -05:00
parent 425e53a26b
commit c1b1082c55
No known key found for this signature in database
GPG Key ID: EAE88AD172C5AE2D
3 changed files with 5 additions and 8 deletions

View File

@ -90,7 +90,6 @@ func (c *deleterController) Sync(ctx controllerlib.Context) error {
func inTerminalState(pod *corev1.Pod) bool { func inTerminalState(pod *corev1.Pod) bool {
switch pod.Status.Phase { switch pod.Status.Phase {
// Running and Pending are non-terminal states. We should not delete pods in these states. // Running and Pending are non-terminal states. We should not delete pods in these states.
case corev1.PodRunning, corev1.PodPending: case corev1.PodRunning, corev1.PodPending:
return false return false

View File

@ -501,7 +501,6 @@ func TestDeleterControllerSync(t *testing.T) {
// The matching controller-manager pod exists. // The matching controller-manager pod exists.
r.NoError(kubeSystemInformerClient.Tracker().Add(controllerManagerPod)) r.NoError(kubeSystemInformerClient.Tracker().Add(controllerManagerPod))
r.NoError(kubeAPIClient.Tracker().Add(controllerManagerPod)) r.NoError(kubeAPIClient.Tracker().Add(controllerManagerPod))
}) })
when("in a Failed state", func() { when("in a Failed state", func() {

View File

@ -39,7 +39,7 @@ func TestKubeCertAgent(t *testing.T) {
// Make sure the agent pods are running and healthy before the tests begin. // Make sure the agent pods are running and healthy before the tests begin.
t.Logf("waiting for agent pods to become running before tests") 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. // 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. // Make sure the pods all become healthy.
t.Logf("waiting for agent pods to become running") 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) { 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. // Make sure the pods all become healthy.
t.Logf("waiting for agent pods to become running") 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) { 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. // Make sure the pods all become healthy.
t.Logf("waiting for agent pods to become running") 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) { library.RequireEventuallyWithoutError(t, func() (bool, error) {
pods, err := kubeClient.CoreV1().Pods(env.ConciergeNamespace).List(ctx, metav1.ListOptions{ pods, err := kubeClient.CoreV1().Pods(env.ConciergeNamespace).List(ctx, metav1.ListOptions{
LabelSelector: kubeCertAgentLabelSelector, LabelSelector: kubeCertAgentLabelSelector,