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

Updates for Cert Manager #1129

Merged
merged 2 commits into from
Jul 13, 2021

Conversation

slaskawi
Copy link

https://issues.redhat.com/browse/AUTH-5

This Pull Request introduces CRD and Admission Registration types into the StaticResourceController

@openshift-ci openshift-ci bot requested review from hexfusion and soltysh July 12, 2021 13:57
@stlaz
Copy link
Member

stlaz commented Jul 13, 2021

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jul 13, 2021
@sttts
Copy link
Contributor

sttts commented Jul 13, 2021

/approve

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jul 13, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: slaskawi, stlaz, sttts

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 13, 2021
@openshift-merge-robot openshift-merge-robot merged commit 83bc2d0 into openshift:master Jul 13, 2021
if clients.kubeClient == nil {
result.Error = fmt.Errorf("missing kubeClient")
} else {
result.Result, result.Changed, result.Error = ApplyValidatingWebhookConfiguration(ctx, clients.kubeClient.AdmissionregistrationV1(), recorder, t, -1)
Copy link
Member

Choose a reason for hiding this comment

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

@slaskawi this -1 for expectedGeneration means that every time this function is called (i.e., during the static controller sync), the resource will be updated in the apiserver. Is that what we want?

Coincidentally I was working on this and I was thinking about this this to solve this issue:

https://github.com/openshift/library-go/compare/master...bertinatto:webhook-config-static?expand=1#

Copy link
Member

Choose a reason for hiding this comment

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

Also, I believe this won't work without registering the scheme in the init() function above.

CC @stlaz

Copy link
Author

Choose a reason for hiding this comment

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

Also, I believe this won't work without registering the scheme in the init() function above.

@bertinatto I believe you're right. Let me send an update in a few minutes.

this -1 for expectedGeneration means that every time this function is called (i.e., during the static controller sync), the resource will be updated in the apiserver. Is that what we want?

Coincidentally I was working on this and I was thinking about this this to solve this issue:

https://github.com/openshift/library-go/compare/master...bertinatto:webhook-config-static?expand=1#

Yes, I was aware of that. Unfortunately I couldn't come up with anything better.

So I decided to do a tradeoff here and always update the resource. Otherwise, a user could modify it and we would never revert his changes.

Perhaps @stlaz has a better idea how to solve this?

Copy link
Author

Choose a reason for hiding this comment

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

PR added: #1135

Copy link
Member

Choose a reason for hiding this comment

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

PR#1135 does not fixes the issue @bertinatto pointed out though right?

Copy link
Author

Choose a reason for hiding this comment

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

No. The code as it is now always updates performs an update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants