Skip to content

Fix check in auth test for 1.37 given new NamedAuthorizer behavior - #31574

Open
jacobsee wants to merge 1 commit into
openshift:mainfrom
jacobsee:handle-namedauthorizer-prefix
Open

Fix check in auth test for 1.37 given new NamedAuthorizer behavior#31574
jacobsee wants to merge 1 commit into
openshift:mainfrom
jacobsee:handle-namedauthorizer-prefix

Conversation

@jacobsee

@jacobsee jacobsee commented Aug 28, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • Bug Fixes
    • Updated authorization validation to correctly handle Kubernetes 1.37 denial messages.
    • Improved compatibility with authorization errors that include authorizer-name prefixes.

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: automatic mode

@coderabbitai

coderabbitai Bot commented Aug 28, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: ca0ff457-8a08-4301-bb3e-6d1ba4e8648b

📥 Commits

Reviewing files that changed from the base of the PR and between 686ada6 and 0a2343a.

📒 Files selected for processing (1)
  • test/extended/authorization/authorization.go

Included review availability: Your plan provides up to 12 included reviews per hour; 11 remain after this review.


Walkthrough

The authorization test now matches unsafe proxy denial paths and reasons separately. This supports Kubernetes 1.37 authorizer-name prefixes in denial messages.

Changes

Authorization test matching

Layer / File(s) Summary
Unsafe proxy error matching
test/extended/authorization/authorization.go
isUnsafeErr extracts the error message and checks the proxy resource path and unsafe-proxy reason independently.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 0a234

This is a localized authentication test adjustment with no actionable merge-blocking risk remaining after normal checks and review.

🚥 Pre-merge checks | ✅ 15
✅ Passed checks (15 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: updating the authorization test check for Kubernetes 1.37 due to new NamedAuthorizer behavior.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed PASS: The pull request changes only the isUnsafeErr error-matching logic and comments in test/extended/authorization/authorization.go. The Ginkgo titles are unchanged, and the affected titles use …
Test Structure And Quality ✅ Passed PASS: The pull request changes only the unsafe-error matcher in the existing TestBrowserSafeAuthorizer Ginkgo It block. The matcher now checks the expected resource path and unsafe-proxy reason se…
Microshift Test Compatibility ✅ Passed PASS: The pull request changes only the existing TestBrowserSafeAuthorizer error matcher. It adds no Ginkgo test. The test already has the [apigroup:user.openshift.io] tag, which protects it from …
Single Node Openshift (Sno) Test Compatibility ✅ Passed PASS: The PR does not add a new Ginkgo test. It only changes error matching in the existing TestBrowserSafeAuthorizer test. The test checks authorization for pod proxy requests and makes no multi-no…
Topology-Aware Scheduling Compatibility ✅ Passed PASS: The pull request changes only test/extended/authorization/authorization.go. It updates unsafe-proxy error matching by splitting resource-path and reason checks. It does not add or modify deplo…
Ote Binary Stdout Contract ✅ Passed PASS. The commit changes only test/extended/authorization/authorization.go. The changed code is inside the g.It(...) test body, which the check excludes. It only reads and matches `errProxy.Error(…
Ipv6 And Disconnected Network Test Compatibility ✅ Passed PASS: The pull request changes only error matching in an existing Ginkgo test. The diff adds no test declarations, IPv4 assumptions, IP parsing, URLs, or external connectivity. The test uses Kubernete…
No-Weak-Crypto ✅ Passed The pull request changes one authorization test file. The added code only splits matching of Kubernetes proxy denial text into two strings.Contains checks. It adds no MD5, SHA1, DES, 3DES, RC4, Blow…
Container-Privileges ✅ Passed PASS. The pull request changes only test/extended/authorization/authorization.go. The added lines update error-string matching for NamedAuthorizer behavior. They add no Kubernetes or container man…
No-Sensitive-Data-In-Logs ✅ Passed PASS. The pull request changes only error-string matching in test/extended/authorization/authorization.go. It adds msg := errProxy.Error() and strings.Contains checks for fixed Kubernetes resour…
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1 files.

Full details: Stable And Deterministic Test Names

Explanation

PASS: The pull request changes only the isUnsafeErr error-matching logic and comments in test/extended/authorization/authorization.go. The Ginkgo titles are unchanged, and the affected titles use static text such as TestBrowserSafeAuthorizer and should succeed [apigroup:user.openshift.io]. No dynamic test name was introduced.

Full details: Test Structure And Quality

Explanation

PASS: The pull request changes only the unsafe-error matcher in the existing TestBrowserSafeAuthorizer Ginkgo It block. The matcher now checks the expected resource path and unsafe-proxy reason separately, which supports the Kubernetes 1.37 authorizer prefix. It adds no new cluster operation, wait, resource setup, or assertion. The existing table remains focused on one proxy-authorization behavior, and its t.Errorf includes diagnostic details. The pre-existing user creation without cleanup and context.Background() request are unchanged by this pull request.

Full details: Microshift Test Compatibility

Explanation

PASS: The pull request changes only the existing TestBrowserSafeAuthorizer error matcher. It adds no Ginkgo test. The test already has the [apigroup:user.openshift.io] tag, which protects it from MicroShift because user.openshift.io is unavailable. The changed code only parses proxy authorization error text and adds no MicroShift-incompatible API or feature usage.

Full details: Single Node Openshift (Sno) Test Compatibility

Explanation

PASS: The PR does not add a new Ginkgo test. It only changes error matching in the existing TestBrowserSafeAuthorizer test. The test checks authorization for pod proxy requests and makes no multi-node or HA assumption. It does not require multiple nodes, distinct scheduling, failover, draining, scaling, or multiple endpoints.

Full details: Topology-Aware Scheduling Compatibility

Explanation

PASS: The pull request changes only test/extended/authorization/authorization.go. It updates unsafe-proxy error matching by splitting resource-path and reason checks. It does not add or modify deployment manifests, operator code, controllers, replicas, affinity, topology spread, node selectors, tolerations, or PDBs. The topology-aware scheduling check is therefore not applicable.

Full details: Ote Binary Stdout Contract

Explanation

PASS. The commit changes only test/extended/authorization/authorization.go. The changed code is inside the g.It(...) test body, which the check excludes. It only reads and matches errProxy.Error() with strings.Contains; it does not write to stdout. No fmt.Print*, log, klog, suite setup, or process-level output code was introduced.

Full details: Ipv6 And Disconnected Network Test Compatibility

Explanation

PASS: The pull request changes only error matching in an existing Ginkgo test. The diff adds no test declarations, IPv4 assumptions, IP parsing, URLs, or external connectivity. The test uses Kubernetes API clients and an in-cluster proxy path.

Full details: No-Weak-Crypto

Explanation

The pull request changes one authorization test file. The added code only splits matching of Kubernetes proxy denial text into two strings.Contains checks. It adds no MD5, SHA1, DES, 3DES, RC4, Blowfish, or ECB usage, no custom cryptography, and no comparison of secrets or tokens. The existing API-token test setup is unchanged.

Full details: Container-Privileges

Explanation

PASS. The pull request changes only test/extended/authorization/authorization.go. The added lines update error-string matching for NamedAuthorizer behavior. They add no Kubernetes or container manifest settings, and no added line contains privileged: true, hostPID, hostNetwork, hostIPC, SYS_ADMIN, allowPrivilegeEscalation: true, or root execution settings.

Full details: No-Sensitive-Data-In-Logs

Explanation

PASS. The pull request changes only error-string matching in test/extended/authorization/authorization.go. It adds msg := errProxy.Error() and strings.Contains checks for fixed Kubernetes resource and reason text. It adds no logging call and no sensitive data. The existing t.Errorf call that prints errProxy is unchanged, and the tested paths use fixed values such as ns, pods, and podX1:8080.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@openshift-ci openshift-ci Bot added the ready-for-human-review Indicates a PR has been reviewed by automated tools and is ready for human review label Aug 28, 2026
@openshift-ci
openshift-ci Bot requested review from everettraven and ibihim August 28, 2026 00:18
@openshift-ci

openshift-ci Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: jacobsee
Once this PR has been reviewed and has the lgtm label, please assign liouk for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Scheduling required tests:
/test e2e-aws-csi
/test e2e-aws-ovn-fips
/test e2e-aws-ovn-microshift
/test e2e-aws-ovn-microshift-serial
/test e2e-aws-ovn-serial-1of2
/test e2e-aws-ovn-serial-2of2
/test e2e-gcp-csi
/test e2e-gcp-ovn
/test e2e-gcp-ovn-upgrade
/test e2e-metal-ipi-ovn-ipv6
/test e2e-vsphere-ovn
/test e2e-vsphere-ovn-upi

@redhat-chai-bot

Copy link
Copy Markdown
Contributor

/override ci/prow/e2e-aws-ovn-microshift-serial

Automated triage: This failure appears unrelated to the PR changes.

Rationale: The job failed in the pre phase while installing MicroShift, before any conformance or authorization tests ran. dnf could not satisfy the MicroShift RPM requirement cri-o >= 1.36.0 and cri-o < 1.37.0: the available candidates were cri-o-5.0.0 and cri-o-1.35.x. The PR only changes authorization-test error-string matching in test/extended/authorization/authorization.go.

Evidence:

  • openshift-microshift-infra-rpm-install-aws failed with EXIT_CODE_RPM_INSTALL_FAILURE after three identical install attempts.
  • The sibling ci/prow/e2e-aws-ovn-microshift job failed at the same MicroShift RPM-install step with the same dependency conflict.
  • Unit, verify, lint, image, and dependency checks passed; the PR changes one authorization test file and does not modify MicroShift packaging or repository configuration.

If you disagree with this assessment, /retest ci/prow/e2e-aws-ovn-microshift-serial to re-run the job.


AI-generated. Review for accuracy.

@openshift-ci

openshift-ci Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

@redhat-chai-bot: Overrode contexts on behalf of redhat-chai-bot: ci/prow/e2e-aws-ovn-microshift-serial

Details

In response to this:

/override ci/prow/e2e-aws-ovn-microshift-serial

Automated triage: This failure appears unrelated to the PR changes.

Rationale: The job failed in the pre phase while installing MicroShift, before any conformance or authorization tests ran. dnf could not satisfy the MicroShift RPM requirement cri-o >= 1.36.0 and cri-o < 1.37.0: the available candidates were cri-o-5.0.0 and cri-o-1.35.x. The PR only changes authorization-test error-string matching in test/extended/authorization/authorization.go.

Evidence:

  • openshift-microshift-infra-rpm-install-aws failed with EXIT_CODE_RPM_INSTALL_FAILURE after three identical install attempts.
  • The sibling ci/prow/e2e-aws-ovn-microshift job failed at the same MicroShift RPM-install step with the same dependency conflict.
  • Unit, verify, lint, image, and dependency checks passed; the PR changes one authorization test file and does not modify MicroShift packaging or repository configuration.

If you disagree with this assessment, /retest ci/prow/e2e-aws-ovn-microshift-serial to re-run the job.


AI-generated. Review for accuracy.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@openshift-ci

openshift-ci Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

@jacobsee: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-aws-ovn-microshift 0a2343a link true /test e2e-aws-ovn-microshift

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human-review Indicates a PR has been reviewed by automated tools and is ready for human review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants