Skip to content
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

script template should support env #711

Closed
vreon opened this issue Feb 1, 2018 · 2 comments
Closed

script template should support env #711

vreon opened this issue Feb 1, 2018 · 2 comments
Assignees
Milestone

Comments

@vreon
Copy link
Contributor

vreon commented Feb 1, 2018

Is this a BUG REPORT or FEATURE REQUEST?:

Feature request

What happened:

I wanted to use an existing Secret's values in a script template, so I tried to use env (in the same vein as the container template).

What you expected to happen:

env is ignored in the Workflow, and isn't present in the resulting container's spec.

How to reproduce it (as minimally and precisely as possible):

$ kubectl create secret generic my-secret --from-literal password=woooo
$ cat test.yaml
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
  name: test
spec:
  entrypoint: main
  templates:
  - name: main
    script:
      image: busybox
      command: [sh]
      source: |
        printenv
      env:
      - name: PASSWORD
        valueFrom:
          secretKeyRef:
            name: my-secret
            key: password
$ argo submit -w test.yaml && argo logs test | grep PASSWORD

Anything else we need to know?:

A couple of workarounds exist:

I feel like volumeMounts should also be supported, though I don't need it for this use case.

Environment:

  • Argo version:
$ argo version
argo: v2.0.0-beta1
  BuildDate: 2018-01-18T22:06:03Z
  GitCommit: 549870c1ee08138b20b8a4b0c026569cf1e6c19a
  GitTreeState: clean
  GitTag: v2.0.0-beta1
  GoVersion: go1.9.1
  Compiler: gc
  Platform: linux/amd64
  • Kubernetes version :
$ kubectl version -o yaml                                                   
clientVersion:
  buildDate: 2017-09-28T22:57:57Z
  compiler: gc
  gitCommit: 6e937839ac04a38cac63e6a7a306c5d035fe7b0a
  gitTreeState: clean
  gitVersion: v1.8.0
  goVersion: go1.8.3
  major: "1"
  minor: "8"
  platform: linux/amd64
serverVersion:
  buildDate: 2017-11-29T22:43:34Z
  compiler: gc
  gitCommit: 0b9efaeb34a2fc51ff8e4d34ad9bc6375459c4a4
  gitTreeState: clean
  gitVersion: v1.8.0
  goVersion: go1.9.1
  major: "1"
  minor: "8"
  platform: linux/amd64
@jessesuen
Copy link
Member

I agree with your use case especially secrets and environment variables. Being able to control imagePullPolicy in script templates is another that comes to mind. In other words, script templates should be pretty much be defined as a container object but with the extra source field for holding the script contents.

@jessesuen jessesuen added this to the v2.1 milestone Feb 6, 2018
@jessesuen jessesuen self-assigned this Feb 7, 2018
@JulienBalestra
Copy link
Contributor

JulienBalestra commented Mar 20, 2018

Indeed @jessesuen I'd like to control the imagePullPolicy setting, currently I have a value set to Always for my custom images.

Is it planned for soon ? Do you want me to open a dedicated issue for that ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants