cli

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2019 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

View Source
const ASCIILogo1 = `` /* 235-byte string literal not displayed */

ASCIILogo1 is an ascii logo of noobaa

View Source
const ASCIILogo2 = `` /* 244-byte string literal not displayed */

ASCIILogo2 is an ascii logo of noobaa

Variables

This section is empty.

Functions

func CurrentNamespace

func CurrentNamespace() string

func ForEachCommand

func ForEachCommand(cmd *cobra.Command, handler func(c *cobra.Command))

ForEachCommand recursivly visits all subcommands

Types

type CLI

type CLI struct {
	Client client.Client
	Ctx    context.Context
	Log    *logrus.Entry

	Namespace        string
	SystemName       string
	StorageClassName string
	NooBaaImage      string
	OperatorImage    string
	ImagePullSecret  string

	// Commands
	Cmd          *cobra.Command
	CmdOptions   *cobra.Command
	CmdVersion   *cobra.Command
	CmdInstall   *cobra.Command
	CmdUninstall *cobra.Command
	CmdStatus    *cobra.Command
	CmdBucket    *cobra.Command
	CmdCrd       *cobra.Command
	CmdOlmHub    *cobra.Command
	CmdOlmLocal  *cobra.Command
	CmdOperator  *cobra.Command
	CmdSystem    *cobra.Command
}

CLI is the common tools used for most of this binary's commands. It creates the command structure and defines all the methods that implement the CLI commands.

func New

func New() *CLI

func (*CLI) BucketCreate

func (cli *CLI) BucketCreate(args []string)

BucketCreate runs a CLI command

func (*CLI) BucketDelete

func (cli *CLI) BucketDelete(args []string)

BucketDelete runs a CLI command

func (*CLI) BucketList

func (cli *CLI) BucketList()

BucketList runs a CLI command

func (*CLI) CrdIsReady added in v1.0.1

func (cli *CLI) CrdIsReady(crd *apiextv1beta1.CustomResourceDefinition) (bool, error)

CrdIsReady checks the status of a CRD

func (*CLI) CrdsCreate

func (cli *CLI) CrdsCreate()

CrdsCreate runs a CLI command

func (*CLI) CrdsDelete

func (cli *CLI) CrdsDelete()

CrdsDelete runs a CLI command

func (*CLI) CrdsStatus

func (cli *CLI) CrdsStatus()

CrdsStatus runs a CLI command

func (*CLI) CrdsWaitReady

func (cli *CLI) CrdsWaitReady()

CrdsWaitReady waits for all CRDs to be ready

func (*CLI) CrdsYaml

func (cli *CLI) CrdsYaml()

CrdsYaml dumps a combined yaml of all the CRDs from the bundled yamls

func (*CLI) GetNBClient

func (cli *CLI) GetNBClient() nb.Client

GetNBClient is a CLI common tool that loads the mgmt api details from the system. It gets the endpoint address and token from the system status and secret that the operator creates for the system.

func (*CLI) HubInstall

func (cli *CLI) HubInstall()

func (*CLI) HubStatus

func (cli *CLI) HubStatus()

func (*CLI) HubUninstall

func (cli *CLI) HubUninstall()

func (*CLI) Install

func (cli *CLI) Install()

func (*CLI) LoadCrds added in v1.0.1

func (cli *CLI) LoadCrds() *Crds

LoadCrds loads the CRDs structures from the bundled yamls

func (*CLI) LoadSystemDefaults added in v1.0.1

func (cli *CLI) LoadSystemDefaults() *nbv1.NooBaa

LoadSystemDefaults loads a noobaa system CR from bundled yamls and apply's changes from CLI flags to the defaults.

func (*CLI) OperatorInstall

func (cli *CLI) OperatorInstall()

func (*CLI) OperatorLocalInstall

func (cli *CLI) OperatorLocalInstall()

func (*CLI) OperatorLocalReconcile

func (cli *CLI) OperatorLocalReconcile()

func (*CLI) OperatorLocalUninstall

func (cli *CLI) OperatorLocalUninstall()

func (*CLI) OperatorStatus

func (cli *CLI) OperatorStatus()

func (*CLI) OperatorUninstall

func (cli *CLI) OperatorUninstall()

func (*CLI) OperatorYamls

func (cli *CLI) OperatorYamls()

func (*CLI) Run

func (cli *CLI) Run()

Run the CLI - the main

func (*CLI) Status

func (cli *CLI) Status()

func (*CLI) SystemCreate

func (cli *CLI) SystemCreate()

SystemCreate runs a CLI command

func (*CLI) SystemDelete

func (cli *CLI) SystemDelete()

SystemDelete runs a CLI command

func (*CLI) SystemList

func (cli *CLI) SystemList()

SystemList runs a CLI command

func (*CLI) SystemStatus

func (cli *CLI) SystemStatus()

SystemStatus runs a CLI command

func (*CLI) SystemWaitReady

func (cli *CLI) SystemWaitReady()

SystemWaitReady waits until the system phase changes to ready by the operator

func (*CLI) SystemYaml

func (cli *CLI) SystemYaml()

SystemYaml runs a CLI command

func (*CLI) Uninstall

func (cli *CLI) Uninstall()

func (*CLI) Version

func (cli *CLI) Version()

type Crds

Crds is the

type HubConf

type HubConf struct {
	Objects []*unstructured.Unstructured
}

type OperatorConf

type OperatorConf struct {
	NS                 *corev1.Namespace
	SA                 *corev1.ServiceAccount
	Role               *rbacv1.Role
	RoleBinding        *rbacv1.RoleBinding
	ClusterRole        *rbacv1.ClusterRole
	ClusterRoleBinding *rbacv1.ClusterRoleBinding
	Deployment         *appsv1.Deployment
}

type Runnable

type Runnable func(cmd *cobra.Command, args []string)

Runnable is the type of cobra.Command.Run

func ToRunnable

func ToRunnable(f func()) Runnable

ToRunnable adapts functions to Runnable

func ToRunnableArgs

func ToRunnableArgs(f func(args []string)) Runnable

ToRunnableArgs adapts functions to Runnable

Jump to

Keyboard shortcuts

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