Skip to content

fix: tag CEL Function return correct tag when tag and digest are present#69

Open
lukeelten wants to merge 1 commit intokyverno:mainfrom
lukeelten:main
Open

fix: tag CEL Function return correct tag when tag and digest are present#69
lukeelten wants to merge 1 commit intokyverno:mainfrom
lukeelten:main

Conversation

@lukeelten
Copy link
Copy Markdown

@lukeelten lukeelten commented Mar 25, 2026

Explanation

This PR fixes a bug is the tag CEL function which returns an empty string when a tag and a digest are present.

Related issue

Fixes kyverno/kyverno#15273

Proposed Changes

The root issue can be found upstream in google/go-containerregistry#2069 but there has been no progress since more than a year.
To fix this issue, the edge case is detected in kyverno cel function and handled properly.
The special case can be removed when the bug has been fixed in upstream.

Checklist

  • I have read the contributing guidelines.
  • I have read the PR documentation guide and followed the process including adding proof manifests to this PR.
  • This is a bug fix and I have added unit tests that prove my fix is effective.

Further Comments

@lukeelten lukeelten changed the title tag CEL Function return correct tag when tag and digest are present bug: tag CEL Function return correct tag when tag and digest are present Mar 25, 2026
@realshuting realshuting self-requested a review March 25, 2026 16:29
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.58%. Comparing base (b97f888) to head (76b3f1c).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #69      +/-   ##
==========================================
+ Coverage   71.52%   71.58%   +0.05%     
==========================================
  Files          79       79              
  Lines        2381     2386       +5     
==========================================
+ Hits         1703     1708       +5     
  Misses        536      536              
  Partials      142      142              

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@lukeelten lukeelten changed the title bug: tag CEL Function return correct tag when tag and digest are present fix: tag CEL Function return correct tag when tag and digest are present Mar 25, 2026
Copy link
Copy Markdown
Member

@realshuting realshuting left a comment

Choose a reason for hiding this comment

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

Thanks @lukeelten for the contribution, this looks good overall!

Can you please address this semantic check issue?

@lukeelten lukeelten force-pushed the main branch 2 times, most recently from db4fdc9 to aeb70b3 Compare March 25, 2026 21:19
Signed-off-by: Tobias Derksen <t.derksen@mailbox.org>
@lukeelten
Copy link
Copy Markdown
Author

Hi @realshuting ,
I updated the commit message and signed the commit.

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.

[Bug] CEL image library does not find tag when digest is also in image name

3 participants