cli: remove debug env check for AWS (#460)

This commit is contained in:
3u13r 2022-11-04 15:31:51 +01:00 committed by GitHub
parent cf36b85ff9
commit 309a4b5196
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 0 additions and 37 deletions

View File

@ -48,10 +48,6 @@ func (c *Creator) Create(ctx context.Context, provider cloudprovider.Provider, c
) (clusterid.File, error) {
switch provider {
case cloudprovider.AWS:
// TODO: Remove this once AWS is supported.
if os.Getenv("CONSTELLATION_AWS_DEV") != "1" {
return clusterid.File{}, fmt.Errorf("AWS isn't supported yet")
}
cl, err := c.newTerraformClient(ctx)
if err != nil {
return clusterid.File{}, err

View File

@ -26,7 +26,6 @@ func newConfigGenerateCmd() *cobra.Command {
Args: cobra.MatchAll(
cobra.ExactArgs(1),
isCloudProvider(0),
warnAWS(0),
),
ValidArgsFunction: generateCompletion,
RunE: runConfigGenerate,

View File

@ -8,7 +8,6 @@ package cmd
import (
"fmt"
"os"
"strings"
"github.com/edgelesssys/constellation/v2/internal/config/instancetypes"
@ -27,26 +26,7 @@ func newConfigInstanceTypesCmd() *cobra.Command {
return cmd
}
// TODO: Merge everything back into one function once AWS is supported.
func printSupportedInstanceTypes(cmd *cobra.Command, args []string) {
if os.Getenv("CONSTELLATION_AWS_DEV") == "1" {
printSupportedInstanceTypesWithAWS()
return
}
printSupportedInstanceTypesWithoutAWS()
}
func printSupportedInstanceTypesWithoutAWS() {
fmt.Printf(`Azure Confidential VM instance types:
%v
Azure Trusted Launch instance types:
%v
GCP instance types:
%v
`, formatInstanceTypes(instancetypes.AzureCVMInstanceTypes), formatInstanceTypes(instancetypes.AzureTrustedLaunchInstanceTypes), formatInstanceTypes(instancetypes.GCPInstanceTypes))
}
func printSupportedInstanceTypesWithAWS() {
fmt.Printf(`AWS instance families:
%v
Azure Confidential VM instance types:

View File

@ -7,24 +7,12 @@ SPDX-License-Identifier: AGPL-3.0-only
package cmd
import (
"errors"
"fmt"
"os"
"github.com/edgelesssys/constellation/v2/internal/cloud/cloudprovider"
"github.com/spf13/cobra"
)
// warnAWS warns that AWS isn't supported.
func warnAWS(providerPos int) cobra.PositionalArgs {
return func(cmd *cobra.Command, args []string) error {
if cloudprovider.FromString(args[providerPos]) == cloudprovider.AWS && os.Getenv("CONSTELLATION_AWS_DEV") != "1" {
return errors.New("AWS isn't supported yet")
}
return nil
}
}
func isCloudProvider(arg int) cobra.PositionalArgs {
return func(cmd *cobra.Command, args []string) error {
if provider := cloudprovider.FromString(args[arg]); provider == cloudprovider.Unknown {