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

Make cleanup-leases security context configurable #587

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sirisaacnuketon
Copy link

Description of the change

The SecurityContext field for this job is currently static, however when deploying policy-controller into a namespace that uses Pod Security Admission controllers this job will not be able to run.

This adds a new field to the values file that operates in a manner similar to the securityContext option for the webhook deployment.

Existing or Associated Issue(s)

Additional Information

Checklist

  • Chart version bumped in Chart.yaml according to semver. Where applicable, update and bump the versions in any associated umbrella chart
  • Variables are documented in the values.yaml and added to the README.md. The helm-docs utility can be used to generate the necessary content. Use helm-docs --dry-run to preview the content.
  • JSON Schema generated.
  • List tests pass for Chart using the Chart Testing tool and the ct lint command.

@sirisaacnuketon sirisaacnuketon force-pushed the feat/configurableSecurityContext branch from 5ee062e to 9c0675c Compare August 11, 2023 09:49
@sirisaacnuketon sirisaacnuketon marked this pull request as ready for review August 11, 2023 09:50
Copy link
Member

@cpanato cpanato left a comment

Choose a reason for hiding this comment

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

need rebase
and need to add the possible or sample values for the security context in a comment in the values.yaml for users to know what they can use

@sirisaacnuketon sirisaacnuketon force-pushed the feat/configurableSecurityContext branch 2 times, most recently from c32ccd6 to de1e772 Compare August 14, 2023 09:17
@@ -25,6 +25,12 @@ spec:
- -c
- kubectl delete leases --all --ignore-not-found -n {{ .Release.Namespace }}
restartPolicy: OnFailure
{{- if .Values.leasescleanup.securityContext.enabled }}
Copy link
Member

Choose a reason for hiding this comment

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

you might dont need the enabled variable, just to check if the object exists should be fine

Copy link
Author

Choose a reason for hiding this comment

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

I was trying to conform to the style used elsewhere in the helm chart, I'm happy to change it however if consistency isn't as important

Copy link
Member

Choose a reason for hiding this comment

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

ok, sgtm to keep

@cpanato cpanato requested a review from hectorj2f August 14, 2023 09:55
@sirisaacnuketon sirisaacnuketon force-pushed the feat/configurableSecurityContext branch 2 times, most recently from 4125424 to 3269ce5 Compare August 14, 2023 10:48
hectorj2f
hectorj2f previously approved these changes Aug 18, 2023
Copy link
Contributor

@hectorj2f hectorj2f left a comment

Choose a reason for hiding this comment

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

LGTM overall, just few minor changes.

Copy link
Member

@cpanato cpanato left a comment

Choose a reason for hiding this comment

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

please update the code to check Hector's comments

thank you!

The SecurityContext field for this job is currently static, however when deploying policy-controller into a namespace that uses Pod Security Admission controllers this job will not be able to run.

Signed-off-by: Simon Witheridge <[email protected]>
@hectorj2f
Copy link
Contributor

hectorj2f commented Oct 5, 2023

@sirisaacnuketon Please, could you fix the conflicts?

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.

4 participants