From 29efe66d3fa87b2afa63b2f4741e774299508056 Mon Sep 17 00:00:00 2001 From: Nick Kubala Date: Tue, 14 Jul 2020 12:54:38 -0700 Subject: [PATCH] fix tests --- integration/helm_test.go | 6 +++--- integration/render_test.go | 14 ++++++++------ pkg/skaffold/build/tag/date_time.go | 4 ++-- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/integration/helm_test.go b/integration/helm_test.go index d95bab12060..922f2fc483b 100644 --- a/integration/helm_test.go +++ b/integration/helm_test.go @@ -33,10 +33,10 @@ func TestHelmDeploy(t *testing.T) { env := []string{fmt.Sprintf("TEST_NS=%s", ns.Name)} skaffold.Deploy("--images", "gcr.io/k8s-skaffold/skaffold-helm").InDir("testdata/helm").InNs(ns.Name).WithEnv(env).RunOrFail(t) - // check if labels are set correctly for deployment + // check if annotations are set correctly for deployment dep := client.GetDeployment("skaffold-helm-" + ns.Name) - testutil.CheckDeepEqual(t, dep.Name, dep.ObjectMeta.Labels["release"]) - testutil.CheckDeepEqual(t, "helm", dep.ObjectMeta.Labels["skaffold.dev/deployer"]) + testutil.CheckDeepEqual(t, dep.Name, dep.ObjectMeta.Annotations["release"]) + testutil.CheckDeepEqual(t, "helm", dep.ObjectMeta.Annotations["skaffold.dev/deployer"]) skaffold.Delete().InDir("testdata/helm").InNs(ns.Name).WithEnv(env).RunOrFail(t) } diff --git a/integration/render_test.go b/integration/render_test.go index f570a056788..3896cf27068 100644 --- a/integration/render_test.go +++ b/integration/render_test.go @@ -528,14 +528,15 @@ spec: expectedOut: `apiVersion: v1 kind: Pod metadata: - labels: - app.kubernetes.io/managed-by: SOMEDYNAMICVALUE + annotations: skaffold.dev/builder: local skaffold.dev/cleanup: "true" skaffold.dev/deployer: kubectl skaffold.dev/docker-api-version: SOMEDYNAMICVALUE - skaffold.dev/run-id: SOMEDYNAMICVALUE skaffold.dev/tag-policy: git-commit + labels: + app.kubernetes.io/managed-by: SOMEDYNAMICVALUE + skaffold.dev/run-id: SOMEDYNAMICVALUE name: my-pod-123 spec: containers: @@ -636,14 +637,15 @@ resources: expectedOut: `apiVersion: v1 kind: Pod metadata: - labels: - app.kubernetes.io/managed-by: SOMEDYNAMICVALUE + annotations: skaffold.dev/builder: local skaffold.dev/cleanup: "true" skaffold.dev/deployer: kustomize skaffold.dev/docker-api-version: SOMEDYNAMICVALUE - skaffold.dev/run-id: SOMEDYNAMICVALUE skaffold.dev/tag-policy: git-commit + labels: + app.kubernetes.io/managed-by: SOMEDYNAMICVALUE + skaffold.dev/run-id: SOMEDYNAMICVALUE this-is-from: kustomization.yaml name: my-pod-123 spec: diff --git a/pkg/skaffold/build/tag/date_time.go b/pkg/skaffold/build/tag/date_time.go index 386fc31230a..ceae17f7a45 100644 --- a/pkg/skaffold/build/tag/date_time.go +++ b/pkg/skaffold/build/tag/date_time.go @@ -44,11 +44,11 @@ func NewDateTimeTagger(format, timezone string) Tagger { } } -func (t *dateTimeTagger) Labels() map[string]string { +func (tagger *dateTimeTagger) Labels() map[string]string { return map[string]string{} } -func (t *dateTimeTagger) Annotations() map[string]string { +func (tagger *dateTimeTagger) Annotations() map[string]string { return map[string]string{ constants.Labels.TagPolicy: "dateTimeTagger", }