commands

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2020 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Overview

Package commands contains the implementation of all qbec commands.

Index

Constants

View Source
const (

	// BashCompletionFunc contains all the custom bash functions that are
	// used to generate dynamic completion lists to extend the completion
	// capabilities
	BashCompletionFunc = `` /* 1030-byte string literal not displayed */

)

Variables

This section is empty.

Functions

func ForceOptionsConfig added in v0.9.0

func ForceOptionsConfig(cmd *cobra.Command, prefix string) func() ForceOptions

ForceOptionsConfig adds flags to the supplied root command and returns forced options.

func IsRuntimeError

func IsRuntimeError(err error) bool

IsRuntimeError returns if the supplied error was a runtime error as opposed to an error arising out of user input.

func NewRuntimeError added in v0.6.6

func NewRuntimeError(err error) error

NewRuntimeError returns a runtime error

func Setup

func Setup(root *cobra.Command, cp ConfigProvider)

Setup sets up all subcommands for the supplied root command.

Types

type Client

type Client interface {
	DisplayName(o model.K8sMeta) string
	IsNamespaced(kind schema.GroupVersionKind) (bool, error)
	Get(obj model.K8sMeta) (*unstructured.Unstructured, error)
	Sync(obj model.K8sLocalObject, opts remote.SyncOptions) (*remote.SyncResult, error)
	ValidatorFor(gvk schema.GroupVersionKind) (k8smeta.Validator, error)
	ListObjects(scope remote.ListQueryConfig) (remote.Collection, error)
	Delete(model.K8sMeta, remote.DeleteOptions) (*remote.SyncResult, error)
	ObjectKey(obj model.K8sMeta) string
	ResourceInterface(obj schema.GroupVersionKind, namespace string) (dynamic.ResourceInterface, error)
}

Client encapsulates all remote operations needed for the superset of all commands.

type Config added in v0.6.2

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

Config is the command configuration.

func (Config) App added in v0.6.2

func (c Config) App() *model.App

App returns the application object loaded for this run.

func (Config) Client added in v0.6.2

func (c Config) Client(env string) (Client, error)

Client returns a client for the supplied environment

func (Config) Colorize added in v0.6.2

func (c Config) Colorize() bool

Colorize returns true if output needs to be colorized.

func (Config) Confirm added in v0.6.2

func (c Config) Confirm(context string) error

Confirm prompts for confirmation if needed.

func (Config) EvalConcurrency added in v0.6.2

func (c Config) EvalConcurrency() int

EvalConcurrency returns the concurrency to be used for evaluating components.

func (Config) EvalContext added in v0.6.2

func (c Config) EvalContext(env string, props map[string]interface{}) eval.Context

EvalContext returns the evaluation context for the supplied environment.

func (Config) KubeAttributes added in v0.7.1

func (c Config) KubeAttributes(env string) (*remote.KubeAttributes, error)

KubeAttributes returns the kubernetes attributes for the supplied environment

func (Config) Stderr added in v0.7.2

func (c Config) Stderr() io.Writer

Stderr returns the standard error configured for the command.

func (Config) Stdout added in v0.6.2

func (c Config) Stdout() io.Writer

Stdout returns the standard output configured for the command.

func (Config) Verbosity added in v0.6.2

func (c Config) Verbosity() int

Verbosity returns the log verbosity level

type ConfigFactory added in v0.6.2

type ConfigFactory struct {
	Stdout          io.Writer //standard output for command
	Stderr          io.Writer // standard error for command
	SkipConfirm     bool      // do not prompt for confirmation
	Colors          bool      // show colorized output
	EvalConcurrency int       // concurrency of eval operations
	Verbosity       int       // verbosity level
	StrictVars      bool      // strict mode for variable evaluation
}

ConfigFactory provides a config.

func (ConfigFactory) Config added in v0.6.2

func (cp ConfigFactory) Config(app *model.App, vmConfig vm.Config, remoteConfig *remote.Config, forceOpts ForceOptions) (*Config, error)

Config returns the command configuration.

type ConfigProvider added in v0.6.2

type ConfigProvider func() *Config

ConfigProvider provides standard configuration available to all commands

type ForceOptions added in v0.9.0

type ForceOptions struct {
	K8sContext   string // override kubernetes context
	K8sNamespace string // override kubernetes default namespace
}

ForceOptions are options that override qbec safety features and disregard configuration in qbec.yaml.

Jump to

Keyboard shortcuts

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