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 (33)
📒 Files selected for processing (17)
🚧 Files skipped from review as they are similar to previous changes (16)
📝 WalkthroughWalkthroughAdds standalone GCP Persistent Disk CSI driver asset generation. The change introduces controller and node manifests, OpenShift host-network and node RBAC, CSI storage and snapshot resources, node volume patches, metrics port constants, driver generator configuration, and generator registration. Suggested reviewers: Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (2 errors, 2 warnings)
✅ Passed checks (11 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
| annotations: | ||
| storageclass.kubernetes.io/is-default-class: "true" | ||
| provisioner: pd.csi.storage.gke.io |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
Choose exactly one default StorageClass for the generated overlay.
Both manifests set storageclass.kubernetes.io/is-default-class: "true", making PVC provisioning without an explicit class order-dependent.
assets/overlays/gcp-pd/base/storageclass.yaml#L5-L7: remove the default annotation or retain it as the sole default.assets/overlays/gcp-pd/base/storageclass_hyperdisk_balanced.yaml#L5-L7: remove the default annotation or make this class mutually exclusive withstandard-csi.
📍 Affects 2 files
assets/overlays/gcp-pd/base/storageclass.yaml#L5-L7(this comment)assets/overlays/gcp-pd/base/storageclass_hyperdisk_balanced.yaml#L5-L7
🤖 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/storageclass.yaml` around lines 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.
| livenessProbe: | ||
| httpGet: | ||
| path: /healthz | ||
| port: healthz | ||
| initialDelaySeconds: 10 | ||
| timeoutSeconds: 3 | ||
| periodSeconds: 10 | ||
| failureThreshold: 5 |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
Add readiness probes for both driver containers.
Without readiness checks, Kubernetes can route CSI work before each driver is ready to serve its socket/health endpoint.
assets/overlays/gcp-pd/patches/controller_add_driver.yaml#L36-L43: add a readiness probe for the controller driver.assets/overlays/gcp-pd/patches/node_add_driver.yaml#L52-L59: add a readiness probe for the node driver.
As per path instructions, Kubernetes manifests require “Liveness + readiness probes defined.”
📍 Affects 2 files
assets/overlays/gcp-pd/patches/controller_add_driver.yaml#L36-L43(this comment)assets/overlays/gcp-pd/patches/node_add_driver.yaml#L52-L59
🤖 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/patches/controller_add_driver.yaml` around lines 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.
Source: Path instructions
| resources: | ||
| requests: | ||
| memory: 50Mi | ||
| cpu: 10m |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
Set CPU and memory limits for both driver containers.
Requests alone do not bound node resource consumption.
assets/overlays/gcp-pd/patches/controller_add_driver.yaml#L56-L59: add tuned CPU and memory limits.assets/overlays/gcp-pd/patches/node_add_driver.yaml#L60-L63: add tuned CPU and memory limits.
As per path instructions, Kubernetes manifests require resource limits on every container.
📍 Affects 2 files
assets/overlays/gcp-pd/patches/controller_add_driver.yaml#L56-L59(this comment)assets/overlays/gcp-pd/patches/node_add_driver.yaml#L60-L63
🤖 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/patches/controller_add_driver.yaml` around lines 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.
Source: Path instructions
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 ```
1d074fb to
43b0579
Compare
|
/hold to fix CI failures |
|
@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. |
https://redhat.atlassian.net/browse/STOR-2997
This PR consists of two commits: