CONSOLE-5140: Hide Builds and ImageStreams nav items when Build capability is disabled#16613
Conversation
…ility is disabled
When the Build capability is disabled (baselineCapabilitySet: None), the
builds.build.openshift.io and buildconfigs.build.openshift.io APIs are not
present. However, the admin perspective Builds nav section was still visible
because:
1. The admin "Builds" section header only required the generic OPENSHIFT flag
(always true on OpenShift), not the Build-specific capability flag.
2. The "ImageStreams" nav item inside the Builds section had no flag guard,
and imagestreams.image.openshift.io APIs are always present on OpenShift
regardless of the Build capability state.
Fix:
- Add "flags": { "required": ["OPENSHIFT_BUILDCONFIG"] } to the admin
ImageStreams nav item so it is hidden when BuildConfig APIs are absent.
- Change the admin Builds section flag from OPENSHIFT to OPENSHIFT_BUILDCONFIG
so the section header itself is hidden when Build capability is disabled.
The Developer perspective Builds nav item already has the correct flag guard
("required": ["OPENSHIFT_BUILDCONFIG"]) and does not need to be changed.
Co-authored-by: Cursor <cursoragent@cursor.com>
|
@sampadasawant-36: This pull request references CONSOLE-5140 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "4.20.z" version, but no target version was set. DetailsIn response to this:
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. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository: openshift/coderabbit/.coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: sampadasawant-36 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @sampadasawant-36. Thanks for your PR. I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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. |
|
/ok-to-test |
|
@sampadasawant-36: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions 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. |
Fixes
https://issues.redhat.com/browse/CONSOLE-5140
Analysis / Root cause
On OCP 4.20.x with
baselineCapabilitySet: Noneand Build capability not enabled, the admin perspective Builds nav section remained visible because:Buildssection header (console.navigation/section) was gated only on"required": ["OPENSHIFT"]— alwaystrueon any OpenShift cluster regardless of Build capability state.imagestreams.image.openshift.ioAPIs are always present on OpenShift (independent of the Build capability), ImageStreams always appeared — keeping the section non-empty and visible.As a result, users on clusters with Build capability disabled see a Builds section in the admin nav containing only ImageStreams, with no BuildConfigs or Builds items (those are already correctly gated by
OPENSHIFT_BUILDCONFIG/OPENSHIFT_BUILDflags).The Developer perspective Builds nav item already has
"required": ["OPENSHIFT_BUILDCONFIG"]and does not need to be changed.Solution Description
"flags": { "required": ["OPENSHIFT_BUILDCONFIG"] }to the adminimagestreamsnav item inconsole-app/console-extensions.json, so it is hidden whenbuildconfigs.build.openshift.iois absent.buildssection flag from"required": ["OPENSHIFT"]to"required": ["OPENSHIFT_BUILDCONFIG"], so the entire Builds section header is also hidden when Build capability is disabled.Test setup
baselineCapabilitySet: Noneand Build capability not enabledoc api-resources | grep buildshows nobuildconfigs.build.openshift.io