-
Notifications
You must be signed in to change notification settings - Fork 151
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
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