Closed pathcl closed 4 years ago
No problem @pathcl.
I think the use case makes complete sense. Though this should be achievable today:
Get a list of all of the images running in the cluster (https://kubernetes.io/docs/tasks/access-application-cluster/list-all-running-container-images/)
$ kubectl get pods --all-namespaces -o go-template --template="{{range .items}}{{range .spec.containers}}{{.image}} {{end}}{{end}}"
Then either set the SINKER_IMAGES
environment variable to that list, or pass that list to the command line with --images
. Include --target
to set where you want them to go.
$ export SINKER_IMAGES=imageOne:v1,imageTwo:v1
$ export SINKER_TARGET=internal.com/repo
$ sinker push
--or--
$ sinker push -i imageOne:v1,imageTwo:v1 -t internal.com/repo
Would that work?
edit: If you would like to save that list for future use, I do think it makes sense to have the create
command take similar arguments and create a manifest that way.
@pathcl a fair number of changes have been added to the main branch, but not quite released yet. Standard input is now supported which may solve your request.
$ kubectl get pods --all-namespaces -o jsonpath="{.items[*].spec.containers[*].image}" | ./sinker create - --target repo
Standard input has been released in 0.11.0
First thank you for the project! I'd like to make a suggestion:
Use case: you want to retrieve all images from one cluster to make it air-gapped.
Let's assume you're already running a cluster. Probably its convenient to get all images from it and then generate the config needed for sinker:
Something like this will get all the images running:
From there we'd only need to generate the yaml for sinker and/or filter it. Thoughts?