addon

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2021 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultConfigFile is config filename
	DefaultConfigFile string = "config.yaml"

	// TokenMinLength is 24
	TokenMinLength int = 24

	// DefaultLogLevel is 2
	DefaultLogLevel string = "2"

	// TODO(joshrosso): workaround so policy file does not need to be on user's machine.
	//                  get rid of this eventually
	StaticPolicy string = `` /* 255-byte string literal not displayed */

)

Variables

View Source
var (
	// ErrMissingToken is missing GitHub token
	ErrMissingToken = errors.New("missing GitHub token")
	// ErrMissingPackageName is missing extension name
	ErrMissingPackageName = errors.New("missing package name")

	// ErrMissingOperation is missing operation
	ErrMissingOperation = errors.New("missing sub operation or command")
	// ErrMissingParameter is missing a required parameter
	ErrMissingParameter = errors.New("missing a required parameter")
)
View Source
var ConfigureCmd = &cobra.Command{
	Use:   "configure <package name>",
	Short: "Configure a package by downloading its configuration",
	PreRunE: func(cmd *cobra.Command, args []string) (err error) {
		mgr, err = NewManager()
		return err
	},
	RunE: configure,
	Args: cobra.ExactArgs(1),
}

ConfigureCmd represents the tanzu package configure command. It resolves the desired package and downloads the imgpkg bundle from the OCI repository. It then unpacks the values failes, which a user can modify.

View Source
var DeleteCmd = &cobra.Command{
	Use:   "delete <extension name>",
	Short: "Delete an installed package from the cluster, terminating it",
	PreRunE: func(cmd *cobra.Command, args []string) (err error) {
		mgr, err = NewManager()
		return err
	},
	RunE: deleteCmd,
	Args: cobra.ExactArgs(1),
}

DeleteCmd represents the delete command

View Source
var DeleteRepoCmd = &cobra.Command{
	Use:   "delete [repo name] or --file <filename>",
	Short: "Deletes a repository of packages from the cluster",
	RunE:  deleteRepository,
	PreRunE: func(cmd *cobra.Command, args []string) (err error) {
		mgr, err = NewManager()
		return err
	},
}

DeleteRepoCmd deletes a repository.

View Source
var InstallCmd = &cobra.Command{
	Use:   "install <package name>",
	Short: "Install a package into the cluster",
	PreRunE: func(cmd *cobra.Command, args []string) (err error) {
		mgr, err = NewManager()
		return err
	},
	RunE: install,
	Args: cobra.ExactArgs(1),
}

InstallCmd represents the tanzu package install command. It receives an package name and (optional) version. It then looks up the corresponding Package CR to verify there is something to install. If the corresponding Package CR resolves, an InstalledPacakge CR is create and deployed into the cluster.

View Source
var InstallRepoCmd = &cobra.Command{
	Use:   "install",
	Short: "Installs a package repository into the cluster",
	PreRunE: func(cmd *cobra.Command, args []string) (err error) {
		mgr, err = NewManager()
		return err
	},
	RunE: installRepository,
}

InstallRepoCmd adds a repository.

View Source
var ListCmd = &cobra.Command{
	Use:   "list",
	Short: "List packages available in the cluster",
	PreRunE: func(cmd *cobra.Command, args []string) (err error) {
		mgr, err = NewManager()
		return err
	},
	RunE: list,
}

ListCmd represents the list command

View Source
var ListRepoCmd = &cobra.Command{
	Use:   "list",
	Short: "Lists all repositories installed in the cluster",
	PreRunE: func(cmd *cobra.Command, args []string) (err error) {
		mgr, err = NewManager()
		return err
	},
	RunE: listRepository,
}

ListRepoCmd lists all repositories

View Source
var RepositoryCmd = &cobra.Command{
	Use:   "repository",
	Short: "Manage repositories for packages",
}

RepositoryCmd represents the repository command

Functions

func GetDebugLevel

func GetDebugLevel(s string) string

GetDebugLevel default is 2 (aka DefaultLogLevel)

Types

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager encapsulates everything about how to manage extensions

func NewManager

func NewManager() (*Manager, error)

NewManager generates a Manager object

Jump to

Keyboard shortcuts

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