mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-05-04 23:35:11 -04:00
User-friendlier errors
This commit is contained in:
parent
e1d8926395
commit
6e5895f200
3 changed files with 31 additions and 4 deletions
|
@ -29,6 +29,9 @@ const (
|
|||
terraformVarsFile = "terraform.tfvars"
|
||||
)
|
||||
|
||||
// ErrTerraformWorkspaceExistsWithDifferentVariables is returned when existing Terraform files differ from the version the CLI wants to extract.
|
||||
var ErrTerraformWorkspaceExistsWithDifferentVariables = errors.New("creating cluster: a Terraform workspace already exists with different variables")
|
||||
|
||||
// Client manages interaction with Terraform.
|
||||
type Client struct {
|
||||
tf tfInterface
|
||||
|
@ -162,7 +165,7 @@ func (c *Client) writeVars(vars Variables) error {
|
|||
return err
|
||||
}
|
||||
if vars.String() != string(varsContent) {
|
||||
return errors.New("creating cluster: workspace already exists with different variables")
|
||||
return ErrTerraformWorkspaceExistsWithDifferentVariables
|
||||
}
|
||||
} else if err != nil {
|
||||
return err
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue