Repository navigation
Update boilerplate - #285
Conversation
WalkthroughUpdates CI/build base images, adds a repository pre-commit configuration, replaces disabled Codecov status with explicit targets, and removes three user aliases from OWNERS_ALIASES. ChangesBuild Infrastructure Updates
Developer Tooling & Project Configuration
Ownership / Metadata
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 error, 1 inconclusive)
✅ Passed checks (10 passed)
✨ 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)
build/Dockerfile (1)
7-11:⚠️ Potential issue | 🟠 Major | ⚡ Quick winRun the runtime image as non-root.
The final stage still defaults to root. That weakens container isolation and fails common policy checks.
Proposed hardening diff
FROM registry.access.redhat.com/ubi9/ubi-minimal:9.7-1778461551 ENV OPERATOR_BIN=deadmanssnitch-operator WORKDIR /root/ COPY --from=builder /go/src/github.com/openshift/deadmanssnitch-operator/build/_output/bin/${OPERATOR_BIN} /usr/local/bin/${OPERATOR_BIN} +RUN chmod 0755 /usr/local/bin/${OPERATOR_BIN} +USER 1001 LABEL io.openshift.managed.name="deadmanssnitch-operator" \ io.openshift.managed.description="Operator to manage Dead Man Snitches"🤖 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 `@build/Dockerfile` around lines 7 - 11, The final image runs as root; update the Dockerfile to create and switch to a non-root user for runtime: create a dedicated user/group (e.g., "operator" or use UID/GID), ensure ownership of runtime assets (the binary at /usr/local/bin/${OPERATOR_BIN} and any WORKDIR) is set to that user, change WORKDIR from /root/ to a non-root directory owned by that user, and add a USER instruction so the container runs with non-root privileges; reference OPERATOR_BIN, WORKDIR, and the COPY target when making these changes.
🤖 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 `@build/Dockerfile`:
- Around line 7-11: The final image runs as root; update the Dockerfile to
create and switch to a non-root user for runtime: create a dedicated user/group
(e.g., "operator" or use UID/GID), ensure ownership of runtime assets (the
binary at /usr/local/bin/${OPERATOR_BIN} and any WORKDIR) is set to that user,
change WORKDIR from /root/ to a non-root directory owned by that user, and add a
USER instruction so the container runs with non-root privileges; reference
OPERATOR_BIN, WORKDIR, and the COPY target when making these changes.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: a19d0b64-0eec-4478-8d76-03c54b8b1ac0
⛔ Files ignored due to path filters (8)
boilerplate/_data/backing-image-tagis excluded by!boilerplate/**boilerplate/_data/last-boilerplate-commitis excluded by!boilerplate/**boilerplate/openshift/golang-osd-operator/.codecov.ymlis excluded by!boilerplate/**boilerplate/openshift/golang-osd-operator/OWNERS_ALIASESis excluded by!boilerplate/**boilerplate/openshift/golang-osd-operator/golangci.ymlis excluded by!boilerplate/**boilerplate/openshift/golang-osd-operator/pre-commit-config.yamlis excluded by!boilerplate/**boilerplate/openshift/golang-osd-operator/standard.mkis excluded by!boilerplate/**boilerplate/openshift/golang-osd-operator/updateis excluded by!boilerplate/**
📒 Files selected for processing (6)
.ci-operator.yaml.codecov.yml.pre-commit-config.yamlOWNERS_ALIASESbuild/Dockerfilebuild/Dockerfile.olm-registry
💤 Files with no reviewable changes (1)
- OWNERS_ALIASES
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #285 +/- ##
=======================================
Coverage 43.28% 43.28%
=======================================
Files 11 11
Lines 834 834
=======================================
Hits 361 361
Misses 424 424
Partials 49 49 🚀 New features to boost your workflow:
|
986082d to
ff793e8
Compare
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)
build/Dockerfile (1)
7-14:⚠️ Potential issue | 🟠 Major | ⚡ Quick winRun the final image as non-root (and stop using
/rootas workdir).The runtime stage still defaults to root because there is no
USERdirective, andWORKDIR /root/makes non-root execution harder. Please switch to a non-root user in the final stage.Suggested hardening diff
FROM registry.access.redhat.com/ubi9/ubi-minimal:9.7-1778461551 ENV OPERATOR_BIN=deadmanssnitch-operator -WORKDIR /root/ +WORKDIR /tmp COPY --from=builder /go/src/github.com/openshift/deadmanssnitch-operator/build/_output/bin/${OPERATOR_BIN} /usr/local/bin/${OPERATOR_BIN} +USER 1001 LABEL io.openshift.managed.name="deadmanssnitch-operator" \ io.openshift.managed.description="Operator to manage Dead Man Snitches"🤖 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 `@build/Dockerfile` around lines 7 - 14, The final Docker stage runs as root and uses WORKDIR /root/, so update the final stage to run as a non-root user: create a dedicated user/group (e.g., appuser), change WORKDIR from /root/ to a non-privileged directory (e.g., /opt/${OPERATOR_BIN} or /var/run/${OPERATOR_BIN}), COPY the built binary ${OPERATOR_BIN} into a location owned by that user and chown it, and add a USER directive to switch to that unprivileged user before runtime; ensure file permissions allow execution by that user and that any runtime directories referenced by OPERATOR_BIN are writable by the new user.
🤖 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 `@build/Dockerfile`:
- Around line 7-14: The final Docker stage runs as root and uses WORKDIR /root/,
so update the final stage to run as a non-root user: create a dedicated
user/group (e.g., appuser), change WORKDIR from /root/ to a non-privileged
directory (e.g., /opt/${OPERATOR_BIN} or /var/run/${OPERATOR_BIN}), COPY the
built binary ${OPERATOR_BIN} into a location owned by that user and chown it,
and add a USER directive to switch to that unprivileged user before runtime;
ensure file permissions allow execution by that user and that any runtime
directories referenced by OPERATOR_BIN are writable by the new user.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 3cf24e50-d11c-470f-8f98-2191e1ba2348
⛔ Files ignored due to path filters (8)
boilerplate/_data/backing-image-tagis excluded by!boilerplate/**boilerplate/_data/last-boilerplate-commitis excluded by!boilerplate/**boilerplate/openshift/golang-osd-operator/.codecov.ymlis excluded by!boilerplate/**boilerplate/openshift/golang-osd-operator/OWNERS_ALIASESis excluded by!boilerplate/**boilerplate/openshift/golang-osd-operator/golangci.ymlis excluded by!boilerplate/**boilerplate/openshift/golang-osd-operator/pre-commit-config.yamlis excluded by!boilerplate/**boilerplate/openshift/golang-osd-operator/standard.mkis excluded by!boilerplate/**boilerplate/openshift/golang-osd-operator/updateis excluded by!boilerplate/**
📒 Files selected for processing (6)
.ci-operator.yaml.codecov.yml.pre-commit-config.yamlOWNERS_ALIASESbuild/Dockerfilebuild/Dockerfile.olm-registry
💤 Files with no reviewable changes (1)
- OWNERS_ALIASES
✅ Files skipped from review due to trivial changes (2)
- .ci-operator.yaml
- build/Dockerfile.olm-registry
🚧 Files skipped from review as they are similar to previous changes (2)
- .codecov.yml
- .pre-commit-config.yaml
|
@abyrne55: 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. |
|
/lgtm |
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 kubernetes-sigs/prow repository. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: abyrne55, tnierman 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 |

Sync with latest boilerplate (61dbfdf)
Summary by CodeRabbit