Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions test/e2e/service_export_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,16 @@ func TestServiceExport(t *testing.T) {
t.Log("create service with byo revision")
serviceCreateWithOptions(r, "hello", "--revision-name", "rev1")

userImage := pkgtest.ImagePath("helloworld")
if strings.Contains(userImage, "@") {
// Images specified by digest are not set in user-image annotation.
userImage = ""
}
t.Log("export service-revision1 and compare")
serviceExport(r, "hello", test.BuildServiceWithOptions("hello",
servingtest.WithConfigSpec(test.BuildConfigurationSpec()),
servingtest.WithBYORevisionName("hello-rev1"),
test.WithRevisionAnnotations(map[string]string{"client.knative.dev/user-image": pkgtest.ImagePath("helloworld")}),
test.WithRevisionAnnotations(map[string]string{"client.knative.dev/user-image": userImage}),
), "--mode", "replay", "-o", "json")

t.Log("update service - add env variable")
Expand Down Expand Up @@ -97,7 +102,7 @@ func TestServiceExport(t *testing.T) {
servingtest.WithConfigSpec(test.BuildConfigurationSpec()),
servingtest.WithBYORevisionName("hello-rev1"),
test.WithRevisionAnnotations(map[string]string{
"client.knative.dev/user-image": pkgtest.ImagePath("helloworld"),
"client.knative.dev/user-image": userImage,
"serving.knative.dev/routes": "hello",
}),
)),
Expand All @@ -117,7 +122,7 @@ func TestServiceExport(t *testing.T) {
servingtest.WithEnv(corev1.EnvVar{Name: "a", Value: "mouse"}),
), test.BuildKNExportWithOptions(
test.WithKNRevision(*(test.BuildRevision("hello-rev1",
servingtest.WithRevisionAnn("client.knative.dev/user-image", pkgtest.ImagePath("helloworld")),
servingtest.WithRevisionAnn("client.knative.dev/user-image", userImage),
servingtest.WithRevisionAnn("serving.knative.dev/routes", "hello"),
servingtest.WithRevisionLabel("serving.knative.dev/configuration", "hello"),
servingtest.WithRevisionLabel("serving.knative.dev/configurationGeneration", "1"),
Expand All @@ -136,7 +141,7 @@ func TestServiceExport(t *testing.T) {
test.WithService(test.BuildServiceWithOptions("hello",
servingtest.WithConfigSpec(test.BuildConfigurationSpec()),
test.WithRevisionAnnotations(map[string]string{
"client.knative.dev/user-image": pkgtest.ImagePath("helloworld"),
"client.knative.dev/user-image": userImage,
"serving.knative.dev/routes": "hello",
}),
servingtest.WithBYORevisionName("hello-rev1"),
Expand Down Expand Up @@ -167,7 +172,7 @@ func TestServiceExport(t *testing.T) {
servingtest.WithEnv(corev1.EnvVar{Name: "a", Value: "mouse"}, corev1.EnvVar{Name: "b", Value: "cat"}),
), test.BuildKNExportWithOptions(
test.WithKNRevision(*(test.BuildRevision("hello-rev1",
servingtest.WithRevisionAnn("client.knative.dev/user-image", pkgtest.ImagePath("helloworld")),
servingtest.WithRevisionAnn("client.knative.dev/user-image", userImage),
servingtest.WithRevisionAnn("serving.knative.dev/routes", "hello"),
servingtest.WithRevisionLabel("serving.knative.dev/configuration", "hello"),
servingtest.WithRevisionLabel("serving.knative.dev/configurationGeneration", "1"),
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/source_container_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func containerSourceList(r *test.KnRunResultCollector, containerSources ...strin
r.AssertNoError(out)
assert.Check(r.T(), util.ContainsAll(out.Stdout, "NAME", "IMAGE", "SINK", "READY"))
assert.Check(r.T(), util.ContainsAll(out.Stdout, containerSources...))
assert.Check(r.T(), util.ContainsAll(out.Stdout, "grpc-ping", "ksvc:testsvc0"))
assert.Check(r.T(), util.ContainsAll(out.Stdout, "ksvc:testsvc0"))
}

func containerSourceCreateMissingSink(r *test.KnRunResultCollector, sourceName string, sink string) {
Expand Down