mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-06-20 20:24:22 -04:00
cli: remove debug env check for AWS (#460)
This commit is contained in:
parent
cf36b85ff9
commit
309a4b5196
4 changed files with 0 additions and 37 deletions
|
@ -48,10 +48,6 @@ func (c *Creator) Create(ctx context.Context, provider cloudprovider.Provider, c
|
||||||
) (clusterid.File, error) {
|
) (clusterid.File, error) {
|
||||||
switch provider {
|
switch provider {
|
||||||
case cloudprovider.AWS:
|
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)
|
cl, err := c.newTerraformClient(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return clusterid.File{}, err
|
return clusterid.File{}, err
|
||||||
|
|
|
@ -26,7 +26,6 @@ func newConfigGenerateCmd() *cobra.Command {
|
||||||
Args: cobra.MatchAll(
|
Args: cobra.MatchAll(
|
||||||
cobra.ExactArgs(1),
|
cobra.ExactArgs(1),
|
||||||
isCloudProvider(0),
|
isCloudProvider(0),
|
||||||
warnAWS(0),
|
|
||||||
),
|
),
|
||||||
ValidArgsFunction: generateCompletion,
|
ValidArgsFunction: generateCompletion,
|
||||||
RunE: runConfigGenerate,
|
RunE: runConfigGenerate,
|
||||||
|
|
|
@ -8,7 +8,6 @@ package cmd
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/edgelesssys/constellation/v2/internal/config/instancetypes"
|
"github.com/edgelesssys/constellation/v2/internal/config/instancetypes"
|
||||||
|
@ -27,26 +26,7 @@ func newConfigInstanceTypesCmd() *cobra.Command {
|
||||||
return cmd
|
return cmd
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Merge everything back into one function once AWS is supported.
|
|
||||||
func printSupportedInstanceTypes(cmd *cobra.Command, args []string) {
|
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:
|
fmt.Printf(`AWS instance families:
|
||||||
%v
|
%v
|
||||||
Azure Confidential VM instance types:
|
Azure Confidential VM instance types:
|
||||||
|
|
|
@ -7,24 +7,12 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
package cmd
|
package cmd
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
|
||||||
|
|
||||||
"github.com/edgelesssys/constellation/v2/internal/cloud/cloudprovider"
|
"github.com/edgelesssys/constellation/v2/internal/cloud/cloudprovider"
|
||||||
"github.com/spf13/cobra"
|
"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 {
|
func isCloudProvider(arg int) cobra.PositionalArgs {
|
||||||
return func(cmd *cobra.Command, args []string) error {
|
return func(cmd *cobra.Command, args []string) error {
|
||||||
if provider := cloudprovider.FromString(args[arg]); provider == cloudprovider.Unknown {
|
if provider := cloudprovider.FromString(args[arg]); provider == cloudprovider.Unknown {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue