mirror of
https://github.com/edgelesssys/constellation.git
synced 2024-10-01 01:36:09 -04:00
24 lines
509 B
Go
24 lines
509 B
Go
/*
|
|
Copyright (c) Edgeless Systems GmbH
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
*/
|
|
|
|
package cmd
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/edgelesssys/constellation/v2/internal/cloud/cloudprovider"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
func isCloudProvider(arg int) cobra.PositionalArgs {
|
|
return func(_ *cobra.Command, args []string) error {
|
|
if provider := cloudprovider.FromString(args[arg]); provider == cloudprovider.Unknown {
|
|
return fmt.Errorf("argument %s isn't a valid cloud provider", args[arg])
|
|
}
|
|
return nil
|
|
}
|
|
}
|