commonflags

package
v0.59.0-rc1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 17, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AzureSubscriptionIdFlag provides azure subscription Id.
	AzureSubscriptionIdFlag = "azure-subscription-id"
	// AzureResourceGroupFlag provides azure resource group.
	AzureResourceGroupFlag = "azure-resource-group"
	// AWSRegionFlag provides aws region.
	AWSRegionFlag = "aws-region"
	// AWSAccountIdFlag provides aws accound id.
	AWSAccountIdFlag = "aws-account-id"
	// ClearEnvAzureFlag tells the command to clear azure scope on the environment it is configured.
	ClearEnvAzureFlag = "clear-azure"
	// ClearEnvAWSFlag tells the command to clear aws scope on the environment it is configured.
	ClearEnvAWSFlag = "clear-aws"
	// KubernetesNamespaceFlag provides kubernetes namespace.
	KubernetesNamespaceFlag = "kubernetes-namespace"
	// NamespaceFlag is the legacy alias for KubernetesNamespaceFlag.
	NamespaceFlag = "namespace"
	// ClearEnvKubernetesFlag tells the command to clear kubernetes scope on the environment it is configured.
	ClearEnvKubernetesFlag = "clear-kubernetes"

	// AzureScopeTemplate is the scope format for an Azure subscription/resource group pair.
	AzureScopeTemplate = "/subscriptions/%s/resourceGroups/%s"
	// AwsScopeTemplate is the scope format for an AWS account/region pair.
	AwsScopeTemplate = "/planes/aws/aws/accounts/%s/regions/%s"
)

Variables

This section is empty.

Functions

func AddAWSAccountFlag

func AddAWSAccountFlag(cmd *cobra.Command)

AddAWSAccountFlag adds a flag to the given command that allows the user to specify an AWS account ID.

func AddAWSRegionFlag

func AddAWSRegionFlag(cmd *cobra.Command)

AddAWSRegionFlag adds a flag to the given command that allows the user to specify the AWS region where resources will be deployed.

func AddAWSScopeFlags

func AddAWSScopeFlags(cmd *cobra.Command)

"AddAWSScopeFlags" adds flags to a Cobra command to set the AWS region and account ID, and marks them as required together, as well as mutually exclusive with the ClearEnvAWSFlag.

func AddApplicationNameFlag

func AddApplicationNameFlag(cmd *cobra.Command)

AddApplicationNameFlag adds a flag to the given command that allows the user to specify an application name.

func AddAzureResourceGroupFlag

func AddAzureResourceGroupFlag(cmd *cobra.Command)

AddAzureResourceGroupFlag adds a flag to the given command that allows the user to specify the resource group where Azure resources will be deployed.

func AddAzureScopeFlags

func AddAzureScopeFlags(cmd *cobra.Command)

AddAzureScopeFlags adds flags to a command to specify an Azure subscription and resource group, and marks them as required together, as well as mutually exclusive with a flag to clear environment variables.

func AddAzureSubscriptionFlag

func AddAzureSubscriptionFlag(cmd *cobra.Command)

AddAzureSubscriptionFlag adds a flag to the given command that allows the user to specify an Azure subscription ID.

func AddConfirmationFlag

func AddConfirmationFlag(cmd *cobra.Command)

AddConfirmationFlag adds a flag to the given command that allows the user to confirm an action with a boolean value.

func AddEnvironmentNameFlag

func AddEnvironmentNameFlag(cmd *cobra.Command)

AddEnvironmentNameFlag adds a flag to the given command that allows the user to specify an environment name.

func AddForceFlag added in v0.58.0

func AddForceFlag(cmd *cobra.Command)

AddForceFlag adds a flag to the given command that allows the user to force an operation even when the resource is in a non-terminal state.

func AddFromFileFlagVar added in v0.41.0

func AddFromFileFlagVar(cmd *cobra.Command, ref *string)

AddFromFileFlag adds a flag to the given command that allows the user to specify an input file.

func AddKubeContextFlagVar

func AddKubeContextFlagVar(cmd *cobra.Command, ref *string)

AddKubeContextFlagVar adds a flag to the given command that allows the user to specify a Kubernetes context to use.

func AddKubernetesNamespaceFlag added in v0.54.0

func AddKubernetesNamespaceFlag(cmd *cobra.Command)

AddNamespaceFlag adds a flag to the given command that allows the user to specify a Kubernetes namespace.

func AddKubernetesScopeFlags added in v0.54.0

func AddKubernetesScopeFlags(cmd *cobra.Command)

AddKubernetesScopeFlags adds flags to a command to specify a Kubernetes namespace, and marks it as mutually exclusive with a flag to clear the Kubernetes configuration on the environment.

func AddNamespaceFlag

func AddNamespaceFlag(cmd *cobra.Command)

AddNamespaceFlag adds a flag to the given command that allows the user to specify a Kubernetes namespace.

func AddOutputFlag

func AddOutputFlag(cmd *cobra.Command)

AddOutputFlag adds a flag to the given command that allows the user to specify the output format of the command's output.

func AddParameterFlag

func AddParameterFlag(cmd *cobra.Command)

AddParameterFlag adds a flag to the given command that allows the user to specify parameters for the deployment.

func AddResourceGroupFlag

func AddResourceGroupFlag(cmd *cobra.Command)

AddResourceGroupFlag adds a flag to the given command that allows the user to specify a Radius resource group name.

func AddResourceTypeFlag

func AddResourceTypeFlag(cmd *cobra.Command)

AddResourceTypeFlag adds a flag to the given command that allows the user to specify the type of the portable resource this recipe can be consumed by.

func AddWorkspaceFlag

func AddWorkspaceFlag(cmd *cobra.Command)

AddWorkspaceFlag adds a flag to the given command that allows the user to specify a workspace name.

func MarkNamespaceFlagDeprecated

func MarkNamespaceFlagDeprecated(cmd *cobra.Command)

MarkNamespaceFlagDeprecated marks --namespace as a deprecated alias of --kubernetes-namespace. The flag continues to work but Cobra prints a deprecation warning when it is used.

func ResolveKubernetesNamespaceFlag

func ResolveKubernetesNamespaceFlag(cmd *cobra.Command) (string, bool, error)

ResolveKubernetesNamespaceFlag returns the namespace specified by either --kubernetes-namespace or the legacy --namespace alias. The two flags are expected to be marked mutually exclusive by the caller. The boolean return value indicates whether a namespace was explicitly provided.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL