Skip to content

ROX-23573: Violation 'Image tag' criteria should include image digest when tag is empty#19623

Open
charmik-redhat wants to merge 5 commits intomasterfrom
ROX-23573/update-violation-message-for-image-tag-when-it-is-empty
Open

ROX-23573: Violation 'Image tag' criteria should include image digest when tag is empty#19623
charmik-redhat wants to merge 5 commits intomasterfrom
ROX-23573/update-violation-message-for-image-tag-when-it-is-empty

Conversation

@charmik-redhat
Copy link
Copy Markdown
Contributor

@charmik-redhat charmik-redhat commented Mar 26, 2026

Description

Updates violation message for 'Image tag' criteria to be more clear and include image digest when the tag is empty.

User-facing documentation

  • CHANGELOG update is not needed
  • documentation is not needed

Testing and quality

  • the change is production ready: the change is GA, or otherwise the functionality is gated by a feature flag
  • CI results are inspected

Automated testing

  • added unit tests
  • added e2e tests
  • added regression tests
  • added compatibility tests
  • modified existing tests

How I validated my change

Manual test

Violation message from a test cluster

Container 'vbar-control-agent' has image with an empty tag, digest sha256:631a35b6cc0638b3eed328ccea240199043dcfe4bed69c7cfc3d98752faa23fb 

@openshift-ci
Copy link
Copy Markdown

openshift-ci bot commented Mar 26, 2026

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@charmik-redhat charmik-redhat marked this pull request as ready for review March 26, 2026 05:19
@charmik-redhat charmik-redhat requested a review from a team as a code owner March 26, 2026 05:19
@rhacs-bot
Copy link
Copy Markdown
Contributor

rhacs-bot commented Mar 26, 2026

Images are ready for the commit at b3e4845.

To use with deploy scripts, first export MAIN_IMAGE_TAG=4.11.x-478-gb3e4845dc0.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 26, 2026

Codecov Report

❌ Patch coverage is 0% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 49.37%. Comparing base (0737966) to head (b3e4845).

Files with missing lines Patch % Lines
...oleanpolicy/violationmessages/printer/container.go 0.00% 14 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master   #19623   +/-   ##
=======================================
  Coverage   49.37%   49.37%           
=======================================
  Files        2743     2743           
  Lines      207037   207049   +12     
=======================================
+ Hits       102223   102238   +15     
- Misses      97228    97229    +1     
+ Partials     7586     7582    -4     
Flag Coverage Δ
go-unit-tests 49.37% <0.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

@clickboo clickboo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comments, also you'll need to rebase to get rid of the Test Bundle failures to get CI green.

if err != nil {
return nil, err
}
if len(tagMessage) > 0 {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

imageDetails = append(imageDetails, tagMessage...) - which obviates the need for length check

Tag string
Digest string
}
tagFields := imageTagDetailFields{}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tagFields := imageTagDetailFields {
     Tag: imageTag,
     Digest: maybeGetSingleValueFromFieldMap(search.ImageSHA.String(), fieldMap)
}

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 27, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f2d1c051-6084-4b92-95ad-43f171d1ec75

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ROX-23573/update-violation-message-for-image-tag-when-it-is-empty

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@charmik-redhat charmik-redhat force-pushed the ROX-23573/update-violation-message-for-image-tag-when-it-is-empty branch from 3e54607 to b3e4845 Compare March 27, 2026 23:26
Tag: imageTag,
Digest: maybeGetSingleValueFromFieldMap(search.ImageSHA.String(), fieldMap),
}
tagFields.Tag = imageTag
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants