Describe the bug
version-checker seems to not do the comparison properly sometimes, leading to the metrics stating it's not the latest while it is.
I haven't tested with other registries, but it happens with docker.io, and the annotation match-regex.version-checker.io.
Here is a simple pod to test that scenario:
apiVersion: v1
kind: Pod
metadata:
creationTimestamp: null
labels:
run: test-pod
annotations:
match-regex.version-checker.io/test: ^\d+.\d+.\d+-glibc
name: test-pod
spec:
containers:
- image: docker.io/busybox:1.36.1-glibc
name: test
args:
- sh
- -c
- "sleep infinity"
docker.io/busybox:1.36.1-glibc is currently the latest of the -glibc suffix.
The produced metric has the following labels, and its value is 0:
First thing to note is the current_version and latest_version contains the sha, so I assume it compares using the sha in that case, instead of just the tag. From my tests, I concluded that when the semVer doesn't match, version-checker immediately states it's not the latest (which makes sense). But when it matches, version-checker then compares using the sha. I'm not sure if I'm right about the behavior, nor if it's expected.
In any case, when the semVer match, and sha is compared, both values are differents. Looking in docker hub, the "current_version" is matching the "Index digest", while "latest_version" is matching "Manifest digest", which are both different for the same image. I suppose that's why the metrics returns 0.
To Reproduce
See above
Expected behavior
version-checker should return current version match the latest
Screenshots
Environment (please complete the following information):
Version-Checker: 0.7.0
Kubernetes: 1.29.1
Additional context
Add any other context about the problem here.
This issue has been automatically marked as stale because it has not had
any activity in the last 90 days. It will be closed if no further activity
occurs. Thank you for your contributions.
Describe the bug version-checker seems to not do the comparison properly sometimes, leading to the metrics stating it's not the latest while it is. I haven't tested with other registries, but it happens with docker.io, and the annotation
match-regex.version-checker.io
.Here is a simple pod to test that scenario:
docker.io/busybox:1.36.1-glibc
is currently the latest of the-glibc
suffix.The produced metric has the following labels, and its value is
0
:First thing to note is the
current_version
andlatest_version
contains the sha, so I assume it compares using the sha in that case, instead of just the tag. From my tests, I concluded that when the semVer doesn't match, version-checker immediately states it's not the latest (which makes sense). But when it matches, version-checker then compares using the sha. I'm not sure if I'm right about the behavior, nor if it's expected. In any case, when the semVer match, and sha is compared, both values are differents. Looking in docker hub, the "current_version" is matching the "Index digest", while "latest_version" is matching "Manifest digest", which are both different for the same image. I suppose that's why the metrics returns 0.To Reproduce See above
Expected behavior version-checker should return current version match the latest
Screenshots
Environment (please complete the following information):
Additional context Add any other context about the problem here.