-
Notifications
You must be signed in to change notification settings - Fork 160
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
Implement template rendering action #1364
Implement template rendering action #1364
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## feature-operator-refactor #1364 +/- ##
============================================================
Coverage ? 26.68%
============================================================
Files ? 55
Lines ? 4455
Branches ? 0
============================================================
Hits ? 1189
Misses ? 3125
Partials ? 141 ☔ View full report in Codecov by Sentry. |
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
var buffer bytes.Buffer | ||
|
||
for i := range rr.Templates { | ||
content, err := fs.ReadFile(rr.Templates[i].FS, rr.Templates[i].Path) |
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.
the pat only accept file name not the folder name, not for this PR, but we will need extend it a bit later if we have multiple templates
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.
if you have multiple templates, the you can pass multiple paths, I didn't want to make it over complicated at this stage given we have only a few templates.
But yeah, it would probably be useful. I'll have a look for a follow up PR
pkg/controller/actions/render/template/action_render_templates.go
Outdated
Show resolved
Hide resolved
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
/retest |
name: default | ||
namespace: {{.DSCI.Spec.ApplicationsNamespace}} | ||
annotations: | ||
instance-name: {{.Component.Name}} |
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.
@zdtsw renamed Instance -> Component
as it sounds better
name: {{.SMM.Name}} | ||
namespace: {{.DSCI.Spec.ApplicationsNamespace}} | ||
annotations: | ||
instance-name: {{.Component.Name}} |
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.
@zdtsw renamed Instance -> Component
as it sounds better
/retest |
1 similar comment
/retest |
4b28fa5
to
45a5623
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: grdryn, zdtsw 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 |
acd89b8
into
opendatahub-io:feature-operator-refactor
// | ||
// and use the scheme as discriminator for the rendering engine | ||
// | ||
Templates []TemplateInfo |
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.
If I'm not mistaken, it looks like there is difference between Manifests and Templates. Manifests belong to ReconciliationRequest due to substitution via devFlags. But Templates are statically provided and the location can be configured on Action creation.
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.
Not for every component, so as an example, for kserve, the inclusion of templates depends on some configuration options (serveless, servicemesh, etc)
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.
Ok, I looked in more details and reconsidered.
Resources are like "context" for the pipeline, output for template or kustomize renderings and input for deploy.
With dynamic template data computation #1527 Templates serve the same for preparing configuration and input for template rendering action (so, putting them together as in comment does not sound needed).
Without that, like in existing proposal #1521, every config creation action can directly call template rendering to contribute to the Resources.
May be makes sense to put a comment before that fields that it's "Request processing Context". Well, again, if I'm not mistaken.
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.
make sense, I'll add some more context
…flux/component-updates/odh-ml-pipelines-launcher-v2-17 chore(deps): update odh-ml-pipelines-launcher-v2-17 to 8afafa3
Description
This PR introduces a new rendering engine that is based on the go text/template package.
The template is rendered to the actual objects taking a subset of the
ReconciliationRequest
struct:Instance
andDSCI
so as an example, theServiceMeshMember
template that is part of the model registry component would looks like:https://issues.redhat.com/browse/RHOAIENG-15534
How Has This Been Tested?
ServiceMeshMember
instance in the model registries namespace nameddefault
and that it contains the expected valuesScreenshot or short clip
Merge criteria