Skip to content

Commit

Permalink
Fix CSR validation failure for missing status
Browse files Browse the repository at this point in the history
This commit aims to fix the issue with failing
CSR validation of CSR that have a missing
status condition.
In some cases, a CSR is left in pending state when a
new CSR is created for a node too quickly before
updating the status of the existing one.
Such a CSR cannot be approved but it does not affect
node configuration and is safe to be ignored.
  • Loading branch information
mansikulkarni96 committed Oct 5, 2022
1 parent 01499ac commit 3685963
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/e2e/validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -665,6 +665,13 @@ func (tc *testContext) findNodeCSRs(nodeName string) ([]certificates.Certificate
return nil, errors.Wrap(err, "unable to get CSR list")
}
for _, c := range csrs.Items {
// In some cases, a CSR is left in pending state when a new CSR is created
// for a node too quickly before updating the status of the existing one.
// Such a CSR cannot be approved but it does not affect node configuration
// and is safe to be ignored.
if c.Status.Conditions == nil || len(c.Status.Conditions) == 0 {
continue
}
parsedCSR, err := csr.ParseCSR(c.Spec.Request)
if err != nil {
return nil, err
Expand Down

0 comments on commit 3685963

Please sign in to comment.