mirror of
https://github.com/edgelesssys/constellation.git
synced 2024-10-01 01:36:09 -04:00
Rename provider
This commit is contained in:
parent
4496755c64
commit
dad9a97ee2
@ -35,7 +35,7 @@ func NewCreator(out io.Writer) *Creator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Create creates the handed amount of instances and all the needed resources.
|
// Create creates the handed amount of instances and all the needed resources.
|
||||||
func (c *Creator) Create(ctx context.Context, provider cloudprovider.CloudProvider, config *config.Config, name, insType string, coordCount, nodeCount int,
|
func (c *Creator) Create(ctx context.Context, provider cloudprovider.Provider, config *config.Config, name, insType string, coordCount, nodeCount int,
|
||||||
) (state.ConstellationState, error) {
|
) (state.ConstellationState, error) {
|
||||||
switch provider {
|
switch provider {
|
||||||
case cloudprovider.GCP:
|
case cloudprovider.GCP:
|
||||||
|
@ -61,7 +61,7 @@ func TestCreator(t *testing.T) {
|
|||||||
newGCPClientErr error
|
newGCPClientErr error
|
||||||
azureclient azureclient
|
azureclient azureclient
|
||||||
newAzureClientErr error
|
newAzureClientErr error
|
||||||
provider cloudprovider.CloudProvider
|
provider cloudprovider.Provider
|
||||||
config *config.Config
|
config *config.Config
|
||||||
wantState state.ConstellationState
|
wantState state.ConstellationState
|
||||||
wantErr bool
|
wantErr bool
|
||||||
|
@ -4,18 +4,18 @@ import "strings"
|
|||||||
|
|
||||||
//go:generate stringer -type=CloudProvider
|
//go:generate stringer -type=CloudProvider
|
||||||
|
|
||||||
// CloudProvider is cloud provider used by the CLI.
|
// Provider is cloud provider used by the CLI.
|
||||||
type CloudProvider uint32
|
type Provider uint32
|
||||||
|
|
||||||
const (
|
const (
|
||||||
Unknown CloudProvider = iota
|
Unknown Provider = iota
|
||||||
AWS
|
AWS
|
||||||
Azure
|
Azure
|
||||||
GCP
|
GCP
|
||||||
)
|
)
|
||||||
|
|
||||||
// FromString returns cloud provider from string.
|
// FromString returns cloud provider from string.
|
||||||
func FromString(s string) CloudProvider {
|
func FromString(s string) Provider {
|
||||||
s = strings.ToLower(s)
|
s = strings.ToLower(s)
|
||||||
switch s {
|
switch s {
|
||||||
case "aws":
|
case "aws":
|
||||||
|
@ -18,8 +18,8 @@ const _CloudProvider_name = "UnknownAWSAzureGCP"
|
|||||||
|
|
||||||
var _CloudProvider_index = [...]uint8{0, 7, 10, 15, 18}
|
var _CloudProvider_index = [...]uint8{0, 7, 10, 15, 18}
|
||||||
|
|
||||||
func (i CloudProvider) String() string {
|
func (i Provider) String() string {
|
||||||
if i >= CloudProvider(len(_CloudProvider_index)-1) {
|
if i >= Provider(len(_CloudProvider_index)-1) {
|
||||||
return "CloudProvider(" + strconv.FormatInt(int64(i), 10) + ")"
|
return "CloudProvider(" + strconv.FormatInt(int64(i), 10) + ")"
|
||||||
}
|
}
|
||||||
return _CloudProvider_name[_CloudProvider_index[i]:_CloudProvider_index[i+1]]
|
return _CloudProvider_name[_CloudProvider_index[i]:_CloudProvider_index[i+1]]
|
||||||
|
@ -11,7 +11,7 @@ import (
|
|||||||
type cloudCreator interface {
|
type cloudCreator interface {
|
||||||
Create(
|
Create(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
provider cloudprovider.CloudProvider,
|
provider cloudprovider.Provider,
|
||||||
config *config.Config,
|
config *config.Config,
|
||||||
name, insType string,
|
name, insType string,
|
||||||
coordCount, nodeCount int,
|
coordCount, nodeCount int,
|
||||||
|
@ -16,7 +16,7 @@ type stubCloudCreator struct {
|
|||||||
|
|
||||||
func (c *stubCloudCreator) Create(
|
func (c *stubCloudCreator) Create(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
provider cloudprovider.CloudProvider,
|
provider cloudprovider.Provider,
|
||||||
config *config.Config,
|
config *config.Config,
|
||||||
name, insType string,
|
name, insType string,
|
||||||
coordCount, nodeCount int,
|
coordCount, nodeCount int,
|
||||||
|
@ -53,7 +53,7 @@ func runCreate(cmd *cobra.Command, args []string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func create(cmd *cobra.Command, creator cloudCreator, fileHandler file.Handler,
|
func create(cmd *cobra.Command, creator cloudCreator, fileHandler file.Handler,
|
||||||
countCoord, countNode int, provider cloudprovider.CloudProvider, insType string,
|
countCoord, countNode int, provider cloudprovider.Provider, insType string,
|
||||||
) (retErr error) {
|
) (retErr error) {
|
||||||
flags, err := parseCreateFlags(cmd)
|
flags, err := parseCreateFlags(cmd)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -70,7 +70,7 @@ func TestCreate(t *testing.T) {
|
|||||||
testCases := map[string]struct {
|
testCases := map[string]struct {
|
||||||
setupFs func(*require.Assertions) afero.Fs
|
setupFs func(*require.Assertions) afero.Fs
|
||||||
creator *stubCloudCreator
|
creator *stubCloudCreator
|
||||||
provider cloudprovider.CloudProvider
|
provider cloudprovider.Provider
|
||||||
yesFlag bool
|
yesFlag bool
|
||||||
devConfigFlag string
|
devConfigFlag string
|
||||||
nameFlag string
|
nameFlag string
|
||||||
|
Loading…
Reference in New Issue
Block a user