mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-08-05 21:44:15 -04:00
Terraform: Only rollback after we fully created the workspace
This commit is contained in:
parent
19fb6f1233
commit
e1d8926395
8 changed files with 178 additions and 60 deletions
|
@ -12,6 +12,7 @@ import (
|
|||
|
||||
"github.com/edgelesssys/constellation/v2/cli/internal/terraform"
|
||||
"github.com/edgelesssys/constellation/v2/internal/cloud/cloudprovider"
|
||||
|
||||
"go.uber.org/goleak"
|
||||
)
|
||||
|
||||
|
@ -29,13 +30,18 @@ type stubTerraformClient struct {
|
|||
destroyClusterCalled bool
|
||||
createClusterErr error
|
||||
destroyClusterErr error
|
||||
prepareWorkspaceErr error
|
||||
cleanUpWorkspaceErr error
|
||||
}
|
||||
|
||||
func (c *stubTerraformClient) CreateCluster(ctx context.Context, provider cloudprovider.Provider, input terraform.Variables) (string, error) {
|
||||
func (c *stubTerraformClient) CreateCluster(ctx context.Context) (string, error) {
|
||||
return c.ip, c.createClusterErr
|
||||
}
|
||||
|
||||
func (c *stubTerraformClient) PrepareWorkspace(provider cloudprovider.Provider, input terraform.Variables) error {
|
||||
return c.prepareWorkspaceErr
|
||||
}
|
||||
|
||||
func (c *stubTerraformClient) DestroyCluster(ctx context.Context) error {
|
||||
c.destroyClusterCalled = true
|
||||
return c.destroyClusterErr
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue