1

I have multiple artifact repositories and have them configured in the configMap, like:

apiVersion: v1
kind: ConfigMap
metadata:
  name: artifact-repositories
data:
  bucket1: |
    s3:
      endpoint: ...
      bucket: bucket1
      accessKeySecret:
        ...
      secretKeySecret:
        ...

  bucket2: |
    s3:
      endpoint: ...
      bucket: bucket2
      accessKeySecret:
        ...
      secretKeySecret:
        ...

Then, I want to reference them in a key-only way in the same workflow :

apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
  generateName: artifact-
spec:
  entrypoint: main

  artifactRepositoryRef:
    configMap: artifact-repositories
    key: bucket1

  templates:
  - name: main
    steps:
    - - name: step1
        template: step1
    - - name: step2
        template: step2

  - name: step1
    container:
      ...
    outputs:
      artifacts:
        - name: art-output
          path: /tmp/s1.txt 
          s3:   # use bucket1 through artifactRepositoryRef
            key: argo/s1.txt


  - name: step2
    container:
      ...
    outputs:
      artifacts:
        - name: art-output
          path: /tmp/s2.txt 
          s3:
            # how to use bucket2 in a key-only way
            key: argo/s2.txt  

artifactRepositoryRef can only reference one artifact repository, how to reference another artifact repository in a concise way ?

Rife
  • 487
  • 2
  • 7
  • 18
  • From what I understand, there should only be a single *default* artifact repository. This single repo will be used by all the key-only artifact references in your templates. If you need another artifact repo, I guess the way to go would be to explicitly declare the `ArtifactRepositoryRef` in your template (cf https://argoproj.github.io/argo-workflows/artifact-repository-ref/) – bluu Jun 23 '22 at 10:47
  • Sorry I hadn't looked in detail at your Workflow template... I think, you just need to declare the `bucket` under `s3` for your `step1` template. – bluu Jun 23 '22 at 10:54

0 Answers0