installer

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

------------------------------------------------------------ Copyright (c) Microsoft Corporation and Dapr Contributors. Licensed under the MIT License. ------------------------------------------------------------

Index

Constants

View Source
const UserHelpExample = `` /* 261-byte string literal not displayed */

Variables

View Source
var InstallerCmd = &cobra.Command{
	Use:     "installer",
	Short:   "Installer manage.",
	Example: UserHelpExample,
	Run: func(cmd *cobra.Command, args []string) {

		if len(args) == 0 {
			cmd.Help()
			os.Exit(1)
		}
	},
}
View Source
var InstallerInfoCmd = &cobra.Command{
	Use:   "show",
	Short: "Show installer.",
	Example: `
# Show the specified installer
tkeel installer show <repo-name>/<installer-id>@v<version>
`,
	Run: func(cmd *cobra.Command, args []string) {
		if len(args) != 1 {
			print.WarningStatusEvent(os.Stdout, "Please specify installer info")
			print.WarningStatusEvent(os.Stdout, "For example, tkeel installer show <repo-name>/<installer-id>[@<version>]")
			os.Exit(1)
		}
		tkeelRepo, installer, version := utils.ParseInstallArg(args[0], officialRepo)
		data, err := kubernetes.InstallerInfo(tkeelRepo, installer, version)
		if err != nil {
			print.FailureStatusEvent(os.Stdout, err.Error())
			os.Exit(1)
		}
		table, err := gocsv.MarshalString(data)
		if err != nil {
			print.FailureStatusEvent(os.Stdout, err.Error())
			os.Exit(1)
		}
		fmtutil.PrintTable(table)
	},
}
View Source
var InstallerListCmd = &cobra.Command{
	Use:   "list",
	Short: "List installer in repository.",
	Example: `
# List the installer for the specified repository
tkeel installer list -r <repo-name>

# List the installers for all repositories
tkeel installer list --all
`,
	Run: func(cmd *cobra.Command, args []string) {
		if repo != "" {
			data, err := kubernetes.InstallerList(repo)
			if err != nil {
				print.FailureStatusEvent(os.Stdout, err.Error())
				os.Exit(1)
			}
			table, err := gocsv.MarshalString(data)
			if err != nil {
				print.FailureStatusEvent(os.Stdout, err.Error())
				os.Exit(1)
			}
			fmtutil.PrintTable(table)
			return
		}
		if all {
			data, err := kubernetes.InstallerListAll()
			if err != nil {
				print.FailureStatusEvent(os.Stdout, err.Error())
				os.Exit(1)
			}
			table, err := gocsv.MarshalString(data)
			if err != nil {
				print.FailureStatusEvent(os.Stdout, err.Error())
				os.Exit(1)
			}
			fmtutil.PrintTable(table)
			return
		}
		cmd.Help()
	},
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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