From 55de160551204b673baae0437450aad709e856e7 Mon Sep 17 00:00:00 2001 From: Ryan Richard Date: Tue, 14 Sep 2021 15:26:11 -0700 Subject: [PATCH] Bump the version number of the kube cert agent label Not required, but within the spirit of using the version number. Since the existing kube cert agent deployment will get deleted anyway during an upgrade, it shouldn't hurt to change the version number. New installations will get the new version number on the new kube cert agent deployment. --- internal/controller/kubecertagent/kubecertagent.go | 2 +- internal/controller/kubecertagent/kubecertagent_test.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/controller/kubecertagent/kubecertagent.go b/internal/controller/kubecertagent/kubecertagent.go index 9ae485bf..a67b7f2c 100644 --- a/internal/controller/kubecertagent/kubecertagent.go +++ b/internal/controller/kubecertagent/kubecertagent.go @@ -48,7 +48,7 @@ const ( // agentPodLabelKey is used to identify which pods are created by the kube-cert-agent // controllers. agentPodLabelKey = "kube-cert-agent.pinniped.dev" - agentPodLabelValue = "v2" + agentPodLabelValue = "v3" // conciergeDefaultLabelKeyName is the name of the key of the label applied to all Concierge resources. // This name is determined in the YAML manifests, but this controller needs to treat it as a special case below. diff --git a/internal/controller/kubecertagent/kubecertagent_test.go b/internal/controller/kubecertagent/kubecertagent_test.go index 8aa6d6da..fc286d1f 100644 --- a/internal/controller/kubecertagent/kubecertagent_test.go +++ b/internal/controller/kubecertagent/kubecertagent_test.go @@ -91,13 +91,13 @@ func TestAgentController(t *testing.T) { Spec: appsv1.DeploymentSpec{ Replicas: pointer.Int32Ptr(1), Selector: metav1.SetAsLabelSelector(map[string]string{ - "kube-cert-agent.pinniped.dev": "v2", + "kube-cert-agent.pinniped.dev": "v3", }), Template: corev1.PodTemplateSpec{ ObjectMeta: metav1.ObjectMeta{ Labels: map[string]string{ "extralabel": "labelvalue", - "kube-cert-agent.pinniped.dev": "v2", + "kube-cert-agent.pinniped.dev": "v3", }, }, Spec: corev1.PodSpec{ @@ -199,7 +199,7 @@ func TestAgentController(t *testing.T) { Namespace: "concierge", Name: "pinniped-concierge-kube-cert-agent-xyz-1234", UID: types.UID("pinniped-concierge-kube-cert-agent-xyz-1234-test-uid"), - Labels: map[string]string{"kube-cert-agent.pinniped.dev": "v2"}, + Labels: map[string]string{"kube-cert-agent.pinniped.dev": "v3"}, CreationTimestamp: metav1.NewTime(now.Add(-2 * time.Hour)), }, Spec: corev1.PodSpec{},