-
Notifications
You must be signed in to change notification settings - Fork 250
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
use composite template's contributions path as fallback search for template inputs #1221
use composite template's contributions path as fallback search for template inputs #1221
Conversation
1264e91
to
0ed37d9
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #1221 +/- ##
==========================================
+ Coverage 53.79% 53.81% +0.02%
==========================================
Files 108 108
Lines 10368 10385 +17
==========================================
+ Hits 5577 5589 +12
- Misses 3809 3814 +5
Partials 982 982 ☔ View full report in Codecov by Sentry. |
a1c4f64
to
b29dedc
Compare
b29dedc
to
74571b1
Compare
Signed-off-by: Jordan Keister <jordan@nimblewidget.com>
74571b1
to
27ea513
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.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: everettraven, grokspawn 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 |
d924b76
into
operator-framework:master
Description of the change:
since using the composite template means the union of requirements from two parties, it can be confusing sometimes to understand the context of resource references.
For example, in the contribution schema
olm.composite
there are references to input filesystem elements inComponents[].Strategy.Template.Config.Input
(ref) but these may be relative or absolute references. And if relative... then relative to what?This PR attempts to address this by fallback searching for input references relative to the cwd of the contribution file (if driven by CLI) or the
Components[].Strategy.Template.Config.ContributionPath
(if provided).For example, given a contribution of the format
the template expansion will look for
semver-catalog-template.yaml
in the CWD of the executed command. But if the file is actually in acatalog-data
subdirectory but the command is executed in the parent, then it won't be solved, for e.g.The catalogs.yaml file which fulfills the
olm.composite.catalogs
spec may be local or remote, so it is unsuitable as a search location, but theolm.composite
source is always local, which allows us to infer a possible anchor point for relative references.In case a naiive access attempt for the specified contribution input file fails, we use the resulting anchor in a fallback attempt to resolve input references.
Motivation for the change:
Reviewer Checklist
/docs