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

Add security context at pod and container level for Kanister operator #3075

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

anishbista60
Copy link
Contributor

@anishbista60 anishbista60 commented Aug 29, 2024

Change Overview

Expose securityContext on kanister-operator deployment to improve security

Pull request type

Please check the type of change your PR introduces:

  • 🚧 Work in Progress
  • 🌈 Refactoring (no functional changes, no api changes)
  • 🐹 Trivial/Minor
  • 🐛 Bugfix
  • 🌻 Feature
  • 🗺️ Documentation
  • 🤖 Test
  • 🏗️ Build

Issues

Test Plan

  • 💪 Manual
  • ⚡ Unit test
  • Run make helm-test to verify that helm chart is working fine.
  • 💚 E2E

@anishbista60
Copy link
Contributor Author

anishbista60 commented Aug 30, 2024

@pavannd1 @hairyhum could you please look at this PR ?

@julio-lopez julio-lopez changed the title Added the security context at pod and container level for Kainster operator Add security context at pod and container level for Kanister operator Sep 5, 2024
@anishbista60
Copy link
Contributor Author

@julio-lopez please test it .

@anishbista60
Copy link
Contributor Author

@viveksinghggits could you please look into this PR sir ?

@viveksinghggits
Copy link
Contributor

viveksinghggits commented Sep 11, 2024

@viveksinghggits could you please look into this PR sir ?

Can you please add the test plan. We have a helm test written here pkg/testing/helm_test.go. Let's improve that to verify this change as well.

Also, you don't have to say sir, just Vivek is fine.

@viveksinghggits
Copy link
Contributor

@julio-lopez please test it .

Usually when someone raises a PR it's their responsibility to add proper test plan and get help to test the changes. Like suggested above, let's add some tests and we can try to merge.

@anishbista60
Copy link
Contributor Author

@viveksinghggits could you please look into this PR sir ?

Can you please add the test plan. We have a helm test written here pkg/testing/helm_test.go. Let's improve that to verify this change as well.

Also, you don't have to say sir, just Vivek is fine.

yes sure. Thank you

@anishbista60 anishbista60 force-pushed the security-context branch 3 times, most recently from 57f61ca to 9d9ccd1 Compare September 13, 2024 06:57
@anishbista60
Copy link
Contributor Author

@viveksinghggits could you please take a look ?

helm/kanister-operator/templates/deployment.yaml Outdated Show resolved Hide resolved
helm/kanister-operator/values.yaml Outdated Show resolved Hide resolved
pkg/testing/helm/helm_test.go Outdated Show resolved Hide resolved
@anishbista60
Copy link
Contributor Author

@viveksinghggits Thanks for your review. I think now it's look fine according to your recommendation.
please let me know if any changes is needed.

@anishbista60 anishbista60 force-pushed the security-context branch 2 times, most recently from 1ff8179 to 3aeb47d Compare September 22, 2024 02:23
helm/kanister-operator/values.yaml Outdated Show resolved Hide resolved
Comment on lines 64 to 67
{{- if .Values.controller.containerSecurityContext }}
securityContext:
{{ toYaml .Values.controller.containerSecurityContext | indent 10 }}
{{- end }}
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's create a function is _helpers.tpl and use that at both the places for containers. We can do the same for deployment as well.

Copy link
Contributor

Choose a reason for hiding this comment

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

@anishbista60 I see you have resolved this comment, but I don't see the changes for the deployment security context.

Copy link
Contributor Author

@anishbista60 anishbista60 Sep 26, 2024

Choose a reason for hiding this comment

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

@viveksinghggits I did it .

helm/kanister-operator/values.yaml Outdated Show resolved Hide resolved
@anishbista60 anishbista60 force-pushed the security-context branch 2 times, most recently from f06c4b4 to d207e06 Compare September 26, 2024 11:49
@anishbista60
Copy link
Contributor Author

@viveksinghggits shall i go for removing that 2nd and 3 rd test cases ?

Copy link
Contributor

@viveksinghggits viveksinghggits left a comment

Choose a reason for hiding this comment

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

@anishbista60 so where we commit/push files to github, we should have a newline at the end of the file. It's general feedback for the files in this PR. Can you please make sure that they are committed properly so that they have the new line at the end.

helm/kanister-operator/values.yaml Outdated Show resolved Hide resolved
@anishbista60
Copy link
Contributor Author

anishbista60 commented Sep 26, 2024

now , i think looks good . Could you please reply on above in unresolved review ?

@julio-lopez julio-lopez requested review from hairyhum and julio-lopez and removed request for julio-lopez September 27, 2024 03:10
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.

Expose securityContext on kanister-operator deployment to improve security
4 participants