Access to a workflow artifact #5654
-
Hello, I'm struggling to access a workflow artifact, I'm trying to achieve something like this: apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: artifact-test-
spec:
arguments:
artifacts:
- name: content
globalName: content
raw:
data: |
content of my file
entrypoint: start
templates:
- name: start
steps:
- - name: dump
template: dump-artifact
arguments:
artifacts:
- name: content
from: "{{workflow.inputs.artifacts.content}}"
- name: dump-artifact
inputs:
parameters:
- name: args
artifacts:
- name: content
path: /etc/file
container:
image: alpine
command: [cat]
args: [/etc/file] I tried with multiple references as listed in https://argoproj.github.io/argo-workflows/fields/#artifact or https://github.com/argoproj/argo-workflows/blob/master/docs/variables.md#global :
I always get a Is there a way to achieve this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
In the workflow above, the intention is to pass a raw artifact defined at the workflow level to a template. However, referencing artifacts at the workflow level directly within templates using expressions like Functional workflow example: apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: artifact-test-
spec:
entrypoint: start
templates:
- name: start
inputs:
artifacts:
- name: content # Input artifact
path: /etc/file # Artifact path
raw: # The artifact is created using raw data
data: | # File contents
content of my file
container:
image: alpine
command: [cat]
args: [/etc/file] # Output the file contents In this configuration:
This setup ensures that the raw artifact is correctly passed to the template and can be accessed within the container. Resources:
|
Beta Was this translation helpful? Give feedback.
@laymain
In the workflow above, the intention is to pass a raw artifact defined at the workflow level to a template. However, referencing artifacts at the workflow level directly within templates using expressions like
{{workflow.inputs.artifacts.content}}
isn't supported. Instead, define the artifact at the workflow level and pass it explicitly to the template using arguments.Functional workflow example: