Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nkubala committed Jul 14, 2020
1 parent 5584a03 commit 29efe66
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
6 changes: 3 additions & 3 deletions integration/helm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
14 changes: 8 additions & 6 deletions integration/render_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions pkg/skaffold/build/tag/date_time.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
}
Expand Down

0 comments on commit 29efe66

Please sign in to comment.