Skip to content

OCPBUGS-99047: Fix flaky oc adm storage-admin test#31400

Open
xueqzhan wants to merge 1 commit into
openshift:mainfrom
xueqzhan:flake-storage-cli
Open

OCPBUGS-99047: Fix flaky oc adm storage-admin test#31400
xueqzhan wants to merge 1 commit into
openshift:mainfrom
xueqzhan:flake-storage-cli

Conversation

@xueqzhan

@xueqzhan xueqzhan commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

The [sig-cli] oc adm storage-admin test fails intermittently when the parallel role-selectors test creates and deletes a ClusterRoleBinding bound to system:authenticated at the same time. During cleanup, there is a brief window where the ClusterRoleBinding still exists but its referenced ClusterRole has already been deleted. If oc auth can-i runs during this window, the RBAC authorizer appends a diagnostic message to the denial output (e.g. no - RBAC: clusterrole.rbac.authorization.k8s.io "basic-user2-pnjfn" not found), causing the HaveSuffix("no") assertion to fail.

Replace HaveSuffix("no") with MatchRegexp("(?m)^no") so the assertion matches no at the start of any line, tolerating both warning lines before and RBAC diagnostic text after. The exit code check on the preceding line continues to validate that the command returned non-zero (denied).

Summary by CodeRabbit

  • Bug Fixes
    • Improved validation of CLI authorization results for disallowed actions.
    • Ensured negative permission checks correctly recognize standalone “no” responses, including in project-scoped contexts.

@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

@openshift-ci-robot openshift-ci-robot added jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Jul 17, 2026
@openshift-ci-robot

Copy link
Copy Markdown

@xueqzhan: This pull request references Jira Issue OCPBUGS-99047, which is invalid:

  • expected the bug to target the "5.0.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

The [sig-cli] oc adm storage-admin test fails intermittently when the parallel role-selectors test creates and deletes a ClusterRoleBinding bound to system:authenticated at the same time. During cleanup, there is a brief window where the ClusterRoleBinding still exists but its referenced ClusterRole has already been deleted. If oc auth can-i runs during this window, the RBAC authorizer appends a diagnostic message to the denial output (e.g. no - RBAC: clusterrole.rbac.authorization.k8s.io "basic-user2-pnjfn" not found), causing the HaveSuffix("no") assertion to fail.

Replace HaveSuffix("no") with MatchRegexp("(?m)^no") so the assertion matches no at the start of any line, tolerating both warning lines before and RBAC diagnostic text after. The exit code check on the preceding line continues to validate that the command returned non-zero (denied).

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci
openshift-ci Bot requested review from deads2k and p0lyn0mial July 17, 2026 20:01
@openshift-ci

openshift-ci Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: xueqzhan

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

The pull request process is described 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-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 17, 2026
@coderabbitai

coderabbitai Bot commented Jul 17, 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: 85d5a233-dcd4-4264-a019-c4383b937b00

📥 Commits

Reviewing files that changed from the base of the PR and between 478b8a2 and 5759faf.

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

Walkthrough

The storage-admin CLI test now matches negative oc auth can-i results using a multiline regex that requires a line beginning with no, covering namespace, project, PVC, and project-scoped checks.

Changes

Storage-admin authorization assertions

Layer / File(s) Summary
Negative authorization assertions
test/extended/cli/admin.go
Updated four disallowed-action checks from suffix-based "no" assertions to multiline (?m)^no matches.

Estimated code review effort: 1 (Trivial) | ~2 minutes

🚥 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 accurately summarizes the main change: fixing a flaky oc adm storage-admin test.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 The PR only changes assertions in test bodies; no Ginkgo titles were added or edited, and existing titles are static strings.
Test Structure And Quality ✅ Passed PASS: The patch only relaxes the can-i denial matcher; the test still cleans up the created project and introduces no new structure, timeout, or resource-lifecycle issues.
Microshift Test Compatibility ✅ Passed PASS: no new Ginkgo test was added; the existing storage-admin test already has apigroup tags MicroShift skips, and only an assertion changed.
Single Node Openshift (Sno) Test Compatibility ✅ Passed No new Ginkgo test was added; the existing storage-admin test only changes can-i assertions and has no multi-node or HA assumptions.
Topology-Aware Scheduling Compatibility ✅ Passed Only a CLI test assertion changed in test/extended/cli/admin.go; no manifests, operators, controllers, or scheduling constraints were added.
Ote Binary Stdout Contract ✅ Passed Only Ginkgo It assertions changed in a test file; no main/init/TestMain or stdout writes were added.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed PR only changes HaveSuffix("no") to MatchRegexp("(?m)^no") in an existing test; no new Ginkgo blocks, IPv4 literals, or external connectivity were introduced.
No-Weak-Crypto ✅ Passed Patch only changes test assertions from HaveSuffix to MatchRegexp; no crypto APIs, weak algorithms, or secret comparisons were added.
Container-Privileges ✅ Passed PR only changes a Go test assertion in test/extended/cli/admin.go; no container/K8s manifests or privilege fields were modified.
No-Sensitive-Data-In-Logs ✅ Passed Only test assertions changed in test/extended/cli/admin.go; no new logs, secrets, tokens, PII, or host/customer data are introduced.
✨ 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 Jul 17, 2026
@xueqzhan

Copy link
Copy Markdown
Contributor Author

/jira refresh

@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Jul 17, 2026
@openshift-ci-robot

Copy link
Copy Markdown

@xueqzhan: This pull request references Jira Issue OCPBUGS-99047, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (5.0.0) matches configured target version for branch (5.0.0)
  • bug is in the state New, which is one of the valid states (NEW, ASSIGNED, POST)
Details

In response to this:

/jira refresh

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 openshift-eng/jira-lifecycle-plugin repository.

@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

@openshift-ci

openshift-ci Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

@xueqzhan: The following tests 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-gcp-ovn 5759faf link true /test e2e-gcp-ovn
ci/prow/e2e-aws-ovn-microshift 5759faf 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

approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. 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