mirror of
https://github.com/onepanelio/onepanel.git
synced 2025-10-05 05:36:50 +08:00
fix: issue where nil param values caused dereference errors
This commit is contained in:
@@ -184,7 +184,7 @@ func injectContainerResourceQuotas(wf *wfv1.Workflow, template *wfv1.Template, s
|
||||
parts := strings.Split(strings.Replace(value, "}}", "", -1), ".")
|
||||
paramName := parts[len(parts)-1]
|
||||
for _, param := range wf.Spec.Arguments.Parameters {
|
||||
if param.Name == paramName {
|
||||
if param.Name == paramName && param.Value != nil {
|
||||
value = *param.Value
|
||||
break
|
||||
}
|
||||
|
@@ -18,9 +18,11 @@ func NewWorkflowTemplateServer() *WorkflowTemplateServer {
|
||||
}
|
||||
|
||||
func apiWorkflowTemplate(wft *v1.WorkflowTemplate) *api.WorkflowTemplate {
|
||||
|
||||
var aParams []*api.Parameter
|
||||
for _, p := range wft.Parameters {
|
||||
if p.Value == nil {
|
||||
continue
|
||||
}
|
||||
ap := api.Parameter{
|
||||
Name: p.Name,
|
||||
Value: *p.Value,
|
||||
|
Reference in New Issue
Block a user