gateway icon indicating copy to clipboard operation
gateway copied to clipboard

chore(installation): early validate presence of tag in `image` and `imageRepository`

Open sudiptob2 opened this issue 5 months ago • 1 comments

PR https://github.com/envoyproxy/gateway/pull/6296 added support for customizing the EnvoyProxy image using the image and imageRepository fields. In summary:

  • If users want to explicitly specify the image tag, they should use the format: image: repo:tag. This has been the standard approach in all versions up to this PR.
  • If users prefer to define only the image repository and let Envoy Gateway decide the appropriate tag, they should use the format: imageRepository: repo_url.

To ensure these fields are used correctly, it's helpful to validate the presence or absence of a tag depending on which field is set.

This PR improves the resolveProxyImage function by adding the following validations:

  • If imageRepository is set, it must not include a tag.
  • If image is set, it must include a valid tag.

Idea for more validation logic is appreciated.

Fixes #6350

sudiptob2 avatar Jun 19 '25 03:06 sudiptob2

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 70.82%. Comparing base (9453572) to head (ba8b2f4). Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6354      +/-   ##
==========================================
- Coverage   70.82%   70.82%   -0.01%     
==========================================
  Files         220      220              
  Lines       37132    37132              
==========================================
- Hits        26300    26299       -1     
  Misses       9293     9293              
- Partials     1539     1540       +1     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

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

codecov[bot] avatar Jun 19 '25 03:06 codecov[bot]

can this be solved with CEL ? so the user hit this error during apply and won't have to find the error in logs

arkodg avatar Jun 21 '25 02:06 arkodg

can this be solved with CEL ? So the user hit this error during apply and won't have to find the error in logs

Updated with CEL validation

sudiptob2 avatar Jun 21 '25 19:06 sudiptob2

/retest

shawnh2 avatar Jun 24 '25 12:06 shawnh2

/retest

rudrakhp avatar Jun 24 '25 17:06 rudrakhp