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 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 RunEnv(f *clientcmd.Factory, in io.Reader, out, errout io.Writer, cmd *cobra.Command, ...) error
- 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 ImageChangeTrigger
- type Patch
- type ProbeOptions
- type TriggerDefinition
- type TriggersOptions
- type VolumeOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCmdBuildHook ¶ added in v1.3.0
NewCmdBuildHook implements the set build-hook command
func NewCmdBuildSecret ¶ added in v1.4.0
NewCmdBuildSecret implements the set build-secret command
func NewCmdDeploymentHook ¶ added in v1.3.0
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 ¶ added in v1.4.0
NewCmdImage is a wrapper for the Kubernetes CLI set image command
func NewCmdProbe ¶ added in v1.1.4
NewCmdProbe implements the set probe command
func NewCmdResources ¶ added in v1.4.0
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 ¶ added in v1.3.0
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 ¶ added in v1.1.4
NewCmdTriggers implements the set triggers command
func NewCmdVolume ¶
func RunEnv ¶
func RunEnv(f *clientcmd.Factory, in io.Reader, out, errout 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 UpdateBackendsForObject ¶ added in v1.3.0
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 ¶ added in v1.1.4
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 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 ¶ added in v1.3.0
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 ¶ added in v1.3.0
func ParseBackendInput(s string) (*BackendInput, error)
ParseBackendInput turns the provided input into a BackendInput or returns an error.
func (*BackendInput) Apply ¶ added in v1.3.0
func (input *BackendInput) Apply(ref, to *routeapi.RouteTargetReference, backends []routeapi.RouteTargetReference)
Apply alters the weights of two services.
type BackendTransform ¶ added in v1.3.0
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 ¶ added in v1.3.0
func (t BackendTransform) Apply(b *Backends) error
Apply transforms the provided backends or returns an error.
func (BackendTransform) Empty ¶ added in v1.3.0
func (t BackendTransform) Empty() bool
Empty returns true if no transformations have been specified.
func (BackendTransform) Validate ¶ added in v1.3.0
func (t BackendTransform) Validate() error
Validate returns an error if the transformations are not internally consistent.
type Backends ¶ added in v1.3.0
type Backends struct {
Backends []routeapi.RouteTargetReference
}
Backends is a struct that represents the backends to be transformed.
type BackendsOptions ¶ added in v1.3.0
type BackendsOptions 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 unversioned.GroupVersion PrintTable bool PrintObject func(runtime.Object) error Transform BackendTransform }
func (*BackendsOptions) Complete ¶ added in v1.3.0
Complete takes command line information to fill out BackendOptions or returns an error.
func (*BackendsOptions) Run ¶ added in v1.3.0
func (o *BackendsOptions) Run() error
Run executes the BackendOptions or returns an error.
func (*BackendsOptions) Validate ¶ added in v1.3.0
func (o *BackendsOptions) Validate() error
Validate verifies the provided options are valid or returns an error.
type BuildHookOptions ¶ added in v1.3.0
type BuildHookOptions struct { Out io.Writer Err io.Writer Builder *resource.Builder Infos []*resource.Info Encoder runtime.Encoder OutputVersion unversioned.GroupVersion Filenames []string Selector string All bool ShortOutput bool Mapper meta.RESTMapper PrintObject func([]*resource.Info) error Script string Entrypoint bool Remove bool PostCommit bool Command []string }
func (*BuildHookOptions) Run ¶ added in v1.3.0
func (o *BuildHookOptions) Run() error
func (*BuildHookOptions) Validate ¶ added in v1.3.0
func (o *BuildHookOptions) Validate() error
type BuildSecretOptions ¶ added in v1.4.0
type BuildSecretOptions struct { Out io.Writer Err io.Writer Builder *resource.Builder Infos []*resource.Info Encoder runtime.Encoder OutputVersion unversioned.GroupVersion Filenames []string Selector string All bool ShortOutput bool Local bool Mapper meta.RESTMapper PrintObject func([]*resource.Info) error Secret string Push bool Pull bool Source bool Remove bool }
func (*BuildSecretOptions) Run ¶ added in v1.4.0
func (o *BuildSecretOptions) Run() error
func (*BuildSecretOptions) Validate ¶ added in v1.4.0
func (o *BuildSecretOptions) Validate() error
type DeploymentHookOptions ¶ added in v1.3.0
type DeploymentHookOptions struct { Out io.Writer Err io.Writer Builder *resource.Builder Infos []*resource.Info Encoder runtime.Encoder OutputVersion unversioned.GroupVersion Filenames []string Container string Selector string All bool ShortOutput bool Local bool Mapper meta.RESTMapper PrintObject func([]*resource.Info) error Pre bool Mid bool Post bool Remove bool Command []string Environment []string Volumes []string FailurePolicy deployapi.LifecycleHookFailurePolicy }
func (*DeploymentHookOptions) Run ¶ added in v1.3.0
func (o *DeploymentHookOptions) Run() error
func (*DeploymentHookOptions) Validate ¶ added in v1.3.0
func (o *DeploymentHookOptions) Validate() 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
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 OutputVersion unversioned.GroupVersion PrintObject func([]*resource.Info) 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) 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 WebHooksAllowEnv bool 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.
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 OutputVersion unversioned.GroupVersion 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 FromImage string // FromImageNamespace is the namespace for the FromImage FromImageNamespace string }
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 Encoder runtime.Encoder // 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 PrintObject func([]*resource.Info) error OutputVersion unversioned.GroupVersion // Add op params AddOpts *AddVolumeOptions }
func (*VolumeOptions) RunVolume ¶
func (v *VolumeOptions) RunVolume(args []string) error