STOR-2997: Auto generate assets for gcp pd csi driver - #585
Conversation
|
Pipeline controller notification For optional jobs, comment This repository is configured in: LGTM mode |
|
@mpatlasov: This pull request references STOR-2997 which is a valid jira issue. 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. |
|
/pipeline required |
|
Scheduling required tests: |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Central YAML (inherited) Review profile: CHILL Plan: Enterprise Run ID: ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (3)
💤 Files with no reviewable changes (1)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughAdds standalone GCP Persistent Disk CSI asset generation and registers it with the generator. The change introduces controller and node workload manifests, OpenShift host-network RBAC, CSI storage and snapshot resources, node volume patches, metrics ports, and refactored prerequisite loading through injected asset accessors with updated tests. Suggested reviewers: Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 error, 2 warnings)
✅ Passed checks (12 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mpatlasov The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (1)
assets/overlays/gcp-pd/base/hostnetwork_role.yaml (1)
4-4: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winUse asset-prefix variables for generated resource names.
These templates hard-code names derived from
gcp-pd, preventing consistent parameterized asset generation.
assets/overlays/gcp-pd/base/hostnetwork_role.yaml#L4-L4: use${ASSET_SHORT_PREFIX}for the role name.assets/overlays/gcp-pd/base/controller_hostnetwork_binding.yaml#L4-L11: use${ASSET_PREFIX}-controller-saand the parameterized role name.assets/overlays/gcp-pd/base/volumesnapshotclass.yaml#L3-L4: derive the snapshot-class name from${ASSET_SHORT_PREFIX}.assets/overlays/gcp-pd/base/volumesnapshotclass_images.yaml#L3-L4: derive the snapshot-class name from${ASSET_SHORT_PREFIX}.As per coding guidelines, asset templates must use
${ASSET_PREFIX}for full driver names and${ASSET_SHORT_PREFIX}for short names.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@assets/overlays/gcp-pd/base/hostnetwork_role.yaml` at line 4, Replace hard-coded gcp-pd-derived resource names with the appropriate asset-prefix variables: in assets/overlays/gcp-pd/base/hostnetwork_role.yaml:4 use ${ASSET_SHORT_PREFIX} for the role name; in assets/overlays/gcp-pd/base/controller_hostnetwork_binding.yaml:4-11 use ${ASSET_PREFIX}-controller-sa and the parameterized role name; and in assets/overlays/gcp-pd/base/volumesnapshotclass.yaml:3-4 and assets/overlays/gcp-pd/base/volumesnapshotclass_images.yaml:3-4 derive snapshot-class names from ${ASSET_SHORT_PREFIX}.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@assets/overlays/gcp-pd/base/storageclass.yaml`:
- Around line 5-7: Ensure exactly one generated StorageClass is marked default:
update assets/overlays/gcp-pd/base/storageclass.yaml lines 5-7 and
assets/overlays/gcp-pd/base/storageclass_hyperdisk_balanced.yaml lines 5-7 so
only one retains the storageclass.kubernetes.io/is-default-class annotation,
removing it from the other while preserving both StorageClass definitions.
In `@assets/overlays/gcp-pd/patches/controller_add_driver.yaml`:
- Around line 56-59: Set tuned CPU and memory limits alongside the existing
requests for both driver containers: update
assets/overlays/gcp-pd/patches/controller_add_driver.yaml lines 56-59 and
assets/overlays/gcp-pd/patches/node_add_driver.yaml lines 60-63. Ensure every
container’s resources includes both requests and limits.
- Around line 36-43: Add readinessProbe blocks for both driver containers,
matching the existing livenessProbe health endpoint and appropriate probe
settings: assets/overlays/gcp-pd/patches/controller_add_driver.yaml lines 36-43
and assets/overlays/gcp-pd/patches/node_add_driver.yaml lines 52-59. Ensure each
controller and node driver has both liveness and readiness probes targeting its
health endpoint.
---
Nitpick comments:
In `@assets/overlays/gcp-pd/base/hostnetwork_role.yaml`:
- Line 4: Replace hard-coded gcp-pd-derived resource names with the appropriate
asset-prefix variables: in assets/overlays/gcp-pd/base/hostnetwork_role.yaml:4
use ${ASSET_SHORT_PREFIX} for the role name; in
assets/overlays/gcp-pd/base/controller_hostnetwork_binding.yaml:4-11 use
${ASSET_PREFIX}-controller-sa and the parameterized role name; and in
assets/overlays/gcp-pd/base/volumesnapshotclass.yaml:3-4 and
assets/overlays/gcp-pd/base/volumesnapshotclass_images.yaml:3-4 derive
snapshot-class names from ${ASSET_SHORT_PREFIX}.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Central YAML (inherited)
Review profile: CHILL
Plan: Enterprise
Run ID: 6729c8e2-62a3-43cb-b234-9b48ba87249c
⛔ Files ignored due to path filters (33)
assets/overlays/gcp-pd/generated/standalone/cabundle_cm.yamlis excluded by!**/generated/**assets/overlays/gcp-pd/generated/standalone/controller.yamlis excluded by!**/generated/**assets/overlays/gcp-pd/generated/standalone/controller_hostnetwork_binding.yamlis excluded by!**/generated/**assets/overlays/gcp-pd/generated/standalone/controller_pdb.yamlis excluded by!**/generated/**assets/overlays/gcp-pd/generated/standalone/controller_sa.yamlis excluded by!**/generated/**assets/overlays/gcp-pd/generated/standalone/csidriver.yamlis excluded by!**/generated/**assets/overlays/gcp-pd/generated/standalone/hostnetwork_role.yamlis excluded by!**/generated/**assets/overlays/gcp-pd/generated/standalone/kube_rbac_proxy_binding.yamlis excluded by!**/generated/**assets/overlays/gcp-pd/generated/standalone/kube_rbac_proxy_role.yamlis excluded by!**/generated/**assets/overlays/gcp-pd/generated/standalone/lease_leader_election_binding.yamlis excluded by!**/generated/**assets/overlays/gcp-pd/generated/standalone/lease_leader_election_role.yamlis excluded by!**/generated/**assets/overlays/gcp-pd/generated/standalone/main_attacher_binding.yamlis excluded by!**/generated/**assets/overlays/gcp-pd/generated/standalone/main_provisioner_binding.yamlis excluded by!**/generated/**assets/overlays/gcp-pd/generated/standalone/main_resizer_binding.yamlis excluded by!**/generated/**assets/overlays/gcp-pd/generated/standalone/main_snapshotter_binding.yamlis excluded by!**/generated/**assets/overlays/gcp-pd/generated/standalone/manifests.yamlis excluded by!**/generated/**assets/overlays/gcp-pd/generated/standalone/node.yamlis excluded by!**/generated/**assets/overlays/gcp-pd/generated/standalone/node_privileged_binding.yamlis excluded by!**/generated/**assets/overlays/gcp-pd/generated/standalone/node_sa.yamlis excluded by!**/generated/**assets/overlays/gcp-pd/generated/standalone/privileged_role.yamlis excluded by!**/generated/**assets/overlays/gcp-pd/generated/standalone/prometheus_binding.yamlis excluded by!**/generated/**assets/overlays/gcp-pd/generated/standalone/prometheus_role.yamlis excluded by!**/generated/**assets/overlays/gcp-pd/generated/standalone/service.yamlis excluded by!**/generated/**assets/overlays/gcp-pd/generated/standalone/servicemonitor.yamlis excluded by!**/generated/**assets/overlays/gcp-pd/generated/standalone/storageclass.yamlis excluded by!**/generated/**assets/overlays/gcp-pd/generated/standalone/storageclass_hyperdisk_balanced.yamlis excluded by!**/generated/**assets/overlays/gcp-pd/generated/standalone/storageclass_reader_resizer_binding.yamlis excluded by!**/generated/**assets/overlays/gcp-pd/generated/standalone/storageclass_ssd.yamlis excluded by!**/generated/**assets/overlays/gcp-pd/generated/standalone/volumeattributesclass_reader_provisioner_binding.yamlis excluded by!**/generated/**assets/overlays/gcp-pd/generated/standalone/volumeattributesclass_reader_resizer_binding.yamlis excluded by!**/generated/**assets/overlays/gcp-pd/generated/standalone/volumesnapshot_reader_provisioner_binding.yamlis excluded by!**/generated/**assets/overlays/gcp-pd/generated/standalone/volumesnapshotclass.yamlis excluded by!**/generated/**assets/overlays/gcp-pd/generated/standalone/volumesnapshotclass_images.yamlis excluded by!**/generated/**
📒 Files selected for processing (17)
assets/overlays/gcp-pd/base/controller_hostnetwork_binding.yamlassets/overlays/gcp-pd/base/csidriver.yamlassets/overlays/gcp-pd/base/hostnetwork_role.yamlassets/overlays/gcp-pd/base/storageclass.yamlassets/overlays/gcp-pd/base/storageclass_hyperdisk_balanced.yamlassets/overlays/gcp-pd/base/storageclass_ssd.yamlassets/overlays/gcp-pd/base/volumesnapshotclass.yamlassets/overlays/gcp-pd/base/volumesnapshotclass_images.yamlassets/overlays/gcp-pd/patches/controller_add_driver.yamlassets/overlays/gcp-pd/patches/node_add_driver.yamlassets/overlays/gcp-pd/patches/node_remove_metrics_serving_cert.yamlassets/overlays/gcp-pd/patches/node_remove_sys_fs.yamlassets/overlays/gcp-pd/patches/privileged_role_get_nodes.yamlassets/overlays/gcp-pd/patches/privileged_role_get_nodes.yaml.patchcmd/generator/main.gopkg/driver/common/generator/port_registry.gopkg/driver/gcp-pd/gcp_pd.go
1d074fb to
43b0579
Compare
|
/hold to fix CI failures |
This commit contains everything needed for auto-generation of assets for GCP PD CSI driver operator.
This commit doesn't have any manual changes. It only updates assets in `assets/overlays/gcp-pd/generated/standalone/` by means of: ``` $ rm assets/overlays/gcp-pd/generated/standalone/* $ make update-generated-assets ```
The previous commit updated generated assets. Now assets apply earlier contain placeholders (like `namespace: ${NAMESPACE}` in controller_sa.yaml). We need real assetFunc with proper defualtReplacements to replace placeholders before applying assets.
43b0579 to
62aa26c
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
pkg/operator/prerequisites.go (1)
57-68: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick winReturn success when the final retry applies all remaining assets.
If the tenth attempt succeeds,
assetNamesbecomes empty but the loop ends before Line 29 can returnnil; Line 68 instead fails startup with an empty error list.Proposed fix
if len(errs) != 0 { klog.Warningf("Failed to apply some prerequisites: %v", errs) } + if len(assetNames) == 0 { + klog.Infof("All prerequisite assets are applied") + return nil + } if len(assetNames) != 0 { select {🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pkg/operator/prerequisites.go` around lines 57 - 68, Update the retry loop in the prerequisite application function so it returns nil when the final attempt leaves assetNames empty, before reaching the terminal fmt.Errorf return. Preserve the existing retry delay and context cancellation behavior for remaining assets, and keep the failure return for retries that still have unresolved prerequisites.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pkg/operator/prerequisites_test.go`:
- Around line 118-130: Copy tc.assetNames before passing it to the mutating
applyPrerequisites helper, while retaining the original table input for
verifyAppliedAssets. Update the test flow around applyPrerequisites and ensure
verification continues to use the unmodified expected asset list.
---
Outside diff comments:
In `@pkg/operator/prerequisites.go`:
- Around line 57-68: Update the retry loop in the prerequisite application
function so it returns nil when the final attempt leaves assetNames empty,
before reaching the terminal fmt.Errorf return. Preserve the existing retry
delay and context cancellation behavior for remaining assets, and keep the
failure return for retries that still have unresolved prerequisites.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Central YAML (inherited)
Review profile: CHILL
Plan: Enterprise
Run ID: 46da66a5-fe1d-4fc3-8370-2672a975c9e9
⛔ Files ignored due to path filters (33)
assets/overlays/gcp-pd/generated/standalone/cabundle_cm.yamlis excluded by!**/generated/**assets/overlays/gcp-pd/generated/standalone/controller.yamlis excluded by!**/generated/**assets/overlays/gcp-pd/generated/standalone/controller_hostnetwork_binding.yamlis excluded by!**/generated/**assets/overlays/gcp-pd/generated/standalone/controller_pdb.yamlis excluded by!**/generated/**assets/overlays/gcp-pd/generated/standalone/controller_sa.yamlis excluded by!**/generated/**assets/overlays/gcp-pd/generated/standalone/csidriver.yamlis excluded by!**/generated/**assets/overlays/gcp-pd/generated/standalone/hostnetwork_role.yamlis excluded by!**/generated/**assets/overlays/gcp-pd/generated/standalone/kube_rbac_proxy_binding.yamlis excluded by!**/generated/**assets/overlays/gcp-pd/generated/standalone/kube_rbac_proxy_role.yamlis excluded by!**/generated/**assets/overlays/gcp-pd/generated/standalone/lease_leader_election_binding.yamlis excluded by!**/generated/**assets/overlays/gcp-pd/generated/standalone/lease_leader_election_role.yamlis excluded by!**/generated/**assets/overlays/gcp-pd/generated/standalone/main_attacher_binding.yamlis excluded by!**/generated/**assets/overlays/gcp-pd/generated/standalone/main_provisioner_binding.yamlis excluded by!**/generated/**assets/overlays/gcp-pd/generated/standalone/main_resizer_binding.yamlis excluded by!**/generated/**assets/overlays/gcp-pd/generated/standalone/main_snapshotter_binding.yamlis excluded by!**/generated/**assets/overlays/gcp-pd/generated/standalone/manifests.yamlis excluded by!**/generated/**assets/overlays/gcp-pd/generated/standalone/node.yamlis excluded by!**/generated/**assets/overlays/gcp-pd/generated/standalone/node_privileged_binding.yamlis excluded by!**/generated/**assets/overlays/gcp-pd/generated/standalone/node_sa.yamlis excluded by!**/generated/**assets/overlays/gcp-pd/generated/standalone/privileged_role.yamlis excluded by!**/generated/**assets/overlays/gcp-pd/generated/standalone/prometheus_binding.yamlis excluded by!**/generated/**assets/overlays/gcp-pd/generated/standalone/prometheus_role.yamlis excluded by!**/generated/**assets/overlays/gcp-pd/generated/standalone/service.yamlis excluded by!**/generated/**assets/overlays/gcp-pd/generated/standalone/servicemonitor.yamlis excluded by!**/generated/**assets/overlays/gcp-pd/generated/standalone/storageclass.yamlis excluded by!**/generated/**assets/overlays/gcp-pd/generated/standalone/storageclass_hyperdisk_balanced.yamlis excluded by!**/generated/**assets/overlays/gcp-pd/generated/standalone/storageclass_reader_resizer_binding.yamlis excluded by!**/generated/**assets/overlays/gcp-pd/generated/standalone/storageclass_ssd.yamlis excluded by!**/generated/**assets/overlays/gcp-pd/generated/standalone/volumeattributesclass_reader_provisioner_binding.yamlis excluded by!**/generated/**assets/overlays/gcp-pd/generated/standalone/volumeattributesclass_reader_resizer_binding.yamlis excluded by!**/generated/**assets/overlays/gcp-pd/generated/standalone/volumesnapshot_reader_provisioner_binding.yamlis excluded by!**/generated/**assets/overlays/gcp-pd/generated/standalone/volumesnapshotclass.yamlis excluded by!**/generated/**assets/overlays/gcp-pd/generated/standalone/volumesnapshotclass_images.yamlis excluded by!**/generated/**
📒 Files selected for processing (20)
assets/overlays/gcp-pd/base/controller_hostnetwork_binding.yamlassets/overlays/gcp-pd/base/csidriver.yamlassets/overlays/gcp-pd/base/hostnetwork_role.yamlassets/overlays/gcp-pd/base/storageclass.yamlassets/overlays/gcp-pd/base/storageclass_hyperdisk_balanced.yamlassets/overlays/gcp-pd/base/storageclass_ssd.yamlassets/overlays/gcp-pd/base/volumesnapshotclass.yamlassets/overlays/gcp-pd/base/volumesnapshotclass_images.yamlassets/overlays/gcp-pd/patches/controller_add_driver.yamlassets/overlays/gcp-pd/patches/node_add_driver.yamlassets/overlays/gcp-pd/patches/node_remove_metrics_serving_cert.yamlassets/overlays/gcp-pd/patches/node_remove_sys_fs.yamlassets/overlays/gcp-pd/patches/privileged_role_get_nodes.yamlassets/overlays/gcp-pd/patches/privileged_role_get_nodes.yaml.patchcmd/generator/main.gopkg/driver/common/generator/port_registry.gopkg/driver/gcp-pd/gcp_pd.gopkg/operator/prerequisites.gopkg/operator/prerequisites_test.gopkg/operator/starter.go
🚧 Files skipped from review as they are similar to previous changes (15)
- assets/overlays/gcp-pd/patches/node_remove_sys_fs.yaml
- assets/overlays/gcp-pd/base/storageclass.yaml
- assets/overlays/gcp-pd/base/volumesnapshotclass.yaml
- assets/overlays/gcp-pd/base/hostnetwork_role.yaml
- assets/overlays/gcp-pd/patches/privileged_role_get_nodes.yaml.patch
- assets/overlays/gcp-pd/base/controller_hostnetwork_binding.yaml
- assets/overlays/gcp-pd/patches/privileged_role_get_nodes.yaml
- cmd/generator/main.go
- assets/overlays/gcp-pd/patches/node_remove_metrics_serving_cert.yaml
- assets/overlays/gcp-pd/base/storageclass_ssd.yaml
- assets/overlays/gcp-pd/base/volumesnapshotclass_images.yaml
- pkg/driver/common/generator/port_registry.go
- assets/overlays/gcp-pd/patches/controller_add_driver.yaml
- assets/overlays/gcp-pd/patches/node_add_driver.yaml
- pkg/driver/gcp-pd/gcp_pd.go
|
/unhold |
|
/retest-required |
|
/test e2e-gcp |
There was a problem hiding this comment.
I think this file is not used anywhere (but please double-check)
There was a problem hiding this comment.
This file is used in L133 of gcp_pd.go:
AssetPatches: commongenerator.DefaultGuestAssetPatches.WithPatches(generator.StandaloneOnly,
...
"privileged_role.yaml", "overlays/gcp-pd/patches/privileged_role_get_nodes.yaml.patch",
),
This is required because our generic assets/base/rbac/privileged_role.yaml doesn't have that get nodes rule.
There was a problem hiding this comment.
that's privileged_role_get_nodes.yaml.patch, not privileged_role_get_nodes.yaml
|
/test e2e-gcp-ovn-upgrade |
|
/assign |
|
@mpatlasov: The following tests 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. |
because it's in DefaultNodeAssets anyway.
…node DaemonSet This is bug-fix to the first commit in this PR. `legacy/gcp-pd-csi-driver-operator/assets/node.yaml` has those annotations for reason.
|
/pipeline required |
|
Scheduling required tests: Scheduling tests matching the |
|
/test e2e-gcp |
https://redhat.atlassian.net/browse/STOR-2997
This PR consists of two commits: