Remove unused name parameter in CreateCluster

This commit is contained in:
Nils Hanke 2022-11-15 13:28:14 +01:00 committed by Nils Hanke
parent b9b618a1f0
commit 158dfe0e2b
5 changed files with 8 additions and 10 deletions

View File

@ -14,7 +14,7 @@ import (
) )
type terraformClient interface { type terraformClient interface {
CreateCluster(ctx context.Context, provider cloudprovider.Provider, name string, input terraform.Variables) (string, error) CreateCluster(ctx context.Context, provider cloudprovider.Provider, input terraform.Variables) (string, error)
DestroyCluster(ctx context.Context) error DestroyCluster(ctx context.Context) error
CleanUpWorkspace() error CleanUpWorkspace() error
RemoveInstaller() RemoveInstaller()

View File

@ -32,7 +32,7 @@ type stubTerraformClient struct {
cleanUpWorkspaceErr error cleanUpWorkspaceErr error
} }
func (c *stubTerraformClient) CreateCluster(ctx context.Context, provider cloudprovider.Provider, name string, input terraform.Variables) (string, error) { func (c *stubTerraformClient) CreateCluster(ctx context.Context, provider cloudprovider.Provider, input terraform.Variables) (string, error) {
return c.ip, c.createClusterErr return c.ip, c.createClusterErr
} }

View File

@ -107,7 +107,7 @@ func (c *Creator) createAWS(ctx context.Context, cl terraformClient, config *con
Debug: config.IsDebugCluster(), Debug: config.IsDebugCluster(),
} }
ip, err := cl.CreateCluster(ctx, cloudprovider.AWS, name, vars) ip, err := cl.CreateCluster(ctx, cloudprovider.AWS, vars)
if err != nil { if err != nil {
return clusterid.File{}, err return clusterid.File{}, err
} }
@ -140,7 +140,7 @@ func (c *Creator) createGCP(ctx context.Context, cl terraformClient, config *con
Debug: config.IsDebugCluster(), Debug: config.IsDebugCluster(),
} }
ip, err := cl.CreateCluster(ctx, cloudprovider.GCP, name, &vars) ip, err := cl.CreateCluster(ctx, cloudprovider.GCP, &vars)
if err != nil { if err != nil {
return clusterid.File{}, err return clusterid.File{}, err
} }
@ -176,7 +176,7 @@ func (c *Creator) createAzure(ctx context.Context, cl terraformClient, config *c
vars = normalizeAzureURIs(vars) vars = normalizeAzureURIs(vars)
ip, err := cl.CreateCluster(ctx, cloudprovider.Azure, name, &vars) ip, err := cl.CreateCluster(ctx, cloudprovider.Azure, &vars)
if err != nil { if err != nil {
return clusterid.File{}, err return clusterid.File{}, err
} }
@ -273,7 +273,7 @@ func (c *Creator) createQEMU(ctx context.Context, cl terraformClient, lv libvirt
Firmware: config.Provider.QEMU.Firmware, Firmware: config.Provider.QEMU.Firmware,
} }
ip, err := cl.CreateCluster(ctx, cloudprovider.QEMU, name, &vars) ip, err := cl.CreateCluster(ctx, cloudprovider.QEMU, &vars)
if err != nil { if err != nil {
return clusterid.File{}, err return clusterid.File{}, err
} }

View File

@ -58,9 +58,7 @@ func New(ctx context.Context, workingDir string) (*Client, error) {
} }
// CreateCluster creates a Constellation cluster using Terraform. // CreateCluster creates a Constellation cluster using Terraform.
func (c *Client) CreateCluster( func (c *Client) CreateCluster(ctx context.Context, provider cloudprovider.Provider, vars Variables) (string, error) {
ctx context.Context, provider cloudprovider.Provider, name string, vars Variables,
) (string, error) {
if err := prepareWorkspace(c.file, provider, c.workingDir); err != nil { if err := prepareWorkspace(c.file, provider, c.workingDir); err != nil {
return "", err return "", err
} }

View File

@ -129,7 +129,7 @@ func TestCreateCluster(t *testing.T) {
workingDir: constants.TerraformWorkingDir, workingDir: constants.TerraformWorkingDir,
} }
ip, err := c.CreateCluster(context.Background(), tc.provider, "test", tc.vars) ip, err := c.CreateCluster(context.Background(), tc.provider, tc.vars)
if tc.wantErr { if tc.wantErr {
assert.Error(err) assert.Error(err)