clicontext

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2020 License: Apache-2.0 Imports: 41 Imported by: 34

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoConfig = errors.New("Can not find rio info resource inside your cluster. Have you installed Rio?(run `rio install --help`)")

Functions

func DefaultAction

func DefaultAction(action interface{}) interface{}

func RandomName added in v0.6.0

func RandomName() string

func Wrap

func Wrap(f func(*CLIContext) error) func(context2 *cli.Context) error

Types

type CLIContext

type CLIContext struct {
	*Config
	Ctx context.Context
	CLI *cli.Context
}

func Lookup

func Lookup(data map[string]interface{}) *CLIContext

func (*CLIContext) AllNamespaceSet added in v0.6.0

func (c *CLIContext) AllNamespaceSet() bool

func (*CLIContext) ByID

func (c *CLIContext) ByID(id string) (types.Resource, error)

func (*CLIContext) Create

func (c *CLIContext) Create(obj runtime.Object) (err error)

func (*CLIContext) DeleteResource

func (c *CLIContext) DeleteResource(r types.Resource) (err error)

func (*CLIContext) Format

func (c *CLIContext) Format() string

func (*CLIContext) GetService added in v0.6.0

func (c *CLIContext) GetService(res types.Resource) (*riov1.Service, error)

func (*CLIContext) GetSetNamespace

func (c *CLIContext) GetSetNamespace() string

func (*CLIContext) GetSystemNamespace

func (c *CLIContext) GetSystemNamespace() string

func (*CLIContext) List

func (c *CLIContext) List(typeName string) (ret []runtime.Object, err error)

func (*CLIContext) ParseID added in v0.6.0

func (c *CLIContext) ParseID(id string) types.Resource

func (*CLIContext) ParseIDForType added in v0.6.0

func (c *CLIContext) ParseIDForType(id, resourceType string) types.Resource

func (*CLIContext) Quiet

func (c *CLIContext) Quiet() bool

func (*CLIContext) Rm added in v0.6.0

func (c *CLIContext) Rm(ids ...string) error

func (*CLIContext) Store

func (c *CLIContext) Store(data map[string]interface{})

func (*CLIContext) Update

func (c *CLIContext) Update(name string, updater func(obj runtime.Object) error) error

func (*CLIContext) UpdateObject

func (c *CLIContext) UpdateObject(obj runtime.Object) (err error)

func (*CLIContext) UpdateResource

func (c *CLIContext) UpdateResource(r types.Resource, updater func(obj runtime.Object) error) error

func (*CLIContext) WithWriter added in v0.3.0

func (c *CLIContext) WithWriter(writer io.Writer)

func (*CLIContext) Writer

func (c *CLIContext) Writer() io.Writer

type Config

type Config struct {
	AllNamespace        bool
	ShowSystemNamespace bool
	SystemNamespace     string
	DefaultNamespace    string
	Kubeconfig          string
	Debug               bool
	Wait                bool
	WaitTimeout         int
	WaitState           string

	Apply      apply.Apply
	RestConfig *rest.Config
	K8s        *kubernetes.Clientset

	Core       corev1.CoreV1Interface
	Apps       appsv1.AppsV1Interface
	Build      tektonv1alpha1.TektonV1alpha1Interface
	Rio        riov1.RioV1Interface
	Project    projectv1.AdminV1Interface
	Mgmt       v3.ManagementV3Interface
	Gitwatcher webhookv1.GitwatcherV1Interface

	NoPrompt bool
	Writer   io.Writer

	DebugLevel string
}

func (*Config) Domain

func (c *Config) Domain() (*v1.ClusterDomain, error)

func (*Config) Kubectl

func (c *Config) Kubectl(namespace, command string, args ...string) error

func (*Config) Validate

func (c *Config) Validate() error

Jump to

Keyboard shortcuts

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