Skip to content

Unknown workspace sub-command should bail with non-zero exit code #31317

@bengaywins

Description

@bengaywins

Terraform Version

Terraform v1.2.3
on darwin_arm64
+ provider registry.terraform.io/hashicorp/aws v4.20.1
+ provider registry.terraform.io/hashicorp/cloudinit v2.2.0
+ provider registry.terraform.io/hashicorp/kubernetes v2.11.0
+ provider registry.terraform.io/hashicorp/tls v3.4.0

Terraform Configuration Files

N/A

Debug Output

N/A

Expected Behavior

If I run terraform workspace seleect foo, it should bail with non-zero exit code.

Actual Behavior

It bails with a 0 exit code.

Steps to Reproduce

  1. Run terraform workspace seleect foo
  2. echo $?

Additional Context

I had this misspelled in a Makefile which is why I caught this. It just continues instead of failing.

References

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugnewnew issue not yet triaged

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions