-
Notifications
You must be signed in to change notification settings - Fork 185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
run: Add pull policy --pull
flag
#2179
Conversation
I tried it together with @claudiamarcubina and it seems that it isn't working as expected for pull policy $ go run -exec "sudo -E" ./cmd/ig image pull ghcr.io/inspektor-gadget/gadget/trace_open:latest
$ go run -exec "sudo -E" ./cmd/ig image pull ghcr.io/inspektor-gadget/gadget/trace_exec:latest
$ go run -exec "sudo -E" ./cmd/ig image tag ghcr.io/inspektor-gadget/gadget/trace_exec:latest ghcr.io/inspektor-gadget/gadget/trace_open:latest
# ensure trace_open is actually trace_exec
$ go run -exec "sudo -E" ./cmd/ig run ghcr.io/inspektor-gadget/gadget/trace_exec:latest
$ go run -exec "sudo -E" ./cmd/ig run ghcr.io/inspektor-gadget/gadget/trace_open:latest
# verify trace_open is trace_open
$ go run -exec "sudo -E" ./cmd/ig run --pull always ghcr.io/inspektor-gadget/gadget/trace_open:latest It seems oci-store used by |
I tested it locally and its interesting: ➭ go run --exec "sudo -E" ./cmd/ig/... image list
INFO[0000] Experimental features enabled
REPOSITORY TAG DIGEST
ghcr.io/burak-ok/trace_exec latest 30507a96ca40
ghcr.io/burak-ok/trace_open latest d798a768d944
➭ go run --exec "sudo -E" ./cmd/ig/... image tag ghcr.io/burak-ok/trace_open ghcr.io/burak-ok/trace_exec
INFO[0000] Experimental features enabled
Successfully tagged with ghcr.io/burak-ok/trace_exec:latest@sha256:d798a768d9449b13694aae2d0eb074e5f39cdddbc6a116fc26afe8a671afcfb9
➭ go run --exec "sudo -E" ./cmd/ig/... image list
INFO[0000] Experimental features enabled
REPOSITORY TAG DIGEST
ghcr.io/burak-ok/trace_exec latest d798a768d944
ghcr.io/burak-ok/trace_open latest d798a768d944
➭ go run --exec "sudo -E" ./cmd/ig/... run ghcr.io/burak-ok/trace_exec --pull always
INFO[0000] Experimental features enabled
RUNTIME.CONTAINERNAME PID COMM UID GID RET FNAME
minikube-docker 1894556888 1041 57564 -1
minikube-docker 1902313085 1041 57570 -1 -init
^C%
➭ go run --exec "sudo -E" ./cmd/ig/... image list
INFO[0000] Experimental features enabled
REPOSITORY TAG DIGEST
ghcr.io/burak-ok/trace_exec latest 30507a96ca40
ghcr.io/burak-ok/trace_open latest d798a768d944
➭ go run --exec "sudo -E" ./cmd/ig/... run ghcr.io/burak-ok/trace_exec --pull never
INFO[0000] Experimental features enabled
RUNTIME.CONTAINERNAME PID PPID COMM UID GID RETVAL
minikube-docker 64419 19274 bridge 0 0 0
minikube-docker 64425 19274 portmap 0 0 0 The first running gadget is clearly Just wanted to share - Fixing it :) |
4baa1e3
to
e16e297
Compare
That was totally correct. It didn't refer to the same I just had to "reload" the |
e16e297
to
d96a04f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and works as described ✅ Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works fine. Just one blocker question on the first commit. LGTM otherwise.
Signed-off-by: Burak Ok <burakok@microsoft.com>
d96a04f
to
76ea94e
Compare
Signed-off-by: Burak Ok <burakok@microsoft.com>
Signed-off-by: Burak Ok <burakok@microsoft.com>
Signed-off-by: Burak Ok <burakok@microsoft.com>
76ea94e
to
bac8078
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for working on this!
run: Add pull policy
--pull
flag--pull missing
(default) only pulls the image when it is missing--pull always
Pulls always--pull never
Never pullsThe pull policy behavior is the same as Docker, but not the same as for K8s. For K8s in the default case the pull policy is missing, except when the
latest
tag is used. Then it is always pullingFixes #2101
Slack Discussion: https://kubernetes.slack.com/archives/CSYL75LF6/p1697722813839619