Add ImageCache for multi container support#7661
Add ImageCache for multi container support#7661knative-prow-robot merged 5 commits intoknative:masterfrom
Conversation
knative-prow-robot
left a comment
There was a problem hiding this comment.
@savitaashture: 0 warnings.
Details
In response to this:
Proposed Changes
- Added image cache changes to have cache for multiple containers
Result:
apiVersion: serving.knative.dev/v1 kind: Service metadata: name: multicontainer spec: template: metadata: name: multicontainer-v1 spec: containers: - image: container-a:v2 ports: - containerPort: 8111 - image: container-c:v2 name: second - image: container-b:v2image cache
kubectl get images.caching.internal.knative.dev NAME AGE multicontainer-v1-cache-second 90s multicontainer-v1-cachec0cb79286e5fb748b173d92990b0b9fe-user-co 90s multicontainer-v1-cached3e27505a93cf979d4ed256e644bb629-user-co 90s
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
| // MakeImageCache makes an caching.Image resources from a revision. | ||
| func MakeImageCache(rev *v1.Revision) *caching.Image { | ||
| image := rev.Status.DeprecatedImageDigest | ||
| func MakeImageCache(rev *v1.Revision, name string) *caching.Image { |
There was a problem hiding this comment.
Shall we pass in containerName, imageDigest string to not need to iterate twice?
There was a problem hiding this comment.
Currently passing only containerName not the digest
because here I don't get the digest value
when i do container.Image
There was a problem hiding this comment.
If you iterate over status, you'd get both, right?
There was a problem hiding this comment.
Ah got it modified.
Please take a look :)
| } | ||
| } | ||
| if image == "" { | ||
| image = rev.Spec.GetContainer().Image |
There was a problem hiding this comment.
This seems wrong now?
mattmoor
left a comment
There was a problem hiding this comment.
Produced via:
gofmt -s -w $(find -path './vendor' -prune -o -path './third_party' -prune -o -type f -name '*.go' -print)
b58ee48 to
93d8aef
Compare
mattmoor
left a comment
There was a problem hiding this comment.
Produced via:
gofmt -s -w $(find -path './vendor' -prune -o -path './third_party' -prune -o -type f -name '*.go' -print)
93d8aef to
3d476b3
Compare
|
|
||
| ns := rev.Namespace | ||
| imageName := resourcenames.ImageCache(rev) | ||
| _, err := c.imageLister.Images(ns).Get(imageName) |
There was a problem hiding this comment.
Are we not updating the Image resource when the digest changes?
|
The following is the coverage report on the affected files.
|
|
@markusthoemmes @vagababov @dprotaso @mattmoor Thank you :) |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mattmoor, savitaashture 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 |
|
/retest |
1 similar comment
|
/retest |
|
The following jobs failed:
Automatically retrying due to test flakiness... |
|
@googlebot rescan |
Fixes:
Parts of #5822 #3384
Proposed Changes
Result:
image cache