Allow using image names as selectors#172
Merged
yangcao77 merged 4 commits intodevfile:mainfrom May 15, 2023
Merged
Conversation
cc735ab to
8c044e3
Compare
a643206 to
84a90db
Compare
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #172 +/- ##
==========================================
+ Coverage 59.25% 59.62% +0.36%
==========================================
Files 40 41 +1
Lines 4926 5119 +193
==========================================
+ Hits 2919 3052 +133
- Misses 1832 1873 +41
- Partials 175 194 +19
☔ View full report in Codecov by Sentry. |
yangcao77
reviewed
May 8, 2023
164ec3d to
bc4cd5d
Compare
The goal of this field is to allow tools to provide information (currently registry and tag) allowing to replace matching image names. See [1] for more details. [1] devfile/api#985 Signed-off-by: Armel Soro <[email protected]>
… Kubernetes components This relies on the Docker Distribution library to parse image references in order to detect if they are absolute or relative. See [1] for more details about the proposal. [1] devfile/api#985 (comment) Signed-off-by: Armel Soro <[email protected]>
…file Users might actually be using variables for image names. Signed-off-by: Armel Soro <[email protected]>
It does not make sense to set a non-nil ParserArgs.ImageNamesAsSelector with no Registry in it Signed-off-by: Armel Soro <[email protected]>
bc4cd5d to
d32bcd6
Compare
yangcao77
approved these changes
May 10, 2023
Collaborator
yangcao77
left a comment
There was a problem hiding this comment.
changes look good to me
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: rm3l, yangcao77 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?:
This PR introduces a new
ImageNamesAsSelectorfield in the Devfile parser args. If this field is notnil, the parser will try to use image names from Image components as selectors in any matching Container or Kubernetes/OpenShift components.In this case, the parser will return a Devfile object where all matching image names have been replaced with the arguments provided in the parser args.
Replacement is done only on relative image names and the logic to check whether there is a match is based on the discussion in devfile/api#985 (comment).
This is needed by
odo(redhat-developer/odo#6565).Which issue(s) this PR fixes:
Fixes devfile/api#985
Fixes redhat-developer/odo#6676
PR acceptance criteria:
Testing and documentation do not need to be complete in order for this PR to be approved. We just need to ensure tracking issues are opened.
Unit/Functional tests
QE Integration test
Documentation
Client Impact
This is backward compatible, but the behavior of considering
imageNameas an image selector will need to be documented.Gosec scans
How to test changes / Special notes to the reviewer: