Documentation ¶
Index ¶
- func NewCmdBuildHook(fullName string, f *clientcmd.Factory, out, errOut io.Writer) *cobra.Command
- func NewCmdBuildSecret(fullName string, f *clientcmd.Factory, out, errOut io.Writer) *cobra.Command
- func NewCmdDeploymentHook(fullName string, f *clientcmd.Factory, out, errOut io.Writer) *cobra.Command
- func NewCmdEnv(fullName string, f *clientcmd.Factory, in io.Reader, out, errout io.Writer) *cobra.Command
- func NewCmdImage(fullName string, f *clientcmd.Factory, out, err io.Writer) *cobra.Command
- func NewCmdImageLookup(fullName, parentName string, f *clientcmd.Factory, out, errOut io.Writer) *cobra.Command
- func NewCmdProbe(fullName string, f *clientcmd.Factory, out, errOut io.Writer) *cobra.Command
- func NewCmdResources(fullName string, f *clientcmd.Factory, out io.Writer, errOut io.Writer) *cobra.Command
- func NewCmdRouteBackends(fullName string, f *clientcmd.Factory, out, errOut io.Writer) *cobra.Command
- func NewCmdSet(fullName string, f *clientcmd.Factory, in io.Reader, out, errout io.Writer) *cobra.Command
- func NewCmdTriggers(fullName string, f *clientcmd.Factory, out, errOut io.Writer) *cobra.Command
- func NewCmdVolume(fullName string, f *clientcmd.Factory, out, errOut io.Writer) *cobra.Command
- func UpdateBackendsForObject(obj runtime.Object, fn func(*Backends) error) (bool, error)
- func UpdateTriggersForObject(obj runtime.Object, fn func(*TriggerDefinition) error) (bool, error)
- type AddVolumeOptions
- type BackendInput
- type BackendTransform
- type Backends
- type BackendsOptions
- type BuildHookOptions
- type BuildSecretOptions
- type DeploymentHookOptions
- type EnvOptions
- type ImageChangeTrigger
- type ImageLookupOptions
- type Patch
- type ProbeOptions
- type TriggerDefinition
- type TriggersOptions
- type VolumeOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCmdBuildHook ¶
NewCmdBuildHook implements the set build-hook command
func NewCmdBuildSecret ¶
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 ¶
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 ¶
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 ¶
NewCmdTriggers implements the set triggers command
func NewCmdVolume ¶
func UpdateBackendsForObject ¶
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 ¶
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.
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 ¶
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) 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) 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) 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 }
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 ¶
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) 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.
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) 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) RunVolume ¶
func (v *VolumeOptions) RunVolume(args []string) error