Skip to content

Commit

Permalink
Fix unit test errors after rebasing
Browse files Browse the repository at this point in the history
  • Loading branch information
toVersus committed Aug 29, 2019
1 parent 627405c commit fff4bfe
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
1 change: 1 addition & 0 deletions pkg/kn/commands/service/service_create_mock_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ func TestServiceCreateEnvMock(t *testing.T) {
assert.NilError(t, err)
template.Spec.GetContainer().Env = envVars
template.Spec.Containers[0].Image = "gcr.io/foo/bar:baz"
template.Annotations = map[string]string{servinglib.UserImageAnnotationKey: "gcr.io/foo/bar:baz"}
r.CreateService(service, nil)

output, err := executeServiceCommand(client, "create", "foo", "--image", "gcr.io/foo/bar:baz", "-e", "a=mouse", "--env", "b=cookie", "--env=empty", "--async", "--revision-name=")
Expand Down
2 changes: 2 additions & 0 deletions pkg/kn/commands/service/service_update_mock_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ func TestServiceUpdateEnvMock(t *testing.T) {
{Name: "empty", Value: ""},
}
template.Spec.GetContainer().Image = "gcr.io/foo/bar:baz"
template.Annotations = map[string]string{servinglib.UserImageAnnotationKey: "gcr.io/foo/bar:baz"}

updated := getService("foo")
template, err = servinglib.RevisionTemplateOfService(updated)
Expand All @@ -50,6 +51,7 @@ func TestServiceUpdateEnvMock(t *testing.T) {
{Name: "b", Value: "cookie"},
}
template.Spec.GetContainer().Image = "gcr.io/foo/bar:baz"
template.Annotations = map[string]string{servinglib.UserImageAnnotationKey: "gcr.io/foo/bar:baz"}

r := client.Recorder()
r.GetService("foo", nil, errors.NewNotFound(v1alpha1.Resource("service"), "foo"))
Expand Down
4 changes: 0 additions & 4 deletions pkg/kn/commands/service/service_update_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -369,10 +369,6 @@ func TestServiceUpdatePinsToDigestWhenAsked(t *testing.T) {
delete(template.Annotations, servinglib.UserImageAnnotationKey)
if err != nil {
t.Fatal(err)
} else if template.Spec.DeprecatedContainer.Image != "gcr.io/foo/bar:baz" {
t.Fatalf("wrong image set: %v", template.Spec.DeprecatedContainer.Image)
} else if template.Spec.DeprecatedContainer.Env[0] != expectedEnvVar {
t.Fatalf("wrong env set: got=%#v\n want=%#v", template.Spec.DeprecatedContainer.Env, expectedEnvVar)
}

servinglib.UpdateImage(template, "gcr.io/foo/bar:baz")
Expand Down

0 comments on commit fff4bfe

Please sign in to comment.