kubernetes: k8s.io/kubernetes/pkg/kubectl/cmd/set Index | Files | Directories

package set

import "k8s.io/kubernetes/pkg/kubectl/cmd/set"

Index

Package Files

helper.go set.go set_env.go set_image.go set_resources.go set_selector.go set_serviceaccount.go set_subject.go

func CalculatePatch Uses

func CalculatePatch(patch *Patch, encoder runtime.Encoder, mutateFn PatchFn) bool

CalculatePatch calls the mutation function on the 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. This function returns whether the mutation function made any change in the original object.

func NewCmdEnv Uses

func NewCmdEnv(f cmdutil.Factory, streams genericclioptions.IOStreams) *cobra.Command

NewCmdEnv implements the OpenShift cli env command

func NewCmdImage Uses

func NewCmdImage(f cmdutil.Factory, streams genericclioptions.IOStreams) *cobra.Command

NewCmdImage returns an initialized Command instance for the 'set image' sub command

func NewCmdResources Uses

func NewCmdResources(f cmdutil.Factory, streams genericclioptions.IOStreams) *cobra.Command

NewCmdResources returns initialized Command instance for the 'set resources' sub command

func NewCmdSelector Uses

func NewCmdSelector(f cmdutil.Factory, streams genericclioptions.IOStreams) *cobra.Command

NewCmdSelector is the "set selector" command.

func NewCmdServiceAccount Uses

func NewCmdServiceAccount(f cmdutil.Factory, streams genericclioptions.IOStreams) *cobra.Command

NewCmdServiceAccount returns the "set serviceaccount" command.

func NewCmdSet Uses

func NewCmdSet(f cmdutil.Factory, streams genericclioptions.IOStreams) *cobra.Command

NewCmdSet returns an initialized Command instance for 'set' sub command

func NewCmdSubject Uses

func NewCmdSubject(f cmdutil.Factory, streams genericclioptions.IOStreams) *cobra.Command

NewCmdSubject returns the "new subject" sub command

type EnvOptions Uses

type EnvOptions struct {
    PrintFlags *genericclioptions.PrintFlags
    resource.FilenameOptions

    EnvParams         []string
    All               bool
    Resolve           bool
    List              bool
    Local             bool
    Overwrite         bool
    ContainerSelector string
    Selector          string
    From              string
    Prefix            string
    Keys              []string

    PrintObj printers.ResourcePrinterFunc

    genericclioptions.IOStreams
    // contains filtered or unexported fields
}

EnvOptions holds values for 'set env' command-lone options

func NewEnvOptions Uses

func NewEnvOptions(streams genericclioptions.IOStreams) *EnvOptions

NewEnvOptions returns an EnvOptions indicating all containers in the selected pod templates are selected by default and allowing environment to be overwritten

func (*EnvOptions) Complete Uses

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

Complete completes all required options

func (*EnvOptions) RunEnv Uses

func (o *EnvOptions) RunEnv() error

RunEnv contains all the necessary functionality for the OpenShift cli env command

func (*EnvOptions) Validate Uses

func (o *EnvOptions) Validate() error

Validate makes sure provided values for EnvOptions are valid

type ImageResolver Uses

type ImageResolver func(in string) (string, error)

ImageResolver is a func that receives an image name, and resolves it to an appropriate / compatible image name. Adds flexibility for future image resolving methods.

type Patch Uses

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 Uses

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

CalculatePatches calculates patches on each provided info object. If the provided mutateFn makes no change in an object, the object is not included in the final list of patches.

type PatchFn Uses

type PatchFn func(runtime.Object) ([]byte, error)

PatchFn is a function type that accepts an info object and returns a byte slice. Implementations of PatchFn should update the object and return it encoded.

type SetImageOptions Uses

type SetImageOptions struct {
    resource.FilenameOptions

    PrintFlags  *genericclioptions.PrintFlags
    RecordFlags *genericclioptions.RecordFlags

    Infos        []*resource.Info
    Selector     string
    DryRun       bool
    All          bool
    Output       string
    Local        bool
    ResolveImage ImageResolver

    PrintObj printers.ResourcePrinterFunc
    Recorder genericclioptions.Recorder

    UpdatePodSpecForObject polymorphichelpers.UpdatePodSpecForObjectFunc
    Resources              []string
    ContainerImages        map[string]string

    genericclioptions.IOStreams
}

ImageOptions is the start of the data required to perform the operation. As new fields are added, add them here instead of referencing the cmd.Flags()

func NewImageOptions Uses

func NewImageOptions(streams genericclioptions.IOStreams) *SetImageOptions

NewImageOptions returns an initialized SetImageOptions instance

func (*SetImageOptions) Complete Uses

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

Complete completes all required options

func (*SetImageOptions) Run Uses

func (o *SetImageOptions) Run() error

Run performs the execution of 'set image' sub command

func (*SetImageOptions) Validate Uses

func (o *SetImageOptions) Validate() error

Validate makes sure provided values in SetImageOptions are valid

type SetResourcesOptions Uses

type SetResourcesOptions struct {
    resource.FilenameOptions

    PrintFlags  *genericclioptions.PrintFlags
    RecordFlags *genericclioptions.RecordFlags

    Infos             []*resource.Info
    Selector          string
    ContainerSelector string
    Output            string
    All               bool
    Local             bool

    DryRun bool

    PrintObj printers.ResourcePrinterFunc
    Recorder genericclioptions.Recorder

    Limits               string
    Requests             string
    ResourceRequirements v1.ResourceRequirements

    UpdatePodSpecForObject polymorphichelpers.UpdatePodSpecForObjectFunc
    Resources              []string

    genericclioptions.IOStreams
}

SetResourcesOptions is the start of the data required to perform the operation. As new fields are added, add them here instead of referencing the cmd.Flags

func NewResourcesOptions Uses

func NewResourcesOptions(streams genericclioptions.IOStreams) *SetResourcesOptions

NewResourcesOptions returns a ResourcesOptions indicating all containers in the selected pod templates are selected by default.

func (*SetResourcesOptions) Complete Uses

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

Complete completes all required options

func (*SetResourcesOptions) Run Uses

func (o *SetResourcesOptions) Run() error

Run performs the execution of 'set resources' sub command

func (*SetResourcesOptions) Validate Uses

func (o *SetResourcesOptions) Validate() error

Validate makes sure that provided values in ResourcesOptions are valid

type SetSelectorOptions Uses

type SetSelectorOptions struct {
    // Bound
    ResourceBuilderFlags *genericclioptions.ResourceBuilderFlags
    PrintFlags           *genericclioptions.PrintFlags
    RecordFlags          *genericclioptions.RecordFlags

    // computed
    WriteToServer  bool
    PrintObj       printers.ResourcePrinterFunc
    Recorder       genericclioptions.Recorder
    ResourceFinder genericclioptions.ResourceFinder

    // set at initialization
    genericclioptions.IOStreams
    // contains filtered or unexported fields
}

SetSelectorOptions is the start of the data required to perform the operation. As new fields are added, add them here instead of referencing the cmd.Flags()

func NewSelectorOptions Uses

func NewSelectorOptions(streams genericclioptions.IOStreams) *SetSelectorOptions

NewSelectorOptions returns an initialized SelectorOptions instance

func (*SetSelectorOptions) Complete Uses

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

Complete assigns the SelectorOptions from args.

func (*SetSelectorOptions) RunSelector Uses

func (o *SetSelectorOptions) RunSelector() error

RunSelector executes the command.

func (*SetSelectorOptions) Validate Uses

func (o *SetSelectorOptions) Validate() error

Validate basic inputs

type SetServiceAccountOptions Uses

type SetServiceAccountOptions struct {
    PrintFlags  *genericclioptions.PrintFlags
    RecordFlags *genericclioptions.RecordFlags

    PrintObj printers.ResourcePrinterFunc
    Recorder genericclioptions.Recorder

    genericclioptions.IOStreams
    // contains filtered or unexported fields
}

SetServiceAccountOptions encapsulates the data required to perform the operation.

func NewSetServiceAccountOptions Uses

func NewSetServiceAccountOptions(streams genericclioptions.IOStreams) *SetServiceAccountOptions

NewSetServiceAccountOptions returns an initialized SetServiceAccountOptions instance

func (*SetServiceAccountOptions) Complete Uses

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

Complete configures serviceAccountConfig from command line args.

func (*SetServiceAccountOptions) Run Uses

func (o *SetServiceAccountOptions) Run() error

Run creates and applies the patch either locally or calling apiserver.

type SubjectOptions Uses

type SubjectOptions struct {
    PrintFlags *genericclioptions.PrintFlags

    resource.FilenameOptions

    Infos             []*resource.Info
    Selector          string
    ContainerSelector string
    Output            string
    All               bool
    DryRun            bool
    Local             bool

    Users           []string
    Groups          []string
    ServiceAccounts []string

    PrintObj printers.ResourcePrinterFunc

    genericclioptions.IOStreams
    // contains filtered or unexported fields
}

SubjectOptions is the start of the data required to perform the operation. As new fields are added, add them here instead of referencing the cmd.Flags

func NewSubjectOptions Uses

func NewSubjectOptions(streams genericclioptions.IOStreams) *SubjectOptions

NewSubjectOptions returns an initialized SubjectOptions instance

func (*SubjectOptions) Complete Uses

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

Complete completes all required options

func (*SubjectOptions) Run Uses

func (o *SubjectOptions) Run(fn updateSubjects) error

Run performs the execution of "set subject" sub command

func (*SubjectOptions) Validate Uses

func (o *SubjectOptions) Validate() error

Validate makes sure provided values in SubjectOptions are valid

Directories

PathSynopsis
envPackage env provides functions to incorporate environment variables into set env.

Package set imports 28 packages (graph) and is imported by 59 packages. Updated 2019-06-25. Refresh now. Tools for package owners.