-
Notifications
You must be signed in to change notification settings - Fork 65
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
Cert manager v1.3 - Approval Condition #30
Conversation
@@ -50,6 +55,55 @@ func (r *CertificateRequestController) Reconcile(req reconcile.Request) (reconci | |||
return reconcile.Result{}, nil | |||
} | |||
|
|||
// Ignore CertificateRequest if it is already Ready | |||
if cmutil.CertificateRequestHasCondition(cr, certmanager.CertificateRequestCondition{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have two questions:
- Since this code is now checking the Ready condition (and
cr.Status.FailureTime
), do I still need to check forcr.Status.Certificate
? I'm still drinking my morning coffee, but it seems to me thatReady==True
could only be possible ifcr.Status.Certificate
was set. - Does it make sense to move some or all of these checks into
cmutil
? Making one call into thecmutil
package seems better than chaining multiple together checks here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
We shouldn't have to, but we do anyway to make sure we cover any cases where another signer has behaved improperly. This makes the code as safe as possible.
-
Yes, we could think about moving these things to a chain in cert-manager utils. This would definitely help out with code duplication across projects. We would loose the specific logging for each case however.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The utility function could return an error with that detailed information, if it's found to be useful to logging. In the meantime, this is fine.
Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
e32c04b
to
ccfef49
Compare
Adds an options package to contain an options struct along with reasonable defaults.
…ests Added support for cert-manager's approved certificates feature, this controller will now wait for a certificate request to be approved before communicating with the Cloudflare API. Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com> [terinjokes@gmail.com: reworked to use options struct and pflag] Signed-off-by: Terin Stock <terinjokes@gmail.com>
ccfef49
to
fd3015b
Compare
@JoshVanL I've released v0.6.0. Should I open a PR to update the documentation site? |
In cert-manager v1.3, we introduced the approval mechanism. This PR adds an optional check, which is enabled by default, to wait for the presence of this Approval condition before signing.
This PR also adds RBAC which enables the internal cert-manager approver to approve all Origin CertificateRequests.
Once this is merged and released we can move this issuer to the list of approval honoured issuers here.
/assign @terinjokes