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

fix: 🐛 hub version not handling main builds #1326

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion traefik/templates/requirements.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,14 @@
{{ fail "When using Traefik Hub image tag needs to be specified !" }}
{{- end -}}

{{ $hubVersion := (split "@" (default "v3" $.Values.image.tag))._0 | replace "latest-" "" }}
{{ $hubVersion := (split "@" (default "v3" $.Values.image.tag))._0 }}

{{/*
Consider non semver versions as latest one
*/}}
{{- if not (regexMatch "v[0-9]+.[0-9]+.[0-9]+" (default "" $.Values.image.tag)) -}}
{{ $hubVersion = "v3.99" }}
{{- end }}

{{- if and (semverCompare "<v3.9.0" $hubVersion) .Values.hub.tracing.additionalTraceHeaders.enabled }}
{{ fail "ERROR: additionalTraceHeaders is a feature only available for traefik-hub >= v3.9.0."}}
Expand Down
16 changes: 16 additions & 0 deletions traefik/tests/requirements-config_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -180,3 +180,19 @@ tests:
asserts:
- failedTemplate:
errorMessage: "ERROR: additionalTraceHeaders needs tracing.otlp to be enabled."
- it: should not fail when using hub.tracing.additionalTraceHeaders on Traefik Hub main builds
set:
image:
registry: "ghcr.io"
repository: "traefik/traefik-hub"
tag: main-1af57d3-1737730202
tracing:
otlp:
enabled: true
hub:
token: "xxx"
tracing:
additionalTraceHeaders:
enabled: true
asserts:
- notFailedTemplate: {}
darkweaver87 marked this conversation as resolved.
Show resolved Hide resolved
Loading