mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-05-05 07:45:27 -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
|
@ -57,16 +57,21 @@ func New(ctx context.Context, workingDir string) (*Client, error) {
|
|||
}, nil
|
||||
}
|
||||
|
||||
// CreateCluster creates a Constellation cluster using Terraform.
|
||||
func (c *Client) CreateCluster(ctx context.Context, provider cloudprovider.Provider, vars Variables) (string, error) {
|
||||
// PrepareWorkspace prepares a Terraform workspace for a Constellation cluster.
|
||||
func (c *Client) PrepareWorkspace(provider cloudprovider.Provider, vars Variables) error {
|
||||
if err := prepareWorkspace(c.file, provider, c.workingDir); err != nil {
|
||||
return "", err
|
||||
return err
|
||||
}
|
||||
|
||||
if err := c.writeVars(vars); err != nil {
|
||||
return "", err
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// CreateCluster creates a Constellation cluster using Terraform.
|
||||
func (c *Client) CreateCluster(ctx context.Context) (string, error) {
|
||||
if err := c.tf.Init(ctx); err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue