As per doc we can provide env variables to a CronWorkflow using the flag --parameter-file or -f but Argo CLI is giving error as unknown flag: --parameter-file , While running argo cron create --parameter-file test_env.yaml test.yaml or argo cron create -f test_env.yaml test.yaml.
What version of Argo Workflows are you running?
argo: v2.9.1
BuildDate: 2020-07-03T15:06:40Z
GitCommit: 6b967d08c0a142aaa278538f2407c28de467262e
GitTreeState: clean
GitTag: v2.9.1
GoVersion: go1.13.4
Compiler: gc
Platform: linux/amd64
test.yaml
```apiVersion: argoproj.io/v1alpha1
kind: CronWorkflow
metadata:
generateName: steps-
spec:
schedule: "*/5 * * * *"
concurrencyPolicy: "Replace"
startingDeadlineSeconds: 0
workflowSpec:
entrypoint: hello
templates:
- name: hello
steps:
- - name: hello
template: whalesay
arguments:
parameters: [{name: message, value: "hello world"}]
- name: whalesay
inputs:
parameters:
- name: message
container:
image: docker/whalesay
command: [cowsay]
env:
- name: 'MSG'
value: '{{workflow.parameters.MSG}}'
`test_env.yaml`
MSG: HelloDuniya
```
I can't run the program though I can't provide logs.
Message from the maintainers:
Impacted by this bug? Give it a 馃憤. We prioritise the issues with the most 馃憤.
can you give it try with argo cron create cron-worfklow-file.yaml --parameter-file test.yaml?
@nirav24 I tried but this is also giving me the same error.
@nirav24 I tried but this is also giving me the same error.
I checked, I think, argo cron create --help doesn't print these options.
$ argo cron create --help
create a cron workflow
Usage:
argo cron create FILE1 FILE2... [flags]
Flags:
-h, --help help for create
-o, --output string Output format. One of: name|json|yaml|wide
--schedule string override cron workflow schedule
--strict perform strict workflow validation (default true)
Global Flags:
-s, --argo-server host:port API server host:port. e.g. localhost:2746. Defaults to the ARGO_SERVER environment variable.
--as string Username to impersonate for the operation
--as-group stringArray Group to impersonate for the operation, this flag can be repeated to specify multiple groups.
--certificate-authority string Path to a cert file for the certificate authority
--client-certificate string Path to a client certificate file for TLS
--client-key string Path to a client key file for TLS
--cluster string The name of the kubeconfig cluster to use
--context string The name of the kubeconfig context to use
--insecure-skip-tls-verify If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure
-k, --insecure-skip-verify If true, the Argo Server's certificate will not be checked for validity. This will make your HTTPS connections insecure. Defaults to the ARGO_INSECURE_SKIP_VERIFY environment variable.
--instanceid string submit with a specific controller's instance id label. Default to the ARGO_INSTANCEID environment variable.
--kubeconfig string Path to a kube config. Only required if out-of-cluster
--loglevel string Set the logging level. One of: debug|info|warn|error (default "info")
-n, --namespace string If present, the namespace scope for this CLI request
--password string Password for basic authentication to the API server
--request-timeout string The length of time to wait before giving up on a single server request. Non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't timeout requests. (default "0")
-e, --secure Whether or not the server is using TLS with the Argo Server. Defaults to the ARGO_SECURE environment variable.
--server string The address and port of the Kubernetes API server
--token string Bearer token for authentication to the API server
--user string The name of the kubeconfig user to use
--username string Username for basic authentication to the API server
-v, --verbose Enabled verbose logging, i.e. --loglevel debug
Yeah, @nirav24 but this is mentioned in docs . So, there is some discrepancy.
This feature was recently merged (https://github.com/argoproj/argo/pull/3660), but it looks like it didn't make it on the 2.10 release. You can expect this in 2.11
Thanks for letting me know about the update in 2.11.
@simster7 can you suggest any alternative to do the same in previous versions.
I think the only way to achieve a similar effect now is to do you own scripting/pre-processing of your CronWorkflow before submitting it to Argo
Feel free to reopen if necessary
Most helpful comment
Yeah, @nirav24 but this is mentioned in docs . So, there is some discrepancy.