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

Cert manager v1.3 - Approval Condition #30

Merged
merged 3 commits into from
May 10, 2021

Conversation

JoshVanL
Copy link
Contributor

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

@terinjokes terinjokes self-assigned this Apr 22, 2021
@@ -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{
Copy link
Contributor

Choose a reason for hiding this comment

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

I have two questions:

  1. Since this code is now checking the Ready condition (and cr.Status.FailureTime), do I still need to check for cr.Status.Certificate? I'm still drinking my morning coffee, but it seems to me that Ready==True could only be possible if cr.Status.Certificate was set.
  2. Does it make sense to move some or all of these checks into cmutil? Making one call into the cmutil package seems better than chaining multiple together checks here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  1. 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.

  2. 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.

Copy link
Contributor

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>
terinjokes and others added 2 commits April 29, 2021 16:50
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>
@terinjokes terinjokes merged commit fd3015b into cloudflare:trunk May 10, 2021
@terinjokes
Copy link
Contributor

@JoshVanL I've released v0.6.0. Should I open a PR to update the documentation site?

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.

4 participants