Skip to content

[sig-cluster-lifecycle] CSR approver test fails with 401 Unauthorized on ROSA STS clusters in 4.22+ #31163

@dustman9000

Description

@dustman9000

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-ovn
  • periodic-ci-openshift-release-main-nightly-4.23-e2e-rosa-sts-ovn
  • periodic-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):

  1. Creates a bogus CSR for system:node:hacking-node.ec2.internal
  2. Gets a bearer token for the node-bootstrapper SA in openshift-machine-config-operator via TokenRequest API
  3. Uses that token to create a CertificateSigningRequest
  4. 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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions