-
Notifications
You must be signed in to change notification settings - Fork 38
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
pipeline: add render predefined task func #545
Conversation
Signed-off-by: Xieql <[email protected]>
✅ Deploy Preview for kurator-dev canceled.
|
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.
I could not find some function definition
} | ||
|
||
var predefinedTaskTemplates = map[string]string{ | ||
GitCloneTask: GitCloneTaskContent, |
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.
where are these? A follow up?
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.
Yes, this is very useful for locating the actual pre-task tpl content to be used based on the user's task 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.
it will be used in
// RenderPredefinedTask takes a PredefinedTaskConfig object and generates YAML byte array configuration representing the PredefinedTask configuration.
func RenderPredefinedTask(cfg PredefinedTaskConfig) ([]byte, error) {
templateContent, ok := predefinedTaskTemplates[cfg.TemplateName]
if !ok {
return nil, fmt.Errorf("predefinedTask template content named '%s' not found", cfg.TemplateName)
}
return renderTemplate(templateContent, generateTaskTemplateName(cfg.TemplateName), cfg)
}
/label tide/merge-method-squash |
Signed-off-by: Xieql <[email protected]>
e7e89da
to
420f129
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: hzxuzhonghu 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 type of PR is this?
/kind feature
What this PR does / why we need it:
part of #493