Skip to content

[Bug]: Disabling action via disabled: ${command.name == "cleanup deploy"} not working as expected when in dev mode #7721

@eysi09

Description

@eysi09

Bug

Current behavior

To avoid cleaning up certain actions (e.g. PVCs) when in running garden cleanup deploy you can disable it under this command with: disabled: ${command.name == "cleanup deploy"}

E.g.:

kind: Deploy
name: my-deploy
type: kubernetes
disabled: ${command.name == "cleanup deploy"}
spec:
# ...

However, this does not seem to work when in dev mode (I running commands from the dev console). Presumably because the command name isn't resolved correctly.

Surprisingly, the following actually does work in dev mode:

kind: Run
name: my-run
type: exec
spec:
  command: [/bin/sh, "-c", "echo 'command is ${command.name}'"]

That is, if you run run my-run in the dev console it prints command is run.

Expected behavior

It does not cleanup disabled actions.

Reproducible example

  1. Go to demo project
  2. Add disabled: ${command.name == "cleanup deploy"} to e.g. the frontend Deploy action.
  3. Run garden dev
  4. Run cleanup deploy and observe it tries to clean up the frontend Deploy action.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions