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

feat(helm): #471 - Expose rules and aggregateRule in ClusterRole #478

Merged
merged 2 commits into from
Apr 5, 2022

Conversation

mikesmithgh
Copy link
Collaborator

@mikesmithgh mikesmithgh commented Mar 21, 2022

#471 Is requesting to allow value overrides for ClusterRole rules. I also have a use case using aggregationRule so I have added them together in this PR.

@mikesmithgh
Copy link
Collaborator Author

Hi @grzesuav @AmitKumarDas , I am leaving this as a draft because I am thinking about adding tests for helm charts. I have used https://github.com/helm/chart-testing-action and think this would be a good addition to metacontroller repo. Thoughts?

@codecov
Copy link

codecov bot commented Mar 21, 2022

Codecov Report

Merging #478 (711a7bb) into master (4d1e2de) will not change coverage.
The diff coverage is n/a.

❗ Current head 711a7bb differs from pull request most recent head 9016719. Consider uploading reports for the commit 9016719 to get more accurate results

@@           Coverage Diff           @@
##           master     #478   +/-   ##
=======================================
  Coverage   49.27%   49.27%           
=======================================
  Files          56       56           
  Lines        4980     4980           
=======================================
  Hits         2454     2454           
  Misses       2275     2275           
  Partials      251      251           
Flag Coverage Δ
integration 43.12% <ø> (-0.11%) ⬇️
unit 28.31% <ø> (ø)

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


Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4d1e2de...9016719. Read the comment docs.

@grzesuav
Copy link
Contributor

@mjsmith1028 good idea. I thing what would be good is single "root" package (jsonnet/helm/anything else)which would be cusotmizable and allow creation two other kinds - helm charts and raw manifests. Need to do some research in that space.

@mikesmithgh mikesmithgh force-pushed the helm-rbac-improvements branch 12 times, most recently from 4cb4c72 to a242bd8 Compare March 24, 2022 19:56
needs: ['setmatrix']
strategy:
fail-fast: false
# TODO: ask about skipping CRD versions v1beta because it is not in helm chart
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hi @grzesuav , I have added the github action helm chart testing for this PR. This will check for changes in the chart. If changes are found, deploy a kind cluster and run helm lint/install. It will test all the value files under the deploy/helm/ci directory. I created a symlink for default_values.yaml to values.yaml to make sure the default values are tested. One thing I noticed, is currently the helm chart only includes the v1 CRD and not the previous v1beta CRD. As a result, I removed the v1beta version for kind clusters from this test.

I am thinking either we deprecate the older version for k8s or update the charts in a manner to support both (outside scope of this ticket). Thoughts?

Please let me know if you have any feedback. I will remove from draft to ready for review once this TODO is addressed.

Copy link
Contributor

Choose a reason for hiding this comment

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

hi, actually we can always run this test, as always at least metacontroller version in helm will change. Removing v1beta1 is ok, I need to fix other PR and set minimal version to 1.16, but will do it as breaking change

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Actually, referencing #485 I think I can conditionally add the CRD depending on the version of K8s. I'm going to give that a shot

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think you are able to template in the crds directory.
As far as I know this is only possible in the templates directory.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@roelvdberg Yep you are correct, I gave it a shot and no luck. Helm docs say the same. I started to look into using subcharts for the different CRD versions but it became unnecessarily complex. I will continue with ignoring k8s versions that do no support v1 in this PR because it does not break the existing setup. Thanks @grzesuav and @roelvdberg for feedback

@grzesuav
Copy link
Contributor

As I understand, currently the helmtest does linting and tries to install chart on kind cluster, right ? I think it is worth to always run this test, as i.e. metacontroller code can change with some runtime option, and we forget to update the chart. In this case I would like to catch this behaviour

@mikesmithgh
Copy link
Collaborator Author

As I understand, currently the helmtest does linting and tries to install chart on kind cluster, right ? I think it is worth to always run this test, as i.e. metacontroller code can change with some runtime option, and we forget to update the chart. In this case I would like to catch this behaviour

You are right, this makes sense. I can take off the conditional testing 👍

@mikesmithgh mikesmithgh force-pushed the helm-rbac-improvements branch from 74a0e5b to 4d02352 Compare April 1, 2022 14:28
@mikesmithgh mikesmithgh marked this pull request as ready for review April 1, 2022 14:53
@mikesmithgh
Copy link
Collaborator Author

Hi @grzesuav , this PR is ready for review and merge if you are comfortable. 👍

grzesuav
grzesuav previously approved these changes Apr 4, 2022
@grzesuav
Copy link
Contributor

grzesuav commented Apr 4, 2022

@mjsmith1028 can you rebase on latest master ? Cannot automatically merge

…usterRole

Signed-off-by: Mike Smith <10135646+mjsmith1028@users.noreply.github.com>
Signed-off-by: Mike Smith <10135646+mjsmith1028@users.noreply.github.com>
@mikesmithgh
Copy link
Collaborator Author

@mjsmith1028 can you rebase on latest master ? Cannot automatically merge

thanks @grzesuav , I just rebased :)

@grzesuav grzesuav merged commit 92bd0d7 into metacontroller:master Apr 5, 2022
@grzesuav
Copy link
Contributor

grzesuav commented Apr 5, 2022

🎉 This PR is included in version 2.5.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants