Update approver controller to use new Denied condition type
Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
This commit is contained in:
parent
4e042011e6
commit
09f91a2a99
@ -83,8 +83,8 @@ func TestProcessItem(t *testing.T) {
|
||||
Status: cmapi.CertificateRequestStatus{
|
||||
Conditions: []cmapi.CertificateRequestCondition{
|
||||
{
|
||||
Type: cmapi.CertificateRequestConditionApproved,
|
||||
Status: cmmeta.ConditionFalse,
|
||||
Type: cmapi.CertificateRequestConditionDenied,
|
||||
Status: cmmeta.ConditionTrue,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@ -33,18 +33,18 @@ const (
|
||||
)
|
||||
|
||||
// Sync will set the "Approved" condition to True on synced
|
||||
// CertificateRequests. If the "Denied", "Approved" or "Ready" condition alrady
|
||||
// exists, exit early.
|
||||
// CertificateRequests. If the "Denied", "Approved" or "Ready" condition
|
||||
// already exists, exit early.
|
||||
func (c *Controller) Sync(ctx context.Context, cr *cmapi.CertificateRequest) (err error) {
|
||||
log := logf.FromContext(ctx, "approver")
|
||||
|
||||
switch {
|
||||
case
|
||||
// If the CertificateRequest has already been approved, exit early.
|
||||
apiutil.CertificateRequestHasApproved(cr),
|
||||
apiutil.CertificateRequestIsApproved(cr),
|
||||
|
||||
// If the CertificateRequest has already been denied, exit early.
|
||||
apiutil.CertificateRequestHasDenied(cr),
|
||||
apiutil.CertificateRequestIsDenied(cr),
|
||||
|
||||
// If the CertificateRequest is "Issued" or "Failed", exit early.
|
||||
apiutil.CertificateRequestReadyReason(cr) == cmapi.CertificateRequestReasonFailed,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user