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,
hence it needs to be ignored when looking for
CSR to be validated.
  • Loading branch information
mansikulkarni96 committed Oct 5, 2022
1 parent 14c47b9 commit bb755a3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/e2e/validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -665,6 +665,10 @@ func (tc *testContext) findNodeCSRs(nodeName string) ([]certificates.Certificate
return nil, errors.Wrap(err, "unable to get CSR list")
}
for _, c := range csrs.Items {
// skip the CSR if it's status has not been reported
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 bb755a3

Please sign in to comment.