• Nick Fagerlund's avatar
    cloud.StateMgr(): Set terraform version AFTER creating workspace · c99f5972
    Nick Fagerlund authored
    Previously, if the remote TFC/TFE instance doesn't happen to have a tool_version
    record whose name exactly matches the value of `tfversion.String()`, Terraform
    would be completely blocked from using the `terraform workspace new` command
    (when configured with the tags strategy) — the API would give a 422 to the
    whole create request.
    
    This commit changes the StateMgr() function to do the work in two passes; first
    create the workspace (which should work fine regardless), THEN update the
    Terraform version and print a warning to the terminal if it fails (which 99% of
    the time is a benign failure with little impact on your future CLI usage).
    c99f5972