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

Parametrize delete operations and timeout for webhook in helm chart #1051

Merged

Conversation

jonnylangefeld
Copy link
Contributor

The readme mentions how to enable delete operations by saying you should modify the yaml for the ValidatingWebhookConfiguration. However, there is no way to do this in the helm chart withough using your own fork.
This fix allows to overwrite the value if you use the helm chart as a dependency.

Additionally the webhook timeout was parametrized because in our organization we actually have a few clusters with slower response times.

Both changes are not breaking any existing integrations, they just allow to overwrite default values

@ritazh
Copy link
Member

ritazh commented Jan 6, 2021

Thanks for the PR @jonnylangefeld

Please update the yamls in the manifest_staging/ folder, where we host the staging charts and deployment yamls. All the yaml changes will then be promoted into the released charts folder with the next release. Please also add the new configurable values to the configuration table.

@jonnylangefeld jonnylangefeld force-pushed the jlf/parametrize-webhook branch 3 times, most recently from 93a81f7 to 34dec8e Compare January 6, 2021 20:22
@codecov-io
Copy link

codecov-io commented Jan 6, 2021

Codecov Report

Merging #1051 (ae52ff6) into master (c36b54c) will decrease coverage by 0.16%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1051      +/-   ##
==========================================
- Coverage   47.66%   47.50%   -0.17%     
==========================================
  Files          62       62              
  Lines        4225     4225              
==========================================
- Hits         2014     2007       -7     
- Misses       1956     1960       +4     
- Partials      255      258       +3     
Flag Coverage Δ
unittests 47.50% <ø> (-0.17%) ⬇️

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

Impacted Files Coverage Δ
...onstrainttemplate/constrainttemplate_controller.go 52.59% <0.00%> (-2.93%) ⬇️
pkg/readiness/ready_tracker.go 69.81% <0.00%> (+0.72%) ⬆️

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 c36b54c...ae52ff6. Read the comment docs.

@jonnylangefeld
Copy link
Contributor Author

@ritazh thanks for the review, I added the things you asked for.
Doe you have an ETA when we can expect this fix in a release?

| disableValidatingWebhook | Disable ValidatingWebhook | `false` |
| disableValidatingWebhook | Disable the validating webhook | `false` |
| validatingWebhookTimeoutSeconds | The timeout for the validating webhook in seconds | `3` |
| enableDeleteOperations | Enable validating webhook for delete operations | `false` |
Copy link
Member

@sozercan sozercan Jan 6, 2021

Choose a reason for hiding this comment

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

this change should only be in manifest_staging

README.md Outdated
@@ -475,6 +475,8 @@ Note: For admission webhooks registered for DELETE operations, use Kubernetes v1
- DELETE
```

If you use the helm chart, set `enableDeleteOperations=true`.
Copy link
Member

Choose a reason for hiding this comment

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

We should update readme after release is cut

Copy link
Contributor Author

Choose a reason for hiding this comment

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

will that happen automatically based on the readme in staging_docs?

@@ -31,10 +31,13 @@ webhooks:
operations:
- CREATE
- UPDATE
{{- if .Values.enableDeleteOperations }}
Copy link
Member

Choose a reason for hiding this comment

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

same here, you can revert any changes in charts

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Even though I don't fully understand (isn't there a discrepancy now between the chart in charts and in manifest_staging?), I have reverted all changes in charts.

Copy link
Member

Choose a reason for hiding this comment

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

when we cut a new release, everything existing in charts is wiped and manifest_staging/charts gets promoted to charts.

@jonnylangefeld
Copy link
Contributor Author

@sozercan @ritazh this PR doesn't touch the file reported in the code coverage report constrainttemplate_controller.go. How come that's blocking due to dropped test coverage?

The readme mentions how to [enable delete operations](https://github.com/open-policy-agent/gatekeeper\#enable-delete-operations) by saying you should modify the yaml for the ValidatingWebhookConfiguration. However, there is no way to do this in the helm chart withough using your own fork.
This fix allows to overwrite the value if you use the helm chart as a dependency.

Additionally the webhook timeout was parametrized because in our organization we actually have a few clusters with slower response times.

Both changes are not breaking any existing integrations, they just allow to overwrite default values

Signed-off-by: Jonny Langefeld <jonny.langefeld@gmail.com>
Signed-off-by: Jonny Langefeld <jonny.langefeld@gmail.com>
Signed-off-by: Jonny Langefeld <jonny.langefeld@gmail.com>
@ritazh ritazh requested a review from a team January 7, 2021 22:46
Copy link
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 e68a39e into open-policy-agent:master Jan 12, 2021
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.

5 participants