Welcome to the Linux Foundation Forum!

Lab 4.2 - A Simple DAG Workflow: apply workflow with generate name

dag-workflow.yaml

apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
  generateName: dag-diamond-
  namespace: argo
...

Applying the yaml returns the following error

$ kubectl apply -f dag-workflow.yaml
error: from dag-diamond-: cannot use generate name with apply

I addressed this with the following change
generateName: dag-diamond- to name: dag-diamond

Comments

  • mstepien
    mstepien Posts: 468

    Hi @johchung,

    Thank you for flagging this. The course has been updated.

    Best regards,
    Magda

  • Hello

    dag-workflow.yaml

    apiVersion: argoproj.io/v1alpha1
    kind: Workflow
    metadata:
    generateName: dag-diamond
    namespace: argo

    Applying the yaml returns the following error

    kubectl apply -f dag-workflow.yaml
    error: from dag-diamond: cannot use generate name with apply

    kubectl version --short

    Client Version: v1.25.2
    Kustomize Version: v4.5.7
    Server Version: v1.27.4

    Do you have any ideas?

  • enigmatik777
    enigmatik777 Posts: 2
    edited October 14

    kubectl apply -f dag-workflow.yaml should be changed to kubectl create -f dag-workflow.yaml

  • nomailnoplan
    nomailnoplan Posts: 2
    edited November 13

    @mstepien I just spent a ton of time trying to figure this out. What @enigmatik777 said. Please for update the course to use kubectl create instead of kubectl apply If you use apply instead of create it results in this not so useful error:
    cannot unmarshal object into Go struct field WorkflowSpec.spec.templates of type []

Categories

Upcoming Training