set

package
v3.7.0-alpha.0+incompa... Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2017 License: Apache-2.0 Imports: 50 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCmdBuildHook

func NewCmdBuildHook(fullName string, f *clientcmd.Factory, out, errOut io.Writer) *cobra.Command

NewCmdBuildHook implements the set build-hook command

func NewCmdBuildSecret

func NewCmdBuildSecret(fullName string, f *clientcmd.Factory, out, errOut io.Writer) *cobra.Command

NewCmdBuildSecret implements the set build-secret command

func NewCmdDeploymentHook

func NewCmdDeploymentHook(fullName string, f *clientcmd.Factory, out, errOut io.Writer) *cobra.Command

NewCmdDeploymentHook implements the set deployment-hook command

func NewCmdEnv

func NewCmdEnv(fullName string, f *clientcmd.Factory, in io.Reader, out, errout io.Writer) *cobra.Command

NewCmdEnv implements the OpenShift cli env command

func NewCmdImage

func NewCmdImage(fullName string, f *clientcmd.Factory, out, err io.Writer) *cobra.Command

NewCmdImage is a wrapper for the Kubernetes CLI set image command

func NewCmdImageLookup

func NewCmdImageLookup(fullName, parentName string, f *clientcmd.Factory, out, errOut io.Writer) *cobra.Command

NewCmdImageLookup implements the set image-lookup command

func NewCmdProbe

func NewCmdProbe(fullName string, f *clientcmd.Factory, out, errOut io.Writer) *cobra.Command

NewCmdProbe implements the set probe command

func NewCmdResources

func NewCmdResources(fullName string, f *clientcmd.Factory, out io.Writer, errOut io.Writer) *cobra.Command

NewCmdResources is a wrapper for the Kubernetes CLI set resources command

func NewCmdRouteBackends

func NewCmdRouteBackends(fullName string, f *clientcmd.Factory, out, errOut io.Writer) *cobra.Command

NewCmdRouteBackends implements the set route-backends command

func NewCmdSet

func NewCmdSet(fullName string, f *clientcmd.Factory, in io.Reader, out, errout io.Writer) *cobra.Command

NewCmdSet exposes commands for modifying objects.

func NewCmdTriggers

func NewCmdTriggers(fullName string, f *clientcmd.Factory, out, errOut io.Writer) *cobra.Command

NewCmdTriggers implements the set triggers command

func NewCmdVolume

func NewCmdVolume(fullName string, f *clientcmd.Factory, out, errOut io.Writer) *cobra.Command

func UpdateBackendsForObject

func UpdateBackendsForObject(obj runtime.Object, fn func(*Backends) error) (bool, error)

UpdateBackendsForObject extracts a backend definition array from the provided object, passes it to fn, and then applies the backend on the object. It returns true if the object was mutated and an optional error if any part of the flow returns error.

func UpdateTriggersForObject

func UpdateTriggersForObject(obj runtime.Object, fn func(*TriggerDefinition) error) (bool, error)

UpdateTriggersForObject extracts a trigger definition from the provided object, passes it to fn, and then applies the trigger definition back on the object. It returns true if the object was mutated and an optional error if the any part of the flow returns error.

Types

type AddVolumeOptions

type AddVolumeOptions struct {
	Type          string
	MountPath     string
	DefaultMode   string
	Overwrite     bool
	Path          string
	ConfigMapName string
	SecretName    string
	Source        string

	CreateClaim bool
	ClaimName   string
	ClaimSize   string
	ClaimMode   string
	ClaimClass  string

	TypeChanged bool
}

func (*AddVolumeOptions) Validate

func (a *AddVolumeOptions) Validate(isAddOp bool) error

type BackendInput

type BackendInput struct {
	// Name is the name of a service.
	Name string
	// Value is the amount to change.
	Value int32
	// Percentage means value should be interpreted as a percentage between -100 and 100, inclusive.
	Percentage bool
	// Relative means value is applied relative to the current values.
	Relative bool
}

BackendInput describes a change to a named service.

func ParseBackendInput

func ParseBackendInput(s string) (*BackendInput, error)

ParseBackendInput turns the provided input into a BackendInput or returns an error.

func (*BackendInput) Apply

func (input *BackendInput) Apply(ref, to *routeapi.RouteTargetReference, backends []routeapi.RouteTargetReference)

Apply alters the weights of two services.

type BackendTransform

type BackendTransform struct {
	// Adjust expects a single Input to transform, relative to other backends.
	Adjust bool
	// Zero sets all backend weights to zero.
	Zero bool
	// Equal means backends will be set to equal weights.
	Equal bool
	// Inputs is the desired backends.
	Inputs []BackendInput
}

BackendTransform describes the desired transformation of backends.

func (BackendTransform) Apply

func (t BackendTransform) Apply(b *Backends) error

Apply transforms the provided backends or returns an error.

func (BackendTransform) Empty

func (t BackendTransform) Empty() bool

Empty returns true if no transformations have been specified.

func (BackendTransform) Validate

func (t BackendTransform) Validate() error

Validate returns an error if the transformations are not internally consistent.

type Backends

type Backends struct {
	Backends []routeapi.RouteTargetReference
}

Backends is a struct that represents the backends to be transformed.

func (*Backends) Names

func (b *Backends) Names() []string

Names returns the referenced backend service names, in the order they appear.

type BackendsOptions

type BackendsOptions struct {
	Out io.Writer
	Err io.Writer

	Filenames []string
	Selector  string
	All       bool
	Output    string

	Cmd *cobra.Command

	Builder *resource.Builder
	Infos   []*resource.Info

	Encoder runtime.Encoder

	Local         bool
	ShortOutput   bool
	Mapper        meta.RESTMapper
	OutputVersion schema.GroupVersion

	PrintTable  bool
	PrintObject func(runtime.Object) error

	Transform BackendTransform
}

func (*BackendsOptions) Complete

func (o *BackendsOptions) Complete(f *clientcmd.Factory, cmd *cobra.Command, args []string) error

Complete takes command line information to fill out BackendOptions or returns an error.

func (*BackendsOptions) Run

func (o *BackendsOptions) Run() error

Run executes the BackendOptions or returns an error.

func (*BackendsOptions) Validate

func (o *BackendsOptions) Validate() error

Validate verifies the provided options are valid or returns an error.

type BuildHookOptions

type BuildHookOptions struct {
	Out io.Writer
	Err io.Writer

	Builder *resource.Builder
	Infos   []*resource.Info

	Encoder runtime.Encoder

	Filenames []string
	Selector  string
	All       bool
	Output    string

	Cmd *cobra.Command

	Local       bool
	ShortOutput bool
	Mapper      meta.RESTMapper

	PrintObject func([]*resource.Info) error

	Script     string
	Entrypoint bool
	Remove     bool
	PostCommit bool

	Command []string
}

func (*BuildHookOptions) Complete

func (o *BuildHookOptions) Complete(f *clientcmd.Factory, cmd *cobra.Command, args []string) error

func (*BuildHookOptions) Run

func (o *BuildHookOptions) Run() error

func (*BuildHookOptions) Validate

func (o *BuildHookOptions) Validate() error

type BuildSecretOptions

type BuildSecretOptions struct {
	Out io.Writer
	Err io.Writer

	Builder *resource.Builder
	Infos   []*resource.Info

	Encoder runtime.Encoder

	Filenames []string
	Selector  string
	All       bool

	Cmd *cobra.Command

	ShortOutput bool
	Local       bool
	Mapper      meta.RESTMapper

	Output string

	PrintObject func([]*resource.Info) error

	Secret string
	Push   bool
	Pull   bool
	Source bool
	Remove bool
}

func (*BuildSecretOptions) Complete

func (o *BuildSecretOptions) Complete(f *clientcmd.Factory, cmd *cobra.Command, args []string) error

func (*BuildSecretOptions) Run

func (o *BuildSecretOptions) Run() error

func (*BuildSecretOptions) Validate

func (o *BuildSecretOptions) Validate() error

type DeploymentHookOptions

type DeploymentHookOptions struct {
	Out io.Writer
	Err io.Writer

	Builder *resource.Builder
	Infos   []*resource.Info

	Encoder runtime.Encoder

	Filenames []string
	Container string
	Selector  string
	All       bool

	Output string

	ShortOutput bool
	Local       bool
	Mapper      meta.RESTMapper

	PrintObject func([]*resource.Info) error

	Pre    bool
	Mid    bool
	Post   bool
	Remove bool

	Cmd *cobra.Command

	Command     []string
	Environment []string
	Volumes     []string

	FailurePolicy deployapi.LifecycleHookFailurePolicy
}

func (*DeploymentHookOptions) Complete

func (o *DeploymentHookOptions) Complete(f *clientcmd.Factory, cmd *cobra.Command, args []string) error

func (*DeploymentHookOptions) Run

func (o *DeploymentHookOptions) Run() error

func (*DeploymentHookOptions) Validate

func (o *DeploymentHookOptions) Validate() error

type EnvOptions

type EnvOptions struct {
	Out io.Writer
	Err io.Writer
	In  io.Reader

	Filenames []string
	EnvParams []string
	EnvArgs   []string
	Resources []string

	All         bool
	Resolve     bool
	List        bool
	ShortOutput bool
	Local       bool
	Overwrite   bool

	ResourceVersion   string
	ContainerSelector string
	Selector          string
	Output            string
	From              string
	Prefix            string

	Builder *resource.Builder
	Infos   []*resource.Info

	Encoder runtime.Encoder

	Cmd *cobra.Command

	Mapper meta.RESTMapper

	PrintObject func([]*resource.Info) error
}

func (*EnvOptions) Complete

func (o *EnvOptions) Complete(f *clientcmd.Factory, cmd *cobra.Command, args []string) error

func (*EnvOptions) RunEnv

func (o *EnvOptions) RunEnv(f *clientcmd.Factory) error

RunEnv contains all the necessary functionality for the OpenShift cli env command TODO: refactor to share the common "patch resource" pattern of probe

type ImageChangeTrigger

type ImageChangeTrigger struct {
	// If this trigger is automatically applied
	Auto bool
	// An ImageStreamTag name to target
	From string
	// The target namespace, normalized if set
	Namespace string
	// A list of names this trigger targets
	Names []string
}

ImageChangeTrigger represents the capabilities present in deployment config and build config objects in a consistent way.

type ImageLookupOptions

type ImageLookupOptions struct {
	Out io.Writer
	Err io.Writer

	Filenames []string
	Selector  string
	All       bool

	Builder *resource.Builder
	Infos   []*resource.Info

	Encoder runtime.Encoder

	ShortOutput   bool
	Mapper        meta.RESTMapper
	OutputVersion schema.GroupVersion

	PrintTable  bool
	PrintObject func(runtime.Object) error

	List  bool
	Local bool

	Enabled bool
}

func (*ImageLookupOptions) Complete

func (o *ImageLookupOptions) Complete(f *clientcmd.Factory, cmd *cobra.Command, args []string) error

Complete takes command line information to fill out ImageLookupOptions or returns an error.

func (*ImageLookupOptions) Run

func (o *ImageLookupOptions) Run() error

Run executes the ImageLookupOptions or returns an error.

func (*ImageLookupOptions) Validate

func (o *ImageLookupOptions) Validate() error

Validate verifies the provided options are valid or returns an error.

type Patch

type Patch struct {
	Info *resource.Info
	Err  error

	Before []byte
	After  []byte
	Patch  []byte
}

Patch represents the result of a mutation to an object.

func CalculatePatches

func CalculatePatches(infos []*resource.Info, encoder runtime.Encoder, mutateFn func(*resource.Info) (bool, error)) []*Patch

CalculatePatches calls the mutation function on each provided info object, and generates a strategic merge patch for the changes in the object. Encoder must be able to encode the info into the appropriate destination type. If mutateFn returns false, the object is not included in the final list of patches.

type ProbeOptions

type ProbeOptions struct {
	Out io.Writer
	Err io.Writer

	Filenames         []string
	ContainerSelector string
	Selector          string
	All               bool
	Output            string

	Builder *resource.Builder
	Infos   []*resource.Info

	Encoder runtime.Encoder

	Cmd *cobra.Command

	ShortOutput bool
	Mapper      meta.RESTMapper

	PrintObject            func([]*resource.Info) error
	UpdatePodSpecForObject func(runtime.Object, func(spec *kapi.PodSpec) error) (bool, error)

	Readiness bool
	Liveness  bool
	Remove    bool
	Local     bool

	OpenTCPSocket string
	HTTPGet       string
	Command       []string

	FlagSet       func(string) bool
	HTTPGetAction *kapi.HTTPGetAction

	// Length of time before health checking is activated.  In seconds.
	InitialDelaySeconds *int
	// Length of time before health checking times out.  In seconds.
	TimeoutSeconds *int
	// How often (in seconds) to perform the probe.
	PeriodSeconds *int
	// Minimum consecutive successes for the probe to be considered successful after having failed.
	// Must be 1 for liveness.
	SuccessThreshold *int
	// Minimum consecutive failures for the probe to be considered failed after having succeeded.
	FailureThreshold *int
}

func (*ProbeOptions) Complete

func (o *ProbeOptions) Complete(f *clientcmd.Factory, cmd *cobra.Command, args []string) error

func (*ProbeOptions) Run

func (o *ProbeOptions) Run() error

func (*ProbeOptions) Validate

func (o *ProbeOptions) Validate() error

type TriggerDefinition

type TriggerDefinition struct {
	ConfigChange      bool
	ImageChange       []ImageChangeTrigger
	WebHooks          []string
	WebHooksAllowEnv  bool
	GitHubWebHooks    []string
	GitLabWebHooks    []string
	BitbucketWebHooks []string
}

TriggerDefinition is the abstract representation of triggers for builds and deploymnet configs.

func NewAnnotationTriggers

func NewAnnotationTriggers(obj runtime.Object) (*TriggerDefinition, error)

NewAnnotationTriggers creates a trigger definition from an object that can be triggered by the image annotation.

func NewBuildConfigTriggers

func NewBuildConfigTriggers(config *buildapi.BuildConfig) *TriggerDefinition

NewBuildConfigTriggers creates a trigger definition from a build config.

func NewDeploymentConfigTriggers

func NewDeploymentConfigTriggers(config *deployapi.DeploymentConfig) *TriggerDefinition

NewDeploymentConfigTriggers creates a trigger definition from a deployment config.

func (*TriggerDefinition) Apply

func (t *TriggerDefinition) Apply(obj runtime.Object) error

Apply writes a trigger definition back to an object.

type TriggersOptions

type TriggersOptions struct {
	Out io.Writer
	Err io.Writer

	Filenames []string
	Selector  string
	All       bool
	Output    string

	Builder *resource.Builder
	Infos   []*resource.Info

	Encoder runtime.Encoder

	Cmd *cobra.Command

	Local       bool
	ShortOutput bool
	Mapper      meta.RESTMapper

	PrintTable  bool
	PrintObject func([]*resource.Info) error

	Remove    bool
	RemoveAll bool
	Auto      bool
	Manual    bool
	Reset     bool

	ContainerNames      string
	FromConfig          bool
	FromGitHub          *bool
	FromWebHook         *bool
	FromWebHookAllowEnv *bool
	FromGitLab          *bool
	FromBitbucket       *bool
	FromImage           string
	// FromImageNamespace is the namespace for the FromImage
	FromImageNamespace string
}

func (*TriggersOptions) Complete

func (o *TriggersOptions) Complete(f *clientcmd.Factory, cmd *cobra.Command, args []string) error

func (*TriggersOptions) Run

func (o *TriggersOptions) Run() error

func (*TriggersOptions) Validate

func (o *TriggersOptions) Validate() error

type VolumeOptions

type VolumeOptions struct {
	DefaultNamespace       string
	ExplicitNamespace      bool
	Out                    io.Writer
	Err                    io.Writer
	Mapper                 meta.RESTMapper
	Typer                  runtime.ObjectTyper
	CategoryExpander       resource.CategoryExpander
	RESTClientFactory      func(mapping *meta.RESTMapping) (resource.RESTClient, error)
	UpdatePodSpecForObject func(obj runtime.Object, fn func(*kapi.PodSpec) error) (bool, error)
	Client                 kcoreclient.PersistentVolumeClaimsGetter
	Encoder                runtime.Encoder
	Cmd                    *cobra.Command

	// Resource selection
	Selector  string
	All       bool
	Filenames []string

	// Operations
	Add    bool
	Remove bool
	List   bool

	// Common optional params
	Name        string
	Containers  string
	Confirm     bool
	Local       bool
	Output      string
	PrintObject func([]*resource.Info) error

	// Add op params
	AddOpts *AddVolumeOptions
}

func (*VolumeOptions) Complete

func (v *VolumeOptions) Complete(f *clientcmd.Factory, cmd *cobra.Command, out, errOut io.Writer) error

func (*VolumeOptions) RunVolume

func (v *VolumeOptions) RunVolume(args []string) error

func (*VolumeOptions) Validate

func (v *VolumeOptions) Validate(cmd *cobra.Command, args []string) error

Jump to

Keyboard shortcuts

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