Skip to content

Support for defaulting of CR fields via mutating admission webhooks #1218

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

Closed
raffaelespazzoli opened this issue Mar 17, 2019 · 7 comments
Closed
Labels
kind/feature Categorizes issue or PR as related to a new feature. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.

Comments

@raffaelespazzoli
Copy link
Contributor

Feature Request

Some CRs need a way to set some fields to default values.
Please add a facility to the operator-sdk to manage this situation. From a developer perspective a stub field defaulting method should be generated and the developer needs to fill it up. Requesting the generation the generation of this method should be optional for the operator-sdk generate controller command

Is your feature request related to a problem? Please describe.
As I said some CRs require defaulting of fields, as of now every developer of an operator has to come up with its own solution.

Describe the solution you'd like
I believe there are multiple ways to implement this, but perhaps the most kubernetes-pure would be via a MutatingAdmissionController. The generated operator could provide a http endpoint to listen for these MutatingAdmissionController webhook calls. Regardless the user experience should be the one defined above.

@joelanford joelanford added the kind/feature Categorizes issue or PR as related to a new feature. label Mar 20, 2019
@hasbro17
Copy link
Contributor

As discussed in #1217 (comment) we'll be using the upstream controller-runtime APIs for mutating admission webhooks.
Example:
https://github.com/kubernetes-sigs/controller-runtime/blob/5e3a6da770e2f16f8ce9b0905eaa74974fe7a4c0/examples/builtins/mutatingwebhook.go

We just need to add the scaffolding,docs and examples.

@hasbro17 hasbro17 changed the title support for defaulting of CR fields Support for defaulting of CR fields via mutating admission webhooks Mar 25, 2019
@openshift-bot
Copy link

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@openshift-ci-robot openshift-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jun 24, 2019
@hasbro17
Copy link
Contributor

/remove-lifecycle stale

@openshift-ci-robot openshift-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jun 24, 2019
@openshift-bot
Copy link

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@openshift-ci-robot openshift-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Sep 22, 2019
@openshift-bot
Copy link

Stale issues rot after 30d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle rotten
/remove-lifecycle stale

@openshift-ci-robot openshift-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Oct 22, 2019
@openshift-bot
Copy link

Rotten issues close after 30d of inactivity.

Reopen the issue by commenting /reopen.
Mark the issue as fresh by commenting /remove-lifecycle rotten.
Exclude this issue from closing again by commenting /lifecycle frozen.

/close

@openshift-ci-robot
Copy link

@openshift-bot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity.

Reopen the issue by commenting /reopen.
Mark the issue as fresh by commenting /remove-lifecycle rotten.
Exclude this issue from closing again by commenting /lifecycle frozen.

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.
Projects
None yet
Development

No branches or pull requests

5 participants