Log rox-ci-image digest in stackrox prow steps#77727
Log rox-ci-image digest in stackrox prow steps#77727davdhacs wants to merge 2 commits intoopenshift:mainfrom
Conversation
Add image digest logging to begin, e2e-test, and end steps so each step's log shows which rox-ci-image build is running. Uses kubectl to query the pod's imageID, falling back to CRI-O's /run/.containerenv. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: davdhacs 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 |
WalkthroughThe change adds startup logging to a shell script that outputs the container image identifier. It attempts to retrieve the image ID via kubectl, falls back to reading a local environment file if kubectl fails, and defaults to "unknown" if both attempts fail. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes 🚥 Pre-merge checks | ✅ 10✅ Passed checks (10 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@ci-operator/step-registry/stackrox/stackrox/begin/stackrox-stackrox-begin-commands.sh`:
- Around line 5-7: The kubectl lookup can return an empty string with exit code
0, so replace the inline fallback chain using "kubectl get pod \"$HOSTNAME\" -o
jsonpath='{.status.containerStatuses[0].imageID}' || grep '^imageid='
/run/.containerenv || echo \"unknown\"" with a robust sequence that captures the
kubectl output into a variable (e.g., image=$(kubectl get pod ... 2>/dev/null ||
true)), if [ -z "$image" ] then try the grep fallback (image=$(grep '^imageid='
/run/.containerenv 2>/dev/null || true)); if still empty set image="unknown";
finally printf that variable. Apply the same change to the other identical
blocks that use the same kubectl jsonpath + grep fallback.
🪄 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: openshift/coderabbit/.coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: b1921e90-5392-480b-8d64-ec85e11fb85a
📒 Files selected for processing (3)
ci-operator/step-registry/stackrox/stackrox/begin/stackrox-stackrox-begin-commands.shci-operator/step-registry/stackrox/stackrox/e2e-test/stackrox-stackrox-e2e-test-commands.shci-operator/step-registry/stackrox/stackrox/end/stackrox-stackrox-end-commands.sh
ci-operator/step-registry/stackrox/stackrox/begin/stackrox-stackrox-begin-commands.sh
Show resolved
Hide resolved
Move image digest logging to begin step only (not e2e-test/end). Add cat of /i-am-rox-ci-image for future metadata/SBOM content. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
[REHEARSALNOTIFIER]
A total of 317 jobs have been affected by this change. The above listing is non-exhaustive and limited to 25 jobs. A full list of affected jobs can be found here Interacting with pj-rehearseComment: Once you are satisfied with the results of the rehearsals, comment: |
|
/cc @tommartensen |
|
@davdhacs: 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. |
|
Do you have a rehearse job where I can see that |
Summary
kubectl get podto query the container's imageID, falls back to CRI-O's/run/.containerenvstableorlatest🤖 Generated with Claude Code
Summary by CodeRabbit