Skip to content

How should I be updating my Tasks for hera v5? #579

@dmerrick

Description

@dmerrick

Right now I'm using something like this:

# create a simple function so we can use a named Parameter
def run_command(cmd: str) -> str:
  return cmd

task = Task(
  name="cmd-template",
  source=run_command,
  command=["bash"],
  image=docker_image,
  inputs=[Parameter(name="cmd", default="echo Hello Argo")],
)

on hera v5, I get the following error:

>   ???
E   pydantic.error_wrappers.ValidationError: 1 validation error for Task
E   __root__
E     exactly one of ['template', 'template_ref', 'inline'] must be present (type=value_error)

What is the recommended way to update my code to work with the new hera?

(Related to #562)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions