Skip to content

Commit

Permalink
test: more debug output to find out what's wrong
Browse files Browse the repository at this point in the history
Signed-off-by: Lukas Wöhrl <[email protected]>
  • Loading branch information
woehrl01 committed Oct 22, 2024
1 parent fbf28db commit 034b69d
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 2 deletions.
6 changes: 6 additions & 0 deletions charts/aws-pca-issuer/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ disableApprovedCheck: false
# Maxium duration to retry fullfilling a CertificateRequest
maxRetryDuration: 180

# Optional secrets used for pulling the container image
#
# For example:
# imagePullSecrets:
# - name: secret-name
imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""
Expand Down Expand Up @@ -45,6 +50,7 @@ serviceMonitor:
create: false
annotations: {}

# Annotations to add to the issuer Pod
podAnnotations: {}

podSecurityContext:
Expand Down
16 changes: 16 additions & 0 deletions e2e/k8_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ func waitForIssuerReady(ctx context.Context, client *clientV1beta1.Client, name
return true, nil
}
}

fmt.Println("Issuer not ready yet - Current conditions:")
for _, condition := range issuer.Status.Conditions {
fmt.Printf("Type: %s, Status: %s, Reason: %s, Message: %s\n", condition.Type, condition.Status, condition.Reason, condition.Message)
}
return false, nil
})
}
Expand All @@ -52,6 +57,11 @@ func waitForClusterIssuerReady(ctx context.Context, client *clientV1beta1.Client
}
}

fmt.Println("ClusterIssuer not ready yet - Current conditions:")
for _, condition := range issuer.Status.Conditions {
fmt.Printf("Type: %s, Status: %s, Reason: %s, Message: %s\n", condition.Type, condition.Status, condition.Reason, condition.Message)
}

return false, nil
})
}
Expand All @@ -71,6 +81,12 @@ func waitForCertificateReady(ctx context.Context, client *cmclientv1.Certmanager
return true, nil
}
}

fmt.Println("Certifiate not ready yet - Current conditions:")
for _, condition := range certificate.Status.Conditions {
fmt.Printf("Type: %s, Status: %s, Reason: %s, Message: %s\n", condition.Type, condition.Status, condition.Reason, condition.Message)
}

return false, nil
})
}
3 changes: 3 additions & 0 deletions pkg/api/v1beta1/awspcaissuer_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ type AWSPCAIssuerStatus struct {
// ConditionTypeReady is the default condition type for the CRs
const ConditionTypeReady = "Ready"

// ConditionTypeIssuing is the condition type for the CRs when they are issuing a certificate
const ConditionTypeIssuing = "Issuing"

// +kubebuilder:object:root=true
// +kubebuilder:subresource:status

Expand Down
5 changes: 3 additions & 2 deletions pkg/controllers/certificaterequest_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,10 +227,11 @@ func (r *CertificateRequestReconciler) setStatusInternal(ctx context.Context, cr
}
r.Recorder.Event(cr, eventType, reason, completeMessage)

cmutil.SetCertificateRequestCondition(cr, api.ConditionTypeIssuing, status, reason, completeMessage)
if permanent {
cmutil.SetCertificateRequestCondition(cr, "Ready", status, reason, completeMessage)
r.Client.Status().Update(ctx, cr)
cmutil.SetCertificateRequestCondition(cr, api.ConditionTypeReady, status, reason, completeMessage)
}
r.Client.Status().Update(ctx, cr)

if reason == cmapi.CertificateRequestReasonFailed {
return fmt.Errorf(completeMessage)
Expand Down

0 comments on commit 034b69d

Please sign in to comment.