set

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2018 License: Apache-2.0 Imports: 63 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCmdBuildHook

func NewCmdBuildHook(fullName string, f kcmdutil.Factory, streams genericclioptions.IOStreams) *cobra.Command

NewCmdBuildHook implements the set build-hook command

func NewCmdBuildSecret

func NewCmdBuildSecret(fullName string, f kcmdutil.Factory, streams genericclioptions.IOStreams) *cobra.Command

NewCmdBuildSecret implements the set build-secret command

func NewCmdDeploymentHook

func NewCmdDeploymentHook(fullName string, f kcmdutil.Factory, streams genericclioptions.IOStreams) *cobra.Command

NewCmdDeploymentHook implements the set deployment-hook command

func NewCmdEnv

func NewCmdEnv(fullName string, f kcmdutil.Factory, streams genericclioptions.IOStreams) *cobra.Command

NewCmdEnv implements the OpenShift cli env command

func NewCmdImage

func NewCmdImage(fullName string, f kcmdutil.Factory, streams genericclioptions.IOStreams) *cobra.Command

NewCmdImage is a wrapper for the Kubernetes CLI set image command

func NewCmdImageLookup

func NewCmdImageLookup(fullName, parentName string, f kcmdutil.Factory, streams genericclioptions.IOStreams) *cobra.Command

NewCmdImageLookup implements the set image-lookup command

func NewCmdProbe

func NewCmdProbe(fullName string, f kcmdutil.Factory, streams genericclioptions.IOStreams) *cobra.Command

NewCmdProbe implements the set probe command

func NewCmdResources

func NewCmdResources(fullName string, f kcmdutil.Factory, streams genericclioptions.IOStreams) *cobra.Command

NewCmdResources is a wrapper for the Kubernetes CLI set resources command

func NewCmdRouteBackends

func NewCmdRouteBackends(fullName string, f kcmdutil.Factory, streams genericclioptions.IOStreams) *cobra.Command

NewCmdRouteBackends implements the set route-backends command

func NewCmdSet

func NewCmdSet(fullName string, f kcmdutil.Factory, streams genericclioptions.IOStreams) *cobra.Command

NewCmdSet exposes commands for modifying objects.

func NewCmdTriggers

func NewCmdTriggers(fullName string, f kcmdutil.Factory, streams genericclioptions.IOStreams) *cobra.Command

NewCmdTriggers implements the set triggers command

func NewCmdVolume

func NewCmdVolume(fullName string, f kcmdutil.Factory, streams genericclioptions.IOStreams) *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
	SubPath       string
	DefaultMode   string
	Overwrite     bool
	Path          string
	ConfigMapName string
	SecretName    string
	Source        string

	ReadOnly    bool
	CreateClaim bool
	ClaimName   string
	ClaimSize   string
	ClaimMode   string
	ClaimClass  string

	TypeChanged bool
}

func (*AddVolumeOptions) Complete

func (a *AddVolumeOptions) Complete() error

func (*AddVolumeOptions) Validate

func (a *AddVolumeOptions) Validate() 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 *routev1.RouteTargetReference, backends []routev1.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 []routev1.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 {
	PrintFlags *genericclioptions.PrintFlags

	Selector   string
	All        bool
	Local      bool
	PrintTable bool
	Transform  BackendTransform

	Mapper            meta.RESTMapper
	Client            dynamic.Interface
	Printer           printers.ResourcePrinter
	Builder           func() *resource.Builder
	Namespace         string
	ExplicitNamespace bool
	DryRun            bool
	Resources         []string

	resource.FilenameOptions
	genericclioptions.IOStreams
}

func NewBackendsOptions

func NewBackendsOptions(streams genericclioptions.IOStreams) *BackendsOptions

func (*BackendsOptions) Complete

func (o *BackendsOptions) Complete(f kcmdutil.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 {
	PrintFlags *genericclioptions.PrintFlags

	Selector   string
	All        bool
	Local      bool
	Script     string
	Entrypoint bool
	Remove     bool
	PostCommit bool

	Mapper            meta.RESTMapper
	Client            dynamic.Interface
	Printer           printers.ResourcePrinter
	Builder           func() *resource.Builder
	Namespace         string
	ExplicitNamespace bool
	Command           []string
	Resources         []string
	DryRun            bool

	resource.FilenameOptions
	genericclioptions.IOStreams
}

func NewBuildHookOptions

func NewBuildHookOptions(streams genericclioptions.IOStreams) *BuildHookOptions

func (*BuildHookOptions) Complete

func (o *BuildHookOptions) Complete(f kcmdutil.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 {
	PrintFlags *genericclioptions.PrintFlags

	Selector string
	All      bool
	Local    bool
	Push     bool
	Pull     bool
	Source   bool
	Remove   bool

	Mapper            meta.RESTMapper
	Client            dynamic.Interface
	Printer           printers.ResourcePrinter
	Builder           func() *resource.Builder
	Namespace         string
	ExplicitNamespace bool
	Resources         []string
	SecretArg         string
	DryRun            bool

	resource.FilenameOptions
	genericclioptions.IOStreams
}

func NewBuildSecretOptions

func NewBuildSecretOptions(streams genericclioptions.IOStreams) *BuildSecretOptions

func (*BuildSecretOptions) Complete

func (o *BuildSecretOptions) Complete(f kcmdutil.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 {
	PrintFlags *genericclioptions.PrintFlags

	Container        string
	Selector         string
	All              bool
	Local            bool
	Pre              bool
	Mid              bool
	Post             bool
	Remove           bool
	FailurePolicyStr string

	Mapper            meta.RESTMapper
	Client            dynamic.Interface
	Printer           printers.ResourcePrinter
	Builder           func() *resource.Builder
	Command           []string
	Resources         []string
	Environment       []string
	Volumes           []string
	Namespace         string
	ExplicitNamespace bool
	DryRun            bool
	FailurePolicy     appsv1.LifecycleHookFailurePolicy

	resource.FilenameOptions
	genericclioptions.IOStreams
}

func NewDeploymentHookOptions

func NewDeploymentHookOptions(streams genericclioptions.IOStreams) *DeploymentHookOptions

func (*DeploymentHookOptions) Complete

func (o *DeploymentHookOptions) Complete(f kcmdutil.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 {
	PrintFlags *genericclioptions.PrintFlags

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

	All       bool
	Resolve   bool
	List      bool
	Local     bool
	Overwrite bool
	DryRun    bool

	ResourceVersion   string
	ContainerSelector string
	Selector          string
	From              string
	Prefix            string

	UpdatePodSpecForObject polymorphichelpers.UpdatePodSpecForObjectFunc
	Builder                func() *resource.Builder
	Encoder                runtime.Encoder
	Mapper                 meta.RESTMapper
	Client                 dynamic.Interface
	KubeClient             kinternalclientset.Interface
	Printer                printers.ResourcePrinter
	Namespace              string
	ExplicitNamespace      bool

	genericclioptions.IOStreams
	resource.FilenameOptions
}

func NewEnvOptions

func NewEnvOptions(streams genericclioptions.IOStreams) *EnvOptions

func (*EnvOptions) Complete

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

func (*EnvOptions) RunEnv

func (o *EnvOptions) RunEnv() error

RunEnv contains all the necessary functionality for the OpenShift cli env command TODO: refactor to share the common "patch resource" pattern of probe TODO: figure out how we can replace this with upstream counterpart

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 {
	PrintFlags *genericclioptions.PrintFlags

	Selector   string
	All        bool
	List       bool
	Local      bool
	Enabled    bool
	PrintTable bool

	Mapper            meta.RESTMapper
	Client            dynamic.Interface
	Printer           printers.ResourcePrinter
	Builder           func() *resource.Builder
	Namespace         string
	ExplicitNamespace bool
	DryRun            bool
	Args              []string

	resource.FilenameOptions
	genericclioptions.IOStreams
}

func NewImageLookupOptions

func NewImageLookupOptions(streams genericclioptions.IOStreams) *ImageLookupOptions

func (*ImageLookupOptions) Complete

func (o *ImageLookupOptions) Complete(f kcmdutil.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

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.

func CalculatePatchesExternal

func CalculatePatchesExternal(infos []*resource.Info, mutateFn func(*resource.Info) (bool, error)) []*Patch

CalculatePatchesExternal 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 {
	PrintFlags *genericclioptions.PrintFlags

	ContainerSelector string
	Selector          string
	All               bool
	Readiness         bool
	Liveness          bool
	Remove            bool
	Local             bool
	OpenTCPSocket     string
	HTTPGet           string

	Mapper                 meta.RESTMapper
	Client                 dynamic.Interface
	Printer                printers.ResourcePrinter
	Builder                func() *resource.Builder
	Encoder                runtime.Encoder
	Namespace              string
	ExplicitNamespace      bool
	UpdatePodSpecForObject polymorphichelpers.UpdatePodSpecForObjectFunc
	Command                []string
	Resources              []string
	DryRun                 bool

	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

	resource.FilenameOptions
	genericclioptions.IOStreams
}

func NewProbeOptions

func NewProbeOptions(streams genericclioptions.IOStreams) *ProbeOptions

func (*ProbeOptions) Complete

func (o *ProbeOptions) Complete(f kcmdutil.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
	GenericWebHooks   []buildv1.WebHookTrigger
	GitHubWebHooks    []buildv1.WebHookTrigger
	GitLabWebHooks    []buildv1.WebHookTrigger
	BitbucketWebHooks []buildv1.WebHookTrigger
}

TriggerDefinition is the abstract representation of triggers for builds and deployment 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 *buildv1.BuildConfig) *TriggerDefinition

NewBuildConfigTriggers creates a trigger definition from a build config.

func NewDeploymentConfigTriggers

func NewDeploymentConfigTriggers(config *appsv1.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 {
	PrintFlags *genericclioptions.PrintFlags

	Selector            string
	All                 bool
	Local               bool
	Remove              bool
	RemoveAll           bool
	Auto                bool
	Manual              bool
	Reset               bool
	ContainerNames      string
	FromConfig          bool
	FromImage           string
	FromGitHub          *bool
	FromWebHook         *bool
	FromWebHookAllowEnv *bool
	FromGitLab          *bool
	FromBitbucket       *bool
	// FromImageNamespace is the namespace for the FromImage
	FromImageNamespace string

	PrintTable        bool
	Client            dynamic.Interface
	Printer           printers.ResourcePrinter
	Builder           func() *resource.Builder
	Namespace         string
	ExplicitNamespace bool
	DryRun            bool
	Args              []string

	resource.FilenameOptions
	genericclioptions.IOStreams
}

func NewTriggersOptions

func NewTriggersOptions(streams genericclioptions.IOStreams) *TriggersOptions

func (*TriggersOptions) Complete

func (o *TriggersOptions) Complete(f kcmdutil.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 {
	PrintFlags *genericclioptions.PrintFlags

	DefaultNamespace       string
	ExplicitNamespace      bool
	Mapper                 meta.RESTMapper
	Client                 kcoreclient.CoreInterface
	UpdatePodSpecForObject polymorphichelpers.UpdatePodSpecForObjectFunc
	Encoder                runtime.Encoder
	Builder                func() *resource.Builder

	// Resource selection
	Selector string
	All      bool

	// Operations
	Add    bool
	Remove bool
	List   bool

	// Common optional params
	Name       string
	Containers string
	Confirm    bool
	Local      bool
	Args       []string
	Printer    printers.ResourcePrinter
	DryRun     bool

	// Add op params
	AddOpts *AddVolumeOptions

	resource.FilenameOptions
	genericclioptions.IOStreams
}

func NewVolumeOptions

func NewVolumeOptions(streams genericclioptions.IOStreams) *VolumeOptions

func (*VolumeOptions) Complete

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

func (*VolumeOptions) RunVolume

func (o *VolumeOptions) RunVolume() error

func (*VolumeOptions) Validate

func (o *VolumeOptions) Validate() error

Jump to

Keyboard shortcuts

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