-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow using image names as selectors #172
Allow using image names as selectors #172
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. |
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What does this PR do?:
This PR introduces a new
ImageNamesAsSelector
field 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
imageName
as an image selector will need to be documented.Gosec scans
How to test changes / Special notes to the reviewer: