set

package
v1.1.5 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2016 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCmdEnv

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

NewCmdEnv implements the OpenShift cli env command

func NewCmdProbe added in v1.1.4

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

NewCmdProbe implements the set probe 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 added in v1.1.4

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 RunEnv

func RunEnv(f *clientcmd.Factory, in io.Reader, out io.Writer, cmd *cobra.Command, args []string, envParams, filenames []string) error

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

func UpdateTriggersForObject added in v1.1.4

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
	Overwrite  bool
	Path       string
	SecretName string
	Source     string

	CreateClaim bool
	ClaimName   string
	ClaimSize   string
	ClaimMode   string

	TypeChanged bool
}

func (*AddVolumeOptions) Validate

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

type ImageChangeTrigger added in v1.1.4

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 Patch added in v1.1.4

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 added in v1.1.4

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 added in v1.1.4

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

	Filenames         []string
	ContainerSelector string
	Selector          string
	All               bool

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

	Encoder runtime.Encoder

	ShortOutput bool
	Mapper      meta.RESTMapper

	PrintObject            func(runtime.Object) error
	UpdatePodSpecForObject func(runtime.Object, func(spec *kapi.PodSpec) error) (bool, error)

	Readiness bool
	Liveness  bool
	Remove    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 added in v1.1.4

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

func (*ProbeOptions) Run added in v1.1.4

func (o *ProbeOptions) Run() error

func (*ProbeOptions) Validate added in v1.1.4

func (o *ProbeOptions) Validate() error

type TriggerDefinition added in v1.1.4

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

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

func NewBuildConfigTriggers added in v1.1.4

func NewBuildConfigTriggers(config *buildapi.BuildConfig) *TriggerDefinition

NewBuildConfigTriggers creates a trigger definition from a build config.

func NewDeploymentConfigTriggers added in v1.1.4

func NewDeploymentConfigTriggers(config *deployapi.DeploymentConfig) *TriggerDefinition

NewDeploymentConfigTriggers creates a trigger definition from a deployment config.

func (*TriggerDefinition) Apply added in v1.1.4

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

Apply writes a trigger definition back to a build or deployment config.

type TriggersOptions added in v1.1.4

type TriggersOptions 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

	PrintTable  bool
	PrintObject func(runtime.Object) error

	Remove    bool
	RemoveAll bool
	Auto      bool
	Manual    bool
	Reset     bool

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

func (*TriggersOptions) Complete added in v1.1.4

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

func (*TriggersOptions) Run added in v1.1.4

func (o *TriggersOptions) Run() error

func (*TriggersOptions) Validate added in v1.1.4

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
	RESTClientFactory      func(mapping *meta.RESTMapping) (resource.RESTClient, error)
	UpdatePodSpecForObject func(obj runtime.Object, fn func(*kapi.PodSpec) error) (bool, error)
	Client                 kclient.PersistentVolumeClaimsNamespacer

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

	// Operations
	Add    bool
	Remove bool
	List   bool

	// Common optional params
	Name          string
	Containers    string
	Confirm       bool
	Output        string
	OutputVersion unversioned.GroupVersion

	// 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(args []string) error

Jump to

Keyboard shortcuts

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