Skip to content

Required vars not required when calling tasks #1557

@mvhatch

Description

@mvhatch

I tried looking to see if this was already an issue but did not find anything. Also, wasn't sure if this is a bug or a feature request.

  helm-diff:
    desc: Show the diff between the current and previous helm release
    cmds:
      - task: common:helm-diff
        vars:
          HELM_ARGS: "-f=./helm/{{.PROJ}}.yaml --set image.tag={{.DOCKER_IMAGE_TAG}}"
          K8S_REGION: '{{dig .PROJ "region" .DEFAULT_K8S_REGION (mustFromJson .K8S_CONFIG)}}'
          K8S_CLUSTER: '{{dig .PROJ "cluster" .DEFAULT_K8S_CLUSTER (mustFromJson .K8S_CONFIG)}}'
    requires:
      vars: [PROJ]

Expected running task helm-diff fails with: task: Task "helm-diff" cancelled because it is missing required variables: PROJ

Actual task runs successfully.
Note: PROJ has no default value. For comparison, this works as expected.

  helm-diff:
    desc: Show the diff between the current and previous helm release
    cmds:
      - cmd: echo "helm diff"
        vars:
          HELM_ARGS: "-f=./helm/{{.PROJ}}.yaml --set image.tag={{.DOCKER_IMAGE_TAG}}"
          K8S_REGION: '{{dig .PROJ "region" .DEFAULT_K8S_REGION (mustFromJson .K8S_CONFIG)}}'
          K8S_CLUSTER: '{{dig .PROJ "cluster" .DEFAULT_K8S_CLUSTER (mustFromJson .K8S_CONFIG)}}'
    requires:
      vars: [PROJ]
  • Task version: v3.35.1
  • Operating system: MacOS arm64
  • Experiments enabled: none

Metadata

Metadata

Assignees

No one assigned

    Labels

    state: awaiting responseWaiting for issue author to respond.state: can't reproNot enough information was given to reproduce the issue described.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions