-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
CI: Auto update inspektor-gadget YAMLs #19717
Conversation
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.
Hi!
Thank you! This definitely eases the whole process!
I tested it and it works perfectly:
$ go run ./cmd/minikube/ start --addons=inspektor-gadget
😄 minikube v0.0.0-unset sur Ubuntu 22.04
🎉 minikube 1.34.0 est disponible ! Téléchargez-le ici : https://github.com/kubernetes/minikube/releases/tag/v1.34.0
💡 Pour désactiver cette notification, exécutez : 'minikube config set WantUpdateNotification false'
✨ Choix automatique du pilote docker. Autres choix: kvm2, qemu2, ssh
📌 Utilisation du pilote Docker avec le privilège root
👍 Démarrage du nœud "minikube" primary control-plane dans le cluster "minikube"
🚜 Extraction de l'image de base v0.0.45-1727108449-19696...
🔥 Création de docker container (CPU=2, Memory=7900Mo) ...
...
🌟 Modules activés: default-storageclass, inspektor-gadget
💡 kubectl introuvable. Si vous en avez besoin, essayez : 'minikube kubectl -- get pods -A'
🏄 Terminé ! kubectl est maintenant configuré pour utiliser "minikube" cluster et espace de noms "default" par défaut.
$ ../kubectl get pod -n gadget (remotes/spowelljr/autoUpdateInspekYAML) %
NAME READY STATUS RESTARTS AGE
gadget-qhh7w 1/1 Running 0 2m42s
I only found one nit, but I am not sure about it.
Best regards.
klog.Fatalf("failed to read body: %v", err) | ||
} | ||
replacements := map[string]string{ | ||
`ghcr\.io\/inspektor-gadget\/inspektor-gadget:.*`: "{{.CustomRegistries.InspektorGadget | default .ImageRepository | default .Registries.InspektorGadget }}{{.Images.InspektorGadget}}", |
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.
I am wondering if we should not just replace ``ghcr.io/inspektor-gadget/inspektor-gadget`.
This way, it would also update the corresponding environment value:
bbeb1da#diff-6cba2efa346e98239fde3c0ac5bad4058aa50bd90c1da8d4042efda77cf1af0dL77
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.
Thanks for pointing this out, the problem is that {{.Images.InspektorGadget}}
includes the image and the tag, where there seems to be a specific env for the image and tag individually. This in itself if not a big issue because I could make two new map fields InspektorGadgetWithoutVersion
and InspektorGadgetVersion
(or something similar). But this is further complicated that we allow the user to overwrite the .Images.InspektorGadget
using flags. So then the envs and the image actually used would be out of sync again. Just curious, what are the GADGET_IMAGE
& INSPEKTOR_GADGET_VERSION
envs used for.
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.
They are only used for logging purpose:
https://github.com/inspektor-gadget/inspektor-gadget/blob/df184595c61021d87a3a82c02e4ac965a707edaf/gadget-container/entrypoint/entrypoint.go#L250
https://github.com/inspektor-gadget/inspektor-gadget/blob/df184595c61021d87a3a82c02e4ac965a707edaf/gadget-container/entrypoint/entrypoint.go#L264
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: medyagh, spowelljr The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Auto update inspektor-gadget YAMLs
Tested:
cc @eiffel-fl