STOR-2996: Sync gcp pd csi driver operator to legacy subdir#570
Conversation
….af203c699 af203c699 Merge pull request openshift#190 from openshift-bot/art-consistency-openshift-5.0-ose-gcp-pd-csi-driver-operator 55f736869 Merge pull request openshift#192 from rvagner78/ocpbugs-87867 416e704d3 OCPBUGS-86574: VolumeSnapshot snapshot-c9v52 is not ready within 5m0s (on GCP) 15033bfa9 Updating ose-gcp-pd-csi-driver-operator-container image to be consistent with ART for 5.0 Reconciling with https://github.com/openshift-eng/ocp-build-data/tree/7691ed4dc0b6585b358f9e73fb736ace9a48a286/images/ose-gcp-pd-csi-driver-operator.yml git-subtree-dir: legacy/gcp-pd-csi-driver-operator git-subtree-split: af203c69941c7c78503e67947db679ae6e147ebd
…6-Sync-GCP-PD-CSI-driver-operator-to-legacy-subdir
…e.gcp-pd The commit 'c517f0c1d3a0f4e45c1c1e8721f20fb2616ae2c3' updated Dockerfile.openshift in legacy/gcp-pd-csi-driver-operator subdir. This commit updates Dockerfile.gcp-pd accordingly.
|
@mpatlasov: This pull request references STOR-2996 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. |
📝 WalkthroughWalkthroughThree Dockerfiles and a CI configuration file are updated to replace Go 1.25 / OpenShift 4.22 base images with Go 1.26 / OpenShift 5.0 equivalents: 🚥 Pre-merge checks | ✅ 15✅ Passed checks (15 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
Dockerfile.gcp-pd (1)
1-10: 🔒 Security & Privacy | 🟠 MajorAdd USER directive to run operator as non-root user.
All CSI operator Dockerfiles (including Dockerfile.gcp-pd) lack a USER directive and run as root by default. The gcp-pd-csi-driver-operator binary does not require root privileges—it only manages Kubernetes resources via the CSI operator controller framework. The base image (ocp/5.0:base-rhel9) does not provide a non-root user by default; it is the developer's responsibility to define one.
Add a USER directive before the ENTRYPOINT to run as a non-root user (e.g.,
USER 65534:65534for thenobodyuser, or create a custom unprivileged UID). This aligns with the coding guideline requirement "USER non-root; never run as root" and is a security best practice for OpenShift operators.🤖 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 `@Dockerfile.gcp-pd` around lines 1 - 10, The Dockerfile.gcp-pd currently lacks a USER directive and runs as root by default, which is a security risk. Add a USER directive before the ENTRYPOINT line to run the gcp-pd-csi-driver-operator binary as a non-root user. Since the base image ocp/5.0:base-rhel9 does not provide a non-root user by default, use USER 65534:65534 to run as the nobody user, or create a custom unprivileged UID if preferred. This ensures the operator follows the security best practice of running as non-root.Source: Path instructions
🤖 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.
Outside diff comments:
In `@Dockerfile.gcp-pd`:
- Around line 1-10: The Dockerfile.gcp-pd currently lacks a USER directive and
runs as root by default, which is a security risk. Add a USER directive before
the ENTRYPOINT line to run the gcp-pd-csi-driver-operator binary as a non-root
user. Since the base image ocp/5.0:base-rhel9 does not provide a non-root user
by default, use USER 65534:65534 to run as the nobody user, or create a custom
unprivileged UID if preferred. This ensures the operator follows the security
best practice of running as non-root.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Central YAML (inherited)
Review profile: CHILL
Plan: Enterprise
Run ID: f9f95a1f-62c0-4fd8-97b0-583622b23d57
📒 Files selected for processing (4)
Dockerfile.gcp-pdlegacy/gcp-pd-csi-driver-operator/.ci-operator.yamllegacy/gcp-pd-csi-driver-operator/Dockerfile.openshiftlegacy/gcp-pd-csi-driver-operator/test/e2e/manifest.yaml
|
/retest-required |
|
/test e2e-azure |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jsafrane, 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 |
|
/verified by @mpatlasov |
|
@mpatlasov: This PR has been marked as verified by 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. |
|
@mpatlasov: all tests passed! 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. |
Since PR#562 (which populated legacy/gcp-pd-csi-driver-operator) two PRs merged in openshift/gcp-pd-csi-driver-operator:
This PR brings corresponding commits to csi-operator repo by command:
After that, the PR adds one manual change on the top sync-ing legacy/gcp-pd-csi-driver-operator/Dockerfile.openshift into root Dockerfile.gcp-pd.
https://redhat.atlassian.net/browse/STOR-2996