[release-v0.23.2] TestServiceExport works with images specified by digest (#1435)#794
Conversation
* TestServiceExport works with images specified by digest * Do not expect image name in TestSourceContainer test * it might not be available if the test image is passed as image digest
| 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}), |
There was a problem hiding this comment.
Shouldn't the whole annotation not be set if the userImage is "" (instead of setting the annotation with an empty string ?)
There was a problem hiding this comment.
I've chosen this approach to keep the tests simple. In the end the annotation is set to an empty value by the kn client anyway: https://github.com/knative/client/blob/release-0.23/pkg/kn/commands/service/create.go#L261
There was a problem hiding this comment.
but as it seems to work upstream also with an empty value, looks fine to me. Please note though that this fix might not work with --lock-to-digest option as this option relies on this annotation to contain the value with digest (and if I think twice, I think this annotation is supposed to always hold the digest, but let me check)
There was a problem hiding this comment.
Ah, no. it's the other way round, actually the annotation shouldn't contain any digest, so the fix looks good to me.
/approve
/lgtm
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mgencur, rhuss The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Backport of knative#1435 to release-0.23.2 branch.
This should allow openshift/release#21285 to pass and allow for using cluster-pools.
TestServiceExport works with images specified by digest
Do not expect image name in TestSourceContainer test
it might not be available if the test image is passed as image digest