-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Helm: ensure valid label values when version has digest #8260
Conversation
./tools/diff_coverage.sh ../loki-target-branch/test_results.txt test_results.txt ingester,distributor,querier,querier/queryrange,iter,storage,chunkenc,logql,loki Change in test coverage per package. Green indicates 0 or positive change, red indicates that test coverage for a package fell. + ingester 0%
+ distributor 0%
+ querier 0%
+ querier/queryrange 0%
+ iter 0%
+ storage 0%
+ chunkenc 0%
+ logql 0%
+ loki 0% |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for bringing this up, nice find. 2 small questions regarding the implementation, but +1 to moving forward with this.
@@ -80,7 +80,7 @@ Common labels | |||
helm.sh/chart: {{ include "loki.chart" . }} | |||
{{ include "loki.selectorLabels" . }} | |||
{{- if or (.Chart.AppVersion) (.Values.loki.image.tag) }} | |||
app.kubernetes.io/version: {{ .Values.loki.image.tag | default .Chart.AppVersion | quote }} | |||
app.kubernetes.io/version: {{ (regexReplaceAllLiteral "@.*" (.Values.loki.image.tag | default .Chart.AppVersion) "") | quote }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 questions.
- should we replace it with a
:
instead of nothing so there's still a visible separator - we probably also want to enforce it's truncated to 63 characters?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your review @trevorwhitney.
As :
is not allowed, I've replaced it with -
. I've moved this to a new defined template "loki.validLabelValue"
. Back to you 🏓!
loki.image.tag=2.7.1@sha256:d69f377ecfdbb3f72086a180dcd7c2f02c795cf1867bbeb61606b42a8d41a55 leads to: app.kubernetes.io/version: "2.7.1-sha256-d69f377ecfdbb3f72086a180dcd7c2f02c795cf1867bbeb616" See https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#syntax-and-character-set
d4159dc
to
f38b0f1
Compare
./tools/diff_coverage.sh ../loki-target-branch/test_results.txt test_results.txt ingester,distributor,querier,querier/queryrange,iter,storage,chunkenc,logql,loki Change in test coverage per package. Green indicates 0 or positive change, red indicates that test coverage for a package fell. + ingester 0%
+ distributor 0%
+ querier 0%
+ querier/queryrange 0%
+ iter 0%
+ storage 0%
+ chunkenc 0%
+ logql 0%
+ loki 0% |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thanks for the contribution!
What this PR does / why we need it:
Fix this:
To ensure it is allowed, and leads to:
See https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#syntax-and-character-set
(see also https://gitlab.com/kubitus-project/kubitus-installer/-/jobs/3649809256)
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Checklist
CONTRIBUTING.md
guide (required)CHANGELOG.md
updateddocs/sources/upgrading/_index.md