Reputation: 1253
I pushed my argo workflow code to my github repo that is connected to my argo cd
I tried to sync so that the argo workflow will run
but I am getting this error
from input-artifact-git-: cannot use generate name with apply
Below is my argo workflow code.
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: input-artifact-git-
namespace: workflows
spec:
entrypoint: git-clone
templates:
- name: git-clone
inputs:
artifacts:
- name: argo-source
path: /src
git:
repo: https://github.com/*******/react-app.git
container:
image: node:16-alpine3.17
command: [sh, -c]
args: ["npm install && npm run build"]
workingDir: /src
outputs:
artifacts:
- name: message
path: /src/build
archive:
none: {}
s3:
endpoint: s3.amazonaws.com
bucket: my-bucket-name
region: eu-west-2
key: "."
accessKeySecret:
name: mysecret
key: accessKey
secretKeySecret:
name: mysecret
key: secretKey
Upvotes: 0
Views: 1371
Reputation: 31
generateName
rather than name
(Everytime it runs, name
is set with generateName+hashValue in Workflow, and name
is used in WorkflowTemplate)kubectl create -f workflow.yaml
unlike WorkflowTemplate by kubectl apply -f workflowtemplate.yaml
kubectl apply -f workflow.yaml
, it does not workUpvotes: 0
Reputation: 8392
generateName
is a feature of the Argo Workflows CLI, which automatically translates that field into a name
before submitting the Workflow to the Kubernetes API.
If you want to run the Workflow once each time you sync Argo CD, check out resource hooks: https://argo-cd.readthedocs.io/en/latest/user-guide/resource_hooks/
Upvotes: 0