Skip to content

fix: Ident podLabels on deployments#3153

Merged
ritazh merged 2 commits into
open-policy-agent:masterfrom
joaosilva15:fix_pod_labels
Nov 28, 2023
Merged

fix: Ident podLabels on deployments#3153
ritazh merged 2 commits into
open-policy-agent:masterfrom
joaosilva15:fix_pod_labels

Conversation

@joaosilva15
Copy link
Copy Markdown
Contributor

What this PR does / why we need it:
During this
change
the indentation was removed from the template but not added to the deployment manifest.

Which issue(s) this PR fixes (optional, using fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when the PR gets merged):
Fixes #3145

Special notes for your reviewer:

During [this
change](https://github.com/open-policy-agent/gatekeeper/pull/2788/files#diff-8418507fa48b71204028eeb671810c5e5c5e999cb23af3bbdceb06bc26bdc92dL39)
the indentation was removed from the template but not added to the
deployment manifest.

Signed-off-by: Joao Pedro Silva <jp.silva15@gmail.com>
Copy link
Copy Markdown
Contributor

@maxsmythe maxsmythe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@maxsmythe maxsmythe requested review from ritazh and sozercan November 6, 2023 23:43
Comment thread cmd/build/helmify/main.go

if kind == DeploymentKind {
obj = strings.Replace(obj, " labels:", " labels:\n{{- include \"gatekeeper.podLabels\" . }}", 1)
obj = strings.Replace(obj, " labels:", " labels:\n{{- include \"gatekeeper.podLabels\" . | nindent 8 }}", 1)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
obj = strings.Replace(obj, " labels:", " labels:\n{{- include \"gatekeeper.podLabels\" . | nindent 8 }}", 1)
obj = strings.Replace(obj, " labels:", " labels:\n {{- include \"gatekeeper.podLabels\" . | nindent 8 }}", 1)

based on #3145 (comment) isn't this missing here to fix the intendation of the templating var?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The indent is not needed as the function indents the whole block. You can test it on the template.
I believe the space would be removed by the - at the beginning of the template block so it will not change anything.

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (6276cb2) 53.73% compared to head (9357f5d) 53.78%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3153      +/-   ##
==========================================
+ Coverage   53.73%   53.78%   +0.04%     
==========================================
  Files         136      136              
  Lines       12198    12198              
==========================================
+ Hits         6555     6561       +6     
+ Misses       5140     5136       -4     
+ Partials      503      501       -2     
Flag Coverage Δ
unittests 53.78% <ø> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Copy Markdown
Member

@ritazh ritazh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@ritazh ritazh merged commit 5db70c1 into open-policy-agent:master Nov 28, 2023
@neilharris1
Copy link
Copy Markdown

when is this change likely to be included in a release?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Helm template with custom podLabels failes

6 participants