-
Hi, I have JSON parameters (testResources, prodResources) and I want to use those parameters in my "if condition" the final value should be numeric. So I tried this:
but I got the error:
so I tried this condition, and it works fine:
so my question is what did I do wrong? The WF yml: apiVersion: argoproj.io/v1alpha1
kind: WorkflowTemplate
metadata:
name: general-template-workflow
spec:
templates:
- name: general-template
inputs:
parameters:
- name: app
- name: env
- name: testResources
default: |
{
"driver-pool": "main",
"driver-core": 2,
"driver-memory": "4g",
"executor-pool": "main",
"executor-core": 2,
"executor-memory": "4g",
"fix": 1
}
- name: prodResources
default: |
{
"driver-pool": "main",
"driver-core": 4,
"driver-memory": "8g",
"executor-pool": "main",
"executor-core": 4,
"executor-memory": "8g",
"fix": 1
}
resource:
action: create
manifest: |
apiVersion: "sparkoperator.k8s.io/v1beta2"
kind: SparkApplication
metadata:
generateName: {{workflow.name}}-{{inputs.parameters.app}}-
spec:
type: Scala
mode: cluster
...
driver:
cores: {{=inputs.parameters.env=='test'?jsonpath(inputs.parameters.testResources,'$.driver-core'):jsonpath(inputs.parameters.prodResources,'$.driver-core')}}
... |
Beta Was this translation helpful? Give feedback.
Answered by
rbushri
Apr 16, 2023
Replies: 1 comment
-
A bug has been opened for this issue: #10924 |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
agilgur5
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A bug has been opened for this issue: #10924