You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Crane Maintainers: One of the things you can do with containerd mirroring is configure containerd to pass headers to the mirrored registry. This is useful if the mirror is itself caching pull-through registry. So: the in-cluster workload asks containerd to pull docker.io/hello-world:latest, then containerd mirrors that to my-caching-pullthruregistry.svc.cluster.local and sends it header "X-Registry=docker.io". Then the caching pull through registry: 1) inspects its cache, 2) determines it does not have hello-world:latest, 3) looks at header "X-Registry" and 4) does a pull of docker.io/hello-world:latest, adding it to cache and returning that image to containerd.
To interact with the pull through registry and test / validate this behavior, it would be nice if the crane utility supported an arg like --header=HEADER=VALUE. Example:
I wonder if a --header flag would be useful at the root command, so that every command gets it "for free" instead of having to add it to each command individually. This would mean things like crane pull, crane mutate, crane export would also be able to be configured to send headers.
I defer to the maintainers. My purpose for the new flag is to drive a pull through registry. In order to test it - the pull through registry needs to honor the header so - that makes it tough to test unless I also signed up to modify the pkg/registry code to implement pull-through using the header which is a substantial bit of work I would think...
Actually - containerd appends ?ns= as a query parameter when mirroring is configured. So maybe rather than a header, the various REST API calls could have the namespace appended just like containerd does... Then crane would be behaving identically to containerd. In that case the arg would be something other than --header
This issue is stale because it has been open for 90 days with no
activity. It will automatically close after 30 more days of
inactivity. Keep fresh with the 'lifecycle/frozen' label.
Crane Maintainers: One of the things you can do with containerd mirroring is configure containerd to pass headers to the mirrored registry. This is useful if the mirror is itself caching pull-through registry. So: the in-cluster workload asks containerd to pull docker.io/hello-world:latest, then containerd mirrors that to my-caching-pullthruregistry.svc.cluster.local and sends it header "X-Registry=docker.io". Then the caching pull through registry: 1) inspects its cache, 2) determines it does not have hello-world:latest, 3) looks at header "X-Registry" and 4) does a pull of docker.io/hello-world:latest, adding it to cache and returning that image to containerd.
To interact with the pull through registry and test / validate this behavior, it would be nice if the
crane
utility supported an arg like--header=HEADER=VALUE
. Example:crane pull localhost:8080/hello-world:latest --header X-Registry=docker.io
.As I've been hacking around in the code it appears to me that this would be isolated to:
cmd/crane/cmd/pull.go
to add the flag,pkg/v1/remote/fetcher.go
to receive the flag and add the header if specifiedBefore I would put in the effort and submit a PR I first wanted to see if this is something you would consider including in the baseline.
Thank you.
The text was updated successfully, but these errors were encountered: