Skip to content

submit failed, prompt "argo.workflows.client.rest.ApiException: (400)" #24

@xxlest

Description

@xxlest

Describe the bug
i tried submit argo workflow use python which is "hello-word" dsl, but failed Could help me have a look?
python code:

from argo.workflows.dsl import Workflow
from argo.workflows.dsl import template
import yaml

from argo.workflows.dsl.templates import V1Container

class HelloWorld(Workflow):

entrypoint = "whalesay"

@template
def whalesay(self) -> V1Container:
    container = V1Container(
        image="docker/whalesay:latest",
        name="whalesay",
        command=["cowsay"],
        args=["hello world"]
    )

    return container

wf=HelloWorld()
print(wf)

from argo.workflows.client import V1alpha1Api
from argo.workflows.config import load_kube_config

load_kube_config() # loads local configuration from ~/.kube/config
v1alpha1 = V1alpha1Api()
wfs = v1alpha1.list_namespaced_workflows(namespace="default")
print(wfs)
#v1alpha1.create_namespaced_workflow("default", wf)
wf.submit(client=V1alpha1Api(), namespace="default")

i can get wfs by client and print, but submit failed throw 400 exception
Screenshots
image
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions