Add script to check container images' agent versions#1404
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1404 +/- ##
==========================================
- Coverage 86.39% 85.19% -1.20%
==========================================
Files 102 102
Lines 12622 12972 +350
==========================================
+ Hits 10905 11052 +147
- Misses 1236 1435 +199
- Partials 481 485 +4 see 21 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
scripts/check-images.sh
Outdated
|
|
||
| for tag in "${FOUND[@]}"; do | ||
| echo ":: ${REGISTRY_URL}/${IMAGE_NAME}:$tag" | ||
| podman pull ${REGISTRY_URL}/${IMAGE_NAME}:$tag > /dev/null 2>&1 |
There was a problem hiding this comment.
Can you add a check to see if docker or podman is installed? Some people might use docker over podman
There was a problem hiding this comment.
Defaults to docker if available, if not it checks for podman
scripts/check-images.sh
Outdated
| echo "Checking images in ${REGISTRY_URL}/${IMAGE_NAME}" | ||
|
|
||
| # Fetch all tags from the remote registry | ||
| skopeo list-tags docker://${REGISTRY_URL}/${IMAGE_NAME} | jq -r '.Tags[]' > all_tags.txt |
There was a problem hiding this comment.
Would it be possible to use the skopeo docker image instead? https://github.com/containers/skopeo/blob/main/install.md#container-images
Would save people having to install skopeo on their machines
There was a problem hiding this comment.
True yeah I'll add that
There was a problem hiding this comment.
Do we want this implemented as a Github workflow in that case?
There was a problem hiding this comment.
dont think we need a github workflow. The script by itself is fine
There was a problem hiding this comment.
Added the skopeo image
scripts/check-images.sh
Outdated
| ${CONTAINER_TOOL} --version | ||
|
|
||
| echo "Getting skopeo tool..." | ||
| ${CONTAINER_TOOL} pull docker://${SKOPEO_IMAGE} |
There was a problem hiding this comment.
Getting this error when pulling image using docker
Getting skopeo tool...
invalid reference format
* add check-images.sh to check installed nginx and agent version from remote registry * improve usage and comments * use skopeo container image * fix skopeo image pull url * fix image path reference format * [skip ci] split tag and image name, exit if image pull fails * remove action
Proposed changes
Adds a script
check-images.shwhich can check the agent version and nginx version of all image tags matching a pattern.Example:
will return all the tags found for the
agentv3image which match the patternalpine, and run the commands:nginx -vnginx-agent -vChecklist
Before creating a PR, run through this checklist and mark each as complete.
CONTRIBUTINGdocumentmake install-toolsand have attached any dependency changes to this pull requestREADME.md)