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

Adds CertificateRequest FailureTime #1979

Merged
merged 8 commits into from
Aug 13, 2019

Conversation

JoshVanL
Copy link
Contributor

@JoshVanL JoshVanL commented Aug 12, 2019

Adds FailureTime to CertificateRequet Status.

Time set to now on the CertificateRequest if failed and the FailureTime is not currently set.

The Certificate controller will re-try CertificateRequests that have failed and have a FailureTime of at least one hour in the past. If the FailureTime is less than one hour, the Certificate is rescheduled for syncing in one hour.

Adds CertificateRequest FailureTime. The Certificate controller will re-try failed CertificateRequests at least one hour after this failed time.

/assign @munnerz

Signed-off-by: JoshVanL <vleeuwenjoshua@gmail.com>
FailureTime of the CertificateRequest status

Signed-off-by: JoshVanL <vleeuwenjoshua@gmail.com>
@jetstack-bot jetstack-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. labels Aug 12, 2019
@jetstack-bot jetstack-bot added area/api Indicates a PR directly modifies the 'pkg/apis' directory area/testing Issues relating to testing approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 12, 2019
Signed-off-by: JoshVanL <vleeuwenjoshua@gmail.com>
@jetstack-bot jetstack-bot added the area/deploy Indicates a PR modifies deployment configuration label Aug 12, 2019
defer func() {
if _, saveErr := c.updateCertificateRequestStatus(ctx, cr, crCopy); saveErr != nil {
err = utilerrors.NewAggregate([]error{saveErr, err})
}
}()

// If the CertificateRequest has the conditon 'Failed' then set the
// FailureTime to `c.clock.Now()`
defer c.setFailureTime(crCopy)
Copy link
Member

Choose a reason for hiding this comment

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

Instead of including this here, can we include it as part of the updateCertificateRequestStatus func?

Alternatively, if we simply set the FailureTime at the point where we set the reason to Failed, we can be sure that both are recorded at the same time anyway (i.e. in the Recorder).

Copy link
Member

Choose a reason for hiding this comment

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

(now that I've thought about it, the recorder probably is the most sensible place to set this.. not sure what you think?)

Signed-off-by: JoshVanL <vleeuwenjoshua@gmail.com>
@munnerz munnerz assigned JoshVanL and unassigned munnerz Aug 13, 2019
Signed-off-by: JoshVanL <vleeuwenjoshua@gmail.com>
Signed-off-by: JoshVanL <vleeuwenjoshua@gmail.com>
failed but < 1 hour

Signed-off-by: JoshVanL <vleeuwenjoshua@gmail.com>
@JoshVanL
Copy link
Contributor Author

/unassign
/assign @munnerz

@jetstack-bot jetstack-bot assigned munnerz and unassigned JoshVanL Aug 13, 2019
pkg/api/util/conditions.go Show resolved Hide resolved
pkg/controller/certificaterequests/sync.go Outdated Show resolved Hide resolved
pkg/controller/certificaterequests/sync_test.go Outdated Show resolved Hide resolved
pkg/controller/certificaterequests/sync_test.go Outdated Show resolved Hide resolved
pkg/controller/certificaterequests/util/reporter.go Outdated Show resolved Hide resolved
pkg/controller/certificates/certificate_request.go Outdated Show resolved Hide resolved
pkg/controller/certificates/certificate_request.go Outdated Show resolved Hide resolved
pkg/controller/certificates/certificate_request.go Outdated Show resolved Hide resolved
@jetstack-bot jetstack-bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 13, 2019
Signed-off-by: JoshVanL <vleeuwenjoshua@gmail.com>
Copy link
Member

@munnerz munnerz left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

// If pending condition not already set then fire a Pending Event. This is to
// reduce strain on the API server and avoid rate limiting ourselves for
// Event creation.
if !apiutil.CertificateRequestHasCondition(cr, cmapi.CertificateRequestCondition{
Copy link
Member

Choose a reason for hiding this comment

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

nit: we can use the new ReadyReason function you just added here to save some lines.. but not too important 😄

@jetstack-bot jetstack-bot added the lgtm Indicates that a PR is ready to be merged. label Aug 13, 2019
@jetstack-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JoshVanL, munnerz

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

@jetstack-bot jetstack-bot merged commit 0c56947 into cert-manager:master Aug 13, 2019
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. area/api Indicates a PR directly modifies the 'pkg/apis' directory area/deploy Indicates a PR modifies deployment configuration area/testing Issues relating to testing dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants