cmd

package
v0.0.0-...-fe3d3e7 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package cmd contains the CLI-level constructs that call into the tanzu package.

Index

Constants

This section is empty.

Variables

View Source
var ConfigureCmd = &cobra.Command{
	Use:     "configure <cluster name>",
	Aliases: []string{"config", "conf"},
	Short:   "Generate a config file to be used in cluster creation",
	Long:    configureDesc,
	RunE:    configure,
	Args:    checkSingleClusterArg,
}

ConfigureCmd creates an unmanaged workload cluster.

View Source
var CreateCmd = &cobra.Command{
	Use:   "create <cluster name>",
	Short: "Create an unmanaged cluster",
	Long:  createDesc,
	Run:   create,
	Args: func(cmd *cobra.Command, args []string) error {
		if len(args) > 1 {
			return errors.New("only a single cluster name should be specified")
		}
		if len(args) == 0 && co.clusterConfigFile == "" && co.existingClusterKubeconfig == "" {
			return errors.New("must specify a cluster name or configuration file")
		}
		return nil
	},
}

CreateCmd creates an unmanaged workload cluster.

View Source
var DeleteCmd = &cobra.Command{
	Use:   "delete <cluster name>",
	Short: "Delete an unmanaged cluster",
	Long:  deleteDesc,
	PreRunE: func(cmd *cobra.Command, args []string) (err error) {
		return nil
	},
	RunE:    destroy,
	Aliases: []string{"rm"},
	PostRunE: func(cmd *cobra.Command, args []string) (err error) {
		return nil
	},
	Args: checkSingleClusterArg,
}

DeleteCmd deletes an unmanaged workload cluster.

View Source
var ListCmd = &cobra.Command{
	Use:   "list",
	Short: "List unmanaged environments",
	Long:  listDesc,
	PreRunE: func(cmd *cobra.Command, args []string) (err error) {
		return nil
	},
	RunE:    list,
	Aliases: []string{"ls"},
	PostRunE: func(cmd *cobra.Command, args []string) (err error) {
		return nil
	},
	Args: cobra.NoArgs,
}

ListCmd returns a list of existing clusters.

View Source
var StartCmd = &cobra.Command{
	Use:   "start <cluster name>",
	Short: "(experimental) Start an unmanaged cluster",
	Long:  startDesc,
	PreRunE: func(cmd *cobra.Command, args []string) (err error) {
		return nil
	},
	RunE: start,
	PostRunE: func(cmd *cobra.Command, args []string) (err error) {
		return nil
	},
	Args: checkSingleClusterArg,
}

StartCmd starts a stopped cluster.

View Source
var StopCmd = &cobra.Command{
	Use:   "stop <cluster name>",
	Short: "(experimental) Stop an unmanaged cluster",
	Long:  stopDesc,
	PreRunE: func(cmd *cobra.Command, args []string) (err error) {
		return nil
	},
	RunE: stop,
	PostRunE: func(cmd *cobra.Command, args []string) (err error) {
		return nil
	},
	Args: checkSingleClusterArg,
}

StopCmd stops a running cluster.

Functions

func LoggingVerbosity

func LoggingVerbosity(cmd *cobra.Command) int

LoggingVerbosity will get the configured logging level for this command.

func SetupRootCommand

func SetupRootCommand(rootCmd *cobra.Command)

SetupRootCommand ensures the root cobra command is setup with our customization

func TtySetting

func TtySetting(flags *pflag.FlagSet) bool

TtySetting gets the setting to use for formatted TTY output based on whether the user explicitly set it with a command line argument, or if not, whether there is an environment variable set. If neither of these things, it will default to whether or not we detect we are running in a terminal that allows tty formatting.

Types

This section is empty.

Jump to

Keyboard shortcuts

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