-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Error: runtime error: invalid memory address or nil pointer dereference (3.3.8) #9269
Comments
arguments:
will be Unmarshaled as:
there is no validation if argo-workflows/workflow/validate/validate.go Line 754 in 06b0a8c
|
But shouldn't the error be more explanatory :). I didn't submit this issue because it's unsupported, but the error is not clear enough that it isn't supported. In fact it throws a "nil pointer". Which is bad :). |
@Siebjee agree with you. maybe we can do validation in func |
@smile-luobin Do you like to submit the PR? |
To fix this, modify this block of code From:
To: for _, param := range executionParameters.Parameters {
if param.ValueFrom != nil && param.ValueFrom.ConfigMapKeyRef != nil {
cmValue, err := common.GetConfigMapValue(woc.controller.configMapInformer, woc.wf.ObjectMeta.Namespace, param.ValueFrom.ConfigMapKeyRef.Name, param.ValueFrom.ConfigMapKeyRef.Key)
if err != nil {
return fmt.Errorf("failed to set global parameter %s from configmap with name %s and key %s: %w",
param.Name, param.ValueFrom.ConfigMapKeyRef.Name, param.ValueFrom.ConfigMapKeyRef.Key, err)
}
woc.globalParams["workflow.parameters."+param.Name] = cmValue
} else if param.Value != nil {
woc.globalParams["workflow.parameters."+param.Name] = param.Value.String()
} else {
return fmt.Errorf("either value or valueFrom must be specified in order to set global parameter %s",
}
} This is a really easy fix. Would someone like to volunteer? |
Signed-off-by: mikutas <[email protected]>
Signed-off-by: mikutas <[email protected]> Signed-off-by: juchao <[email protected]>
Summary
When a
valueFrom
is used in a workflow parameter (arguments.parameters
) it produces a:What version are you running?
3.3.8
Diagnostics
Paste the smallest workflow that reproduces the bug. We must be able to run the workflow.
Message from the maintainers:
Impacted by this bug? Give it a 👍. We prioritise the issues with the most 👍.
The text was updated successfully, but these errors were encountered: