Skip to content

Update prowgen when CSI is enabled#5018

Merged
openshift-merge-bot[bot] merged 4 commits intoopenshift:mainfrom
psalajova:prowgen-add-gsm-project-config
Mar 20, 2026
Merged

Update prowgen when CSI is enabled#5018
openshift-merge-bot[bot] merged 4 commits intoopenshift:mainfrom
psalajova:prowgen-add-gsm-project-config

Conversation

@psalajova
Copy link
Contributor

Updates prowgen with gsm-project-config arg (which ci-operator needs to successfully create GSM clients) and fixes missing enable-secrets-store-csi-driver=true flag in test.

@openshift-ci-robot
Copy link
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
Copy link

coderabbitai bot commented Mar 17, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 531f6280-9570-4eec-a593-18917a70456a

📥 Commits

Reviewing files that changed from the base of the PR and between 2c99cd8 and bd4bbeb.

📒 Files selected for processing (1)
  • pkg/steps/multi_stage/csi_utils_test.go

Walkthrough

Adds new GSM/CSI-related exported constants, wires a CSI credentials volume/mount into pod specs via a new BuildCSIVolume helper, removes duplicate explicit CSI arg additions in prow job builder, updates fixtures and CLI comment, and adds tests — no business logic changes beyond wiring and constants.

Changes

Cohort / File(s) Summary
Constants
pkg/api/constant.go
Adds GSM/CSI CLI and mount constants (GSMProjectConfigParameter, EnableCSIFlag, GSMCredentialsVolumeMount, GSMCredentialsMountPath, GSMCredentialsParameter, GSMCiOperatorSPCName) and re-formats existing GSM constants.
Podspec & Jobbase
pkg/prowgen/podspec.go, pkg/prowgen/jobbase.go
GSMConfig() now wires CSI credentials volume/mount and appends GSM CSI-related parameters; NewProwJobBaseBuilderForTest no longer redundantly adds an explicit enable-secrets-store-csi-driver arg in certain branches. Volume/mount ops now surface errors.
Test fixtures
pkg/prowgen/testdata/zz_fixture_TestGSMConfig_add_gsm_config_volume_and_mount.yaml, pkg/prowgen/testdata/zz_fixture_TestNewProwJobBaseBuilderForTest_multi_stage_test_with_CSI_enabled.yaml
Updated expected container args to include GSM project/credentials flags and added a read-only CSI volume gsm-sa-key plus /etc/gsm-credentials mount.
CSI helper & multi-stage usage
pkg/steps/multi_stage/csi_utils.go, pkg/steps/multi_stage/gen.go, pkg/steps/multi_stage/multi_stage.go
Adds exported BuildCSIVolume(name, spcName) coreapi.Volume which centralizes CSI Volume construction; replaces inline CSI volume creations with calls to this helper.
CSI helper tests
pkg/steps/multi_stage/csi_utils_test.go
Adds unit test TestBuildCSIVolume validating the constructed CSI volume has driver secrets-store.csi.k8s.io, ReadOnly: true, and secretProviderClass attribute.
CLI comment
cmd/ci-operator/main.go
Inserted a // Google Secret Manager flags comment above existing GSM-related flag registrations; no flag semantics changed.
Minor cleanup
pkg/gsm-validation/gsm.go
Removed an example comment from NormalizeName; no behavioral change.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
📝 Coding Plan
  • Generate coding plan for human review comments

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

Tip

CodeRabbit can approve the review once all CodeRabbit's comments are resolved.

Enable the reviews.request_changes_workflow setting to automatically approve the review once all CodeRabbit's comments are resolved.

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 17, 2026
@psalajova
Copy link
Contributor Author

/hold

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 17, 2026
@Prucek
Copy link
Member

Prucek commented Mar 17, 2026

this will be used by every ci-operator prowjob? We should think about using presets: #4994

@psalajova psalajova changed the title Update prowgen [WIP] Update prowgen Mar 18, 2026
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 18, 2026
@psalajova psalajova force-pushed the prowgen-add-gsm-project-config branch from 076202a to 2c99cd8 Compare March 20, 2026 09:45
@psalajova psalajova changed the title [WIP] Update prowgen Update prowgen when CSI is enabled Mar 20, 2026
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 20, 2026
@psalajova
Copy link
Contributor Author

@coderabbitai review

@coderabbitai
Copy link

coderabbitai bot commented Mar 20, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@psalajova
Copy link
Contributor Author

@Prucek re #5018 (comment) , Presets would be amazing here, but it looks like they won't be available for now, so until they are I added the volumes and other stuff as normal

@psalajova
Copy link
Contributor Author

/unhold

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 20, 2026
@danilo-gemoli
Copy link
Contributor

Do we have unit tests that cover the changes in these files?

pkg/steps/multi_stage/gen.go
pkg/steps/multi_stage/multi_stage.go

@psalajova
Copy link
Contributor Author

Do we have unit tests that cover the changes in these files?

pkg/steps/multi_stage/gen.go
pkg/steps/multi_stage/multi_stage.go

You are right, the prowgen fixtures test the end-to-end behavior but don't specifically test BuildCSIVolume() func... I'll add some unit test for that 👍

@psalajova
Copy link
Contributor Author

@danilo-gemoli Added the unit test (for TestBuildCSIVolume() func) in the latest commit. The changes are mainly just replacing the extra code with the BuildCSIVolume() func, and the correctness is also tested in pkg/steps/multi_stage/gen_test.go in TestAddCSICredentials test.

@danilo-gemoli
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Mar 20, 2026
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 20, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: danilo-gemoli, psalajova

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:
  • OWNERS [danilo-gemoli,psalajova]

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

@psalajova
Copy link
Contributor Author

/test e2e

@psalajova
Copy link
Contributor Author

/override ci/prow/images

@openshift-ci-robot
Copy link
Contributor

Tests from second stage were triggered manually. Pipeline can be controlled only manually, until HEAD changes. Use command to trigger second stage.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 20, 2026

@psalajova: Overrode contexts on behalf of psalajova: ci/prow/images

Details

In response to this:

/override ci/prow/images

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
Copy link
Contributor

openshift-ci bot commented Mar 20, 2026

@psalajova: 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/breaking-changes bd4bbeb link false /test breaking-changes

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.

@openshift-merge-bot openshift-merge-bot bot merged commit d98277b into openshift:main Mar 20, 2026
13 of 14 checks passed
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. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants