Skip to content

feat: Add Recommended Helm/K8s labels#2788

Merged
sozercan merged 13 commits into
masterfrom
unknown repository
Aug 1, 2023
Merged

feat: Add Recommended Helm/K8s labels#2788
sozercan merged 13 commits into
masterfrom
unknown repository

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost commented May 23, 2023

What this PR does / why we need it:
This PR adds in Helm and Kubernetes recommended labels, bringing gatekeeper in line with best practice.
See links for labelling info:
https://helm.sh/docs/chart_best_practices/labels/
https://kubernetes.io/docs/concepts/overview/working-with-objects/common-labels/#labels

Which issue(s) this PR fixes
Fixes #2774

@sozercan
Copy link
Copy Markdown
Member

sozercan commented May 24, 2023

@jbruce-nex you can revert all the changes to /charts. /manifest_staging/charts will be promoted to /charts when we cut a release. Thanks!

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 24, 2023

Codecov Report

Patch coverage has no change and project coverage change: +0.05% 🎉

Comparison is base (33efb28) 53.02% compared to head (1ab3618) 53.08%.
Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2788      +/-   ##
==========================================
+ Coverage   53.02%   53.08%   +0.05%     
==========================================
  Files         135      135              
  Lines       11790    11790              
==========================================
+ Hits         6252     6259       +7     
+ Misses       5050     5045       -5     
+ Partials      488      486       -2     
Flag Coverage Δ
unittests 53.08% <ø> (+0.05%) ⬆️

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

see 2 files with indirect coverage changes

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

@ghost
Copy link
Copy Markdown
Author

ghost commented May 25, 2023

@jbruce-nex you can revert all the changes to /charts. /manifest_staging/charts will be promoted to /charts when we cut a release. Thanks!

Hi @sozercan have updated to remove changes to the charts directory - cheers!

@sozercan
Copy link
Copy Markdown
Member

@jbruce-nex looks like helm build and upgrade tests are failing

@ritazh
Copy link
Copy Markdown
Member

ritazh commented May 30, 2023

From the error, unfortunately it looks like the change is not backward compatible.

upgrade.go:139: [debug] preparing upgrade for gatekeeper
Error: UPGRADE FAILED: template: gatekeeper/templates/upgrade-crds-hook.yaml:67:8: executing "gatekeeper/templates/upgrade-crds-hook.yaml" at <include "gatekeeper.mandatoryLabels" .>: error calling include: template: gatekeeper/templates/_helpers.tpl:47:9: executing "gatekeeper.mandatoryLabels" at <"gatekeeper.name">: can't give argument to non-function "gatekeeper.name"
helm.go:88: [debug] template: gatekeeper/templates/upgrade-crds-hook.yaml:67:8: executing "gatekeeper/templates/upgrade-crds-hook.yaml" at <include "gatekeeper.mandatoryLabels" .>: error calling include: template: gatekeeper/templates/_helpers.tpl:47:9: executing "gatekeeper.mandatoryLabels" at <"gatekeeper.name">: can't give argument to non-function "gatekeeper.name"

@ghost
Copy link
Copy Markdown
Author

ghost commented May 31, 2023

Apologies on the delay - I have updated the templates to hopefully resolve the issue that @ritazh has posted. There was an error on my part in the template helper files

anlandu and others added 10 commits May 31, 2023 09:43
Signed-off-by: Anlan Du <adu47249@gmail.com>
Co-authored-by: Sertaç Özercan <852750+sozercan@users.noreply.github.com>
Signed-off-by: James Bruce <james.bruce@ba.com>
Signed-off-by: James Bruce <james.bruce@ba.com>
Signed-off-by: James Bruce <james.bruce@ba.com>
Signed-off-by: James Bruce <james.bruce@ba.com>
Signed-off-by: James Bruce <james.bruce@ba.com>
This reverts commit 44dc224.

Signed-off-by: James Bruce <james.bruce@ba.com>
Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>
Signed-off-by: alex <8968914+acpana@users.noreply.github.com>
Co-authored-by: Rita Zhang <rita.z.zhang@gmail.com>
Signed-off-by: James Bruce <james.bruce@ba.com>
Signed-off-by: James Bruce <james.bruce@ba.com>
Signed-off-by: James Bruce <james.bruce@ba.com>
@stale
Copy link
Copy Markdown

stale Bot commented Aug 1, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

@stale stale Bot added the stale label Aug 1, 2023
@stale stale Bot removed the stale label Aug 1, 2023
Copy link
Copy Markdown
Member

@sozercan sozercan left a comment

Choose a reason for hiding this comment

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

Thanks for the PR and sorry about the delay! LGTM

@sozercan sozercan requested review from maxsmythe and ritazh August 1, 2023 19:57
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

@sozercan sozercan merged commit 738b3e2 into open-policy-agent:master Aug 1, 2023
@ghost ghost deleted the add_common_labels branch August 2, 2023 09:08
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.

Update resource labelling to reflect Helm/Kubernetes best practice

6 participants