Skip to content
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

[BUG] Incorrect image latest version #276

Open
oGi4i opened this issue Sep 22, 2024 · 0 comments · May be fixed by #277
Open

[BUG] Incorrect image latest version #276

oGi4i opened this issue Sep 22, 2024 · 0 comments · May be fixed by #277
Assignees
Labels
bug Something isn't working

Comments

@oGi4i
Copy link

oGi4i commented Sep 22, 2024

Describe the bug
Incorrect version is picked as latest.

To Reproduce
Steps to reproduce the behavior:

  1. Deploy container with image docker.io/bitnami/redis with annotation match-regex.version-checker.io/redis: ^7\.\d+\.\d+-debian-\d+-r\d+$
  2. The actual metric is:
version_checker_is_latest_version{container="redis",container_type="container",current_version="7.4.0-debian-12-r4",image="mirror.gcr.io/bitnami/redis",latest_version="7.2.5-debian-12-r4",namespace="cloud",pod="nextcloud-redis-master-0"} 1
  1. The expected metricshould be:
version_checker_is_latest_version{container="redis",container_type="container",current_version="7.4.0-debian-12-r4",image="mirror.gcr.io/bitnami/redis",latest_version="7.4.0-debian-12-r4",namespace="cloud",pod="nextcloud-redis-master-0"} 1

Expected behavior
Semver version comparison has precedence over metadata version comparison.

Environment (please complete the following information):

  • Version-Checker: 0.8.0+
  • Kubernetes: 1.27.16
  • Grafana: 11.2.0
  • Prometheus: 2.54.1

Additional context
The root cause of the bug is here - there is metadata version comparison going on always if the current version is NOT less than the compared version. We should do metadata version comparison only if current semver and compared are equal.

@oGi4i oGi4i added the bug Something isn't working label Sep 22, 2024
@oGi4i oGi4i linked a pull request Sep 22, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants