[sig-cluster-lifecycle] CSR approver test fails with 401 Unauthorized on ROSA STS clusters in 4.22+
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 8.7k
- Forks
- 4.8k
- Avg merge
- 4d 10h
- Merged PRs (30d)
- 53
Description
Bug Report
The test [sig-cluster-lifecycle] CSRs from machines that are not recognized by the cloud provider are not approved fails with 401 Unauthorized on ROSA Classic STS clusters starting in OCP 4.22. The test passes on 4.21.
Affected Jobs
periodic-ci-openshift-release-main-nightly-4.22-e2e-rosa-sts-ovnperiodic-ci-openshift-release-main-nightly-4.23-e2e-rosa-sts-ovnperiodic-ci-openshift-release-main-nightly-5.0-e2e-rosa-sts-ovn
What the Test Does
The test (in test/extended/csrapprover/csrapprover.go, lines 93-155):
- Creates a bogus CSR for
system:node:hacking-node.ec2.internal - Gets a bearer token for the
node-bootstrapperSA inopenshift-machine-config-operatorvia TokenRequest API - Uses that token to create a CertificateSigningRequest
- Expects either success (then verifies it was not approved) or timeout
What Fails
Step 3 returns 401 Unauthorized at csrapprover.go:133. The node-bootstrapper SA token is rejected by the kube-apiserver on ROSA STS clusters in 4.22+.
Expected Behavior
The test should handle 401 Unauthorized as a valid "not approved" outcome, since a rejected token means the CSR can never be approved. The current code only expects success or timeout.
Suggested Fix
In csrapprover.go:133, accept 401 Unauthorized as a valid outcome alongside the existing success and timeout paths. The 401 indicates stricter SA token validation on STS clusters in 4.22, which is arguably correct behavior (the token is rejected before the CSR is even created).
Environment
- Platform: ROSA Classic STS (AWS)
- OCP versions affected: 4.22+
- OCP versions passing: 4.21
- The test does not exist in the 4.19 openshift-tests binary
/area test
/sig cluster-lifecycle
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in test/extended/csrapprover/csrapprover.go, especially lines 93-155 and the CSR creation at line 133. Review how the test currently handles successful creation and timeouts, then verify the affected CSR approver test treats a 401 response as the expected not-approved outcome. Done means the test no longer fails on the listed ROSA STS jobs while preserving existing behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- testing
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 88/100