kubernetes: github.com/bobintornado/kubernetes/pkg/kubectl Index | Files | Directories

package kubectl

import "github.com/bobintornado/kubernetes/pkg/kubectl"

Package kubectl is a set of libraries that are used by the kubectl command line tool. They are separated out into a library to support unit testing. Most functionality should be included in this package, and the main kubectl should really just be an entry point.

A set of common functions needed by cmd/kubectl and pkg/kubectl packages.

Index

Package Files

apply.go autoscale.go bash_comp_utils.go configmap.go custom_column_printer.go describe.go doc.go explain.go generate.go history.go interfaces.go kubectl.go namespace.go proxy_server.go resource_printer.go rollback.go rolling_updater.go rollout_status.go run.go scale.go secret.go secret_for_docker_registry.go service.go serviceaccount.go sorted_event_list.go sorted_resource_name_list.go sorting_printer.go stop.go version.go watchloop.go

Constants

const (
    DefaultHostAcceptRE   = "^localhost$,^127\\.0\\.0\\.1$,^\\[::1\\]$"
    DefaultPathAcceptRE   = "^/.*"
    DefaultPathRejectRE   = "^/api/.*/exec,^/api/.*/run,^/api/.*/attach"
    DefaultMethodRejectRE = "POST,PUT,PATCH"
)
const (
    Interval = time.Second * 1
    Timeout  = time.Minute * 5
)
const (
    ChangeCauseAnnotation = "kubernetes.io/change-cause"
)
const MaxRetries = 3
const (
    PossibleResourceTypes = "" /* 435 byte string literal not displayed */

)

Variables

var (
    // The reverse proxy will periodically flush the io writer at this frequency.
    // Only matters for long poll connections like the one used to watch. With an
    // interval of 0 the reverse proxy will buffer content sent on any connection
    // with transfer-encoding=chunked.
    // TODO: Flush after each chunk so the client doesn't suffer a 100ms latency per
    // watch event.
    ReverseProxyFlushInterval = 100 * time.Millisecond
)

func AbortRollingUpdate Uses

func AbortRollingUpdate(c *RollingUpdaterConfig) error

func AddDeploymentKeyToReplicationController Uses

func AddDeploymentKeyToReplicationController(oldRc *api.ReplicationController, client client.Interface, deploymentKey, deploymentValue, namespace string, out io.Writer) (*api.ReplicationController, error)

func AddJsonFilenameFlag Uses

func AddJsonFilenameFlag(cmd *cobra.Command, value *[]string, usage string)

func AnnotateFlags Uses

func AnnotateFlags(cmd *cobra.Command, generators map[string]Generator)

AnnotateFlags annotates all flags that are used by generators.

func CreateApplyAnnotation Uses

func CreateApplyAnnotation(info *resource.Info, codec runtime.Encoder) error

CreateApplyAnnotation gets the modified configuration of the object, without embedding it again, and then sets it on the object as the annotation.

func CreateNewControllerFromCurrentController Uses

func CreateNewControllerFromCurrentController(c client.Interface, codec runtime.Codec, cfg *NewControllerConfig) (*api.ReplicationController, error)

func CreateOrUpdateAnnotation Uses

func CreateOrUpdateAnnotation(createAnnotation bool, info *resource.Info, codec runtime.Encoder) error

Create the annotation used by kubectl apply only when createAnnotation is true Otherwise, only update the annotation when it already exists

func DescribableResources Uses

func DescribableResources() []string

List of all resource types we can describe

func DescribeEvents Uses

func DescribeEvents(el *api.EventList, w io.Writer)

func DescribeLimitRanges Uses

func DescribeLimitRanges(limitRanges *api.LimitRangeList, w io.Writer)

DescribeLimitRanges merges a set of limit range items into a single tabular description

func DescribePodTemplate Uses

func DescribePodTemplate(template *api.PodTemplateSpec, out io.Writer)

func DescribeProbe Uses

func DescribeProbe(probe *api.Probe) string

DescribeProbe is exported for consumers in other API groups that have probes

func DescribeResourceQuotas Uses

func DescribeResourceQuotas(quotas *api.ResourceQuotaList, w io.Writer)

DescribeResourceQuotas merges a set of quota items into a single tabular description of all quotas

func EnsureFlagsValid Uses

func EnsureFlagsValid(cmd *cobra.Command, generators map[string]Generator, generatorInUse string) error

EnsureFlagsValid ensures that no invalid flags are being used against a generator.

func FindSourceController Uses

func FindSourceController(r client.ReplicationControllersNamespacer, namespace, name string) (*api.ReplicationController, error)

func GetBool Uses

func GetBool(params map[string]string, key string, defValue bool) (bool, error)

func GetClientVersion Uses

func GetClientVersion(w io.Writer)

func GetModifiedConfiguration Uses

func GetModifiedConfiguration(info *resource.Info, annotate bool, codec runtime.Encoder) ([]byte, error)

GetModifiedConfiguration retrieves the modified configuration of the object. If annotate is true, it embeds the result as an anotation in the modified configuration. If an object was read from the command input, it will use that version of the object. Otherwise, it will use the version from the server.

func GetNewTabWriter Uses

func GetNewTabWriter(output io.Writer) *tabwriter.Writer

GetNewTabWriter returns a tabwriter that translates tabbed columns in input into properly aligned text.

func GetNextControllerAnnotation Uses

func GetNextControllerAnnotation(rc *api.ReplicationController) (string, bool)

func GetOriginalConfiguration Uses

func GetOriginalConfiguration(info *resource.Info) ([]byte, error)

GetOriginalConfiguration retrieves the original configuration of the object from the annotation, or nil if no annotation was found.

func GetServerVersion Uses

func GetServerVersion(w io.Writer, kubeClient client.Interface)

func HandleResourceRequirements Uses

func HandleResourceRequirements(params map[string]string) (api.ResourceRequirements, error)

HandleResourceRequirements parses the limits and requests parameters if specified

func IsNoSuchReaperError Uses

func IsNoSuchReaperError(err error) bool

func IsZero Uses

func IsZero(i interface{}) bool

func LoadExistingNextReplicationController Uses

func LoadExistingNextReplicationController(c client.ReplicationControllersNamespacer, namespace, newName string) (*api.ReplicationController, error)

func MakeLabels Uses

func MakeLabels(labels map[string]string) string

func MakeParams Uses

func MakeParams(cmd *cobra.Command, params []GeneratorParam) map[string]interface{}

MakeParams is a utility that creates generator parameters from a command line

func MakeProtocols Uses

func MakeProtocols(protocols map[string]string) string

func MakeRegexpArray Uses

func MakeRegexpArray(str string) ([]*regexp.Regexp, error)

Splits a comma separated list of regexps into a array of Regexp objects.

func MakeRegexpArrayOrDie Uses

func MakeRegexpArrayOrDie(str string) []*regexp.Regexp

func NewThirdPartyResourceMapper Uses

func NewThirdPartyResourceMapper(gvs []unversioned.GroupVersion, gvks []unversioned.GroupVersionKind) (meta.RESTMapper, error)

func ParseLabels Uses

func ParseLabels(labelSpec interface{}) (map[string]string, error)

ParseLabels turns a string representation of a label set into a map[string]string

func ParseProtocols Uses

func ParseProtocols(protocols interface{}) (map[string]string, error)

func PrintModelDescription Uses

func PrintModelDescription(inModel string, fieldsPath []string, w io.Writer, swaggerSchema *swagger.ApiDeclaration, r bool) error

PrintModelDescription prints the description of a specific model or dot path

func PrintRolloutHistory Uses

func PrintRolloutHistory(historyInfo HistoryInfo, resource, name string) (string, error)

PrintRolloutHistory prints a formatted table of the input revision history of the deployment

func Rename Uses

func Rename(c client.ReplicationControllersNamespacer, rc *api.ReplicationController, newName string) error

func ResourceAliases Uses

func ResourceAliases(rs []string) []string

ResourceAliases returns the resource shortcuts and plural forms for the given resources.

func ScaleCondition Uses

func ScaleCondition(r Scaler, precondition *ScalePrecondition, namespace, name string, count uint) wait.ConditionFunc

ScaleCondition is a closure around Scale that facilitates retries via util.wait

func SetNextControllerAnnotation Uses

func SetNextControllerAnnotation(rc *api.ReplicationController, name string)

func SetOriginalConfiguration Uses

func SetOriginalConfiguration(info *resource.Info, original []byte) error

SetOriginalConfiguration sets the original configuration of the object as the annotation on the object for later use in computing a three way patch.

func SplitAndParseResourceRequest Uses

func SplitAndParseResourceRequest(inResource string, mapper meta.RESTMapper) (string, []string, error)

SplitAndParseResourceRequest separates the users input into a model and fields

func UpdateApplyAnnotation Uses

func UpdateApplyAnnotation(info *resource.Info, codec runtime.Encoder) error

UpdateApplyAnnotation calls CreateApplyAnnotation if the last applied configuration annotation is already present. Otherwise, it does nothing.

func UpdateExistingReplicationController Uses

func UpdateExistingReplicationController(c client.Interface, oldRc *api.ReplicationController, namespace, newName, deploymentKey, deploymentValue string, out io.Writer) (*api.ReplicationController, error)

func ValidateParams Uses

func ValidateParams(paramSpec []GeneratorParam, params map[string]interface{}) error

ValidateParams ensures that all required params are present in the params map

func WatchLoop Uses

func WatchLoop(w watch.Interface, fn func(watch.Event) error)

WatchLoop loops, passing events in w to fn. If user sends interrupt signal, shut down cleanly. Otherwise, never return.

type BasicPod Uses

type BasicPod struct{}

func (BasicPod) Generate Uses

func (BasicPod) Generate(genericParams map[string]interface{}) (runtime.Object, error)

func (BasicPod) ParamNames Uses

func (BasicPod) ParamNames() []GeneratorParam

type BasicReplicationController Uses

type BasicReplicationController struct{}

func (BasicReplicationController) Generate Uses

func (BasicReplicationController) Generate(genericParams map[string]interface{}) (runtime.Object, error)

func (BasicReplicationController) ParamNames Uses

func (BasicReplicationController) ParamNames() []GeneratorParam

type Column Uses

type Column struct {
    // The header to print above the column, general style is ALL_CAPS
    Header string
    // The pointer to the field in the object to print in JSONPath form
    // e.g. {.ObjectMeta.Name}, see pkg/util/jsonpath for more details.
    FieldSpec string
}

Column represents a user specified column

type ConfigMapDescriber Uses

type ConfigMapDescriber struct {
    client.Interface
}

ConfigMapDescriber generates information about a ConfigMap

func (*ConfigMapDescriber) Describe Uses

func (d *ConfigMapDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)

type ConfigMapGeneratorV1 Uses

type ConfigMapGeneratorV1 struct {
    // Name of configMap (required)
    Name string
    // Type of configMap (optional)
    Type string
    // FileSources to derive the configMap from (optional)
    FileSources []string
    // LiteralSources to derive the configMap from (optional)
    LiteralSources []string
}

ConfigMapGeneratorV1 supports stable generation of a configMap.

func (ConfigMapGeneratorV1) Generate Uses

func (s ConfigMapGeneratorV1) Generate(genericParams map[string]interface{}) (runtime.Object, error)

Generate returns a configMap using the specified parameters.

func (ConfigMapGeneratorV1) ParamNames Uses

func (s ConfigMapGeneratorV1) ParamNames() []GeneratorParam

ParamNames returns the set of supported input parameters when using the parameter injection generator pattern.

func (ConfigMapGeneratorV1) StructuredGenerate Uses

func (s ConfigMapGeneratorV1) StructuredGenerate() (runtime.Object, error)

StructuredGenerate outputs a configMap object using the configured fields.

type CustomColumnsPrinter Uses

type CustomColumnsPrinter struct {
    Columns []Column
    Decoder runtime.Decoder
}

CustomColumnPrinter is a printer that knows how to print arbitrary columns of data from templates specified in the `Columns` array

func NewCustomColumnsPrinterFromSpec Uses

func NewCustomColumnsPrinterFromSpec(spec string, decoder runtime.Decoder) (*CustomColumnsPrinter, error)

NewCustomColumnsPrinterFromSpec creates a custom columns printer from a comma separated list of <header>:<jsonpath-field-spec> pairs. e.g. NAME:metadata.name,API_VERSION:apiVersion creates a printer that prints:

NAME               API_VERSION
foo                bar

func NewCustomColumnsPrinterFromTemplate Uses

func NewCustomColumnsPrinterFromTemplate(templateReader io.Reader, decoder runtime.Decoder) (*CustomColumnsPrinter, error)

NewCustomColumnsPrinterFromTemplate creates a custom columns printer from a template stream. The template is expected to consist of two lines, whitespace separated. The first line is the header line, the second line is the jsonpath field spec For example the template below: NAME API_VERSION {metadata.name} {apiVersion}

func (*CustomColumnsPrinter) HandledResources Uses

func (s *CustomColumnsPrinter) HandledResources() []string

func (*CustomColumnsPrinter) PrintObj Uses

func (s *CustomColumnsPrinter) PrintObj(obj runtime.Object, out io.Writer) error

type DaemonSetDescriber Uses

type DaemonSetDescriber struct {
    client.Interface
}

DaemonSetDescriber generates information about a daemon set and the pods it has created.

func (*DaemonSetDescriber) Describe Uses

func (d *DaemonSetDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)

type DaemonSetReaper Uses

type DaemonSetReaper struct {
    client.Interface
    // contains filtered or unexported fields
}

func (*DaemonSetReaper) Stop Uses

func (reaper *DaemonSetReaper) Stop(namespace, name string, timeout time.Duration, gracePeriod *api.DeleteOptions) error

type DeploymentDescriber Uses

type DeploymentDescriber struct {
    clientset.Interface
}

DeploymentDescriber generates information about a deployment.

func (*DeploymentDescriber) Describe Uses

func (dd *DeploymentDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)

type DeploymentHistoryViewer Uses

type DeploymentHistoryViewer struct {
    // contains filtered or unexported fields
}

func (*DeploymentHistoryViewer) History Uses

func (h *DeploymentHistoryViewer) History(namespace, name string) (HistoryInfo, error)

History returns a revision-to-replicaset map as the revision history of a deployment

type DeploymentReaper Uses

type DeploymentReaper struct {
    client.Interface
    // contains filtered or unexported fields
}

func (*DeploymentReaper) Stop Uses

func (reaper *DeploymentReaper) Stop(namespace, name string, timeout time.Duration, gracePeriod *api.DeleteOptions) error

type DeploymentRollbacker Uses

type DeploymentRollbacker struct {
    // contains filtered or unexported fields
}

func (*DeploymentRollbacker) Rollback Uses

func (r *DeploymentRollbacker) Rollback(namespace, name string, updatedAnnotations map[string]string, toRevision int64, obj runtime.Object) (string, error)

type DeploymentScaler Uses

type DeploymentScaler struct {
    // contains filtered or unexported fields
}

func (*DeploymentScaler) Scale Uses

func (scaler *DeploymentScaler) Scale(namespace, name string, newSize uint, preconditions *ScalePrecondition, retry, waitForReplicas *RetryParams) error

Scale updates a deployment to a new size, with optional precondition check (if preconditions is not nil), optional retries (if retry is not nil), and then optionally waits for the status to reach desired count.

func (*DeploymentScaler) ScaleSimple Uses

func (scaler *DeploymentScaler) ScaleSimple(namespace, name string, preconditions *ScalePrecondition, newSize uint) error

ScaleSimple is responsible for updating a deployment's desired replicas count.

type DeploymentStatusViewer Uses

type DeploymentStatusViewer struct {
    // contains filtered or unexported fields
}

func (*DeploymentStatusViewer) Status Uses

func (s *DeploymentStatusViewer) Status(namespace, name string) (string, bool, error)

Status returns a message describing deployment status, and a bool value indicating if the status is considered done

type DeploymentV1Beta1 Uses

type DeploymentV1Beta1 struct{}

func (DeploymentV1Beta1) Generate Uses

func (DeploymentV1Beta1) Generate(genericParams map[string]interface{}) (runtime.Object, error)

func (DeploymentV1Beta1) ParamNames Uses

func (DeploymentV1Beta1) ParamNames() []GeneratorParam

type Describer Uses

type Describer interface {
    Describe(namespace, name string, describerSettings DescriberSettings) (output string, err error)
}

Describer generates output for the named resource or an error if the output could not be generated. Implementers typically abstract the retrieval of the named object from a remote server.

func DescriberFor Uses

func DescriberFor(kind unversioned.GroupKind, c *client.Client) (Describer, bool)

Describer returns the default describe functions for each of the standard Kubernetes types.

type DescriberSettings Uses

type DescriberSettings struct {
    ShowEvents bool
}

DescriberSettings holds display configuration for each object describer to control what is printed.

type Describers Uses

type Describers struct {
    // contains filtered or unexported fields
}

Describers implements ObjectDescriber against functions registered via Add. Those functions can be strongly typed. Types are exactly matched (no conversion or assignable checks).

func (*Describers) Add Uses

func (d *Describers) Add(fns ...interface{}) error

Add adds one or more describer functions to the Describer. The passed function must match the signature:

func(...) (string, error)

Any number of arguments may be provided.

func (*Describers) DescribeObject Uses

func (d *Describers) DescribeObject(exact interface{}, extra ...interface{}) (string, error)

DescribeObject implements ObjectDescriber and will attempt to print the provided object to a string, if at least one describer function has been registered with the exact types passed, or if any describer can print the exact object in its first argument (the remainder will be provided empty values). If no function registered with Add can satisfy the passed objects, an ErrNoDescriber will be returned TODO: reorder and partial match extra.

type EndpointsDescriber Uses

type EndpointsDescriber struct {
    client.Interface
}

EndpointsDescriber generates information about an Endpoint.

func (*EndpointsDescriber) Describe Uses

func (d *EndpointsDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)

type EnvVarResolverFunc Uses

type EnvVarResolverFunc func(e api.EnvVar) string

func EnvValueRetriever Uses

func EnvValueRetriever(pod *api.Pod) EnvVarResolverFunc

EnvValueFrom is exported for use by describers in other packages

type ErrNoDescriber Uses

type ErrNoDescriber struct {
    Types []string
}

ErrNoDescriber is a structured error indicating the provided object or objects cannot be described.

func (ErrNoDescriber) Error Uses

func (e ErrNoDescriber) Error() string

Error implements the error interface.

type FilterServer Uses

type FilterServer struct {
    // Only paths that match this regexp will be accepted
    AcceptPaths []*regexp.Regexp
    // Paths that match this regexp will be rejected, even if they match the above
    RejectPaths []*regexp.Regexp
    // Hosts are required to match this list of regexp
    AcceptHosts []*regexp.Regexp
    // Methods that match this regexp are rejected
    RejectMethods []*regexp.Regexp
    // contains filtered or unexported fields
}

FilterServer rejects requests which don't match one of the specified regular expressions

func (*FilterServer) HandlerFor Uses

func (f *FilterServer) HandlerFor(delegate http.Handler) *FilterServer

Make a copy of f which passes requests along to the new delegate.

func (*FilterServer) ServeHTTP Uses

func (f *FilterServer) ServeHTTP(rw http.ResponseWriter, req *http.Request)

type Generator Uses

type Generator interface {
    // Generate creates an API object given a set of parameters
    Generate(params map[string]interface{}) (runtime.Object, error)
    // ParamNames returns the list of parameters that this generator uses
    ParamNames() []GeneratorParam
}

Generator is an interface for things that can generate API objects from input parameters.

type GeneratorParam Uses

type GeneratorParam struct {
    Name     string
    Required bool
}

GeneratorParam is a parameter for a generator TODO: facilitate structured json generator input schemes

type HistoryInfo Uses

type HistoryInfo struct {
    RevisionToTemplate map[int64]*api.PodTemplateSpec
}

HistoryInfo stores the mapping from revision to podTemplate; note that change-cause annotation should be copied to podTemplate

type HistoryViewer Uses

type HistoryViewer interface {
    History(namespace, name string) (HistoryInfo, error)
}

HistoryViewer provides an interface for resources that can be rolled back.

func HistoryViewerFor Uses

func HistoryViewerFor(kind unversioned.GroupKind, c clientset.Interface) (HistoryViewer, error)

type HorizontalPodAutoscalerDescriber Uses

type HorizontalPodAutoscalerDescriber struct {
    // contains filtered or unexported fields
}

HorizontalPodAutoscalerDescriber generates information about a horizontal pod autoscaler.

func (*HorizontalPodAutoscalerDescriber) Describe Uses

func (d *HorizontalPodAutoscalerDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)

type HorizontalPodAutoscalerV1Beta1 Uses

type HorizontalPodAutoscalerV1Beta1 struct{}

func (HorizontalPodAutoscalerV1Beta1) Generate Uses

func (HorizontalPodAutoscalerV1Beta1) Generate(genericParams map[string]interface{}) (runtime.Object, error)

func (HorizontalPodAutoscalerV1Beta1) ParamNames Uses

func (HorizontalPodAutoscalerV1Beta1) ParamNames() []GeneratorParam

type HumanReadablePrinter Uses

type HumanReadablePrinter struct {
    // contains filtered or unexported fields
}

HumanReadablePrinter is an implementation of ResourcePrinter which attempts to provide more elegant output. It is not threadsafe, but you may call PrintObj repeatedly; headers will only be printed if the object type changes. This makes it useful for printing items received from watches.

func NewHumanReadablePrinter Uses

func NewHumanReadablePrinter(noHeaders, withNamespace bool, wide bool, showAll bool, showLabels bool, absoluteTimestamps bool, columnLabels []string) *HumanReadablePrinter

NewHumanReadablePrinter creates a HumanReadablePrinter.

func (*HumanReadablePrinter) HandledResources Uses

func (h *HumanReadablePrinter) HandledResources() []string

func (*HumanReadablePrinter) Handler Uses

func (h *HumanReadablePrinter) Handler(columns []string, printFunc interface{}) error

Handler adds a print handler with a given set of columns to HumanReadablePrinter instance. See validatePrintHandlerFunc for required method signature.

func (*HumanReadablePrinter) PrintObj Uses

func (h *HumanReadablePrinter) PrintObj(obj runtime.Object, output io.Writer) error

PrintObj prints the obj in a human-friendly format according to the type of the obj.

type IngressDescriber Uses

type IngressDescriber struct {
    client.Interface
}

func (*IngressDescriber) Describe Uses

func (i *IngressDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)

type JSONPathPrinter Uses

type JSONPathPrinter struct {
    *jsonpath.JSONPath
    // contains filtered or unexported fields
}

JSONPathPrinter is an implementation of ResourcePrinter which formats data with jsonpath expression.

func NewJSONPathPrinter Uses

func NewJSONPathPrinter(tmpl string) (*JSONPathPrinter, error)

func (*JSONPathPrinter) HandledResources Uses

func (p *JSONPathPrinter) HandledResources() []string

TODO: implement HandledResources()

func (*JSONPathPrinter) PrintObj Uses

func (j *JSONPathPrinter) PrintObj(obj runtime.Object, w io.Writer) error

PrintObj formats the obj with the JSONPath Template.

type JSONPrinter Uses

type JSONPrinter struct {
}

JSONPrinter is an implementation of ResourcePrinter which outputs an object as JSON.

func (*JSONPrinter) HandledResources Uses

func (p *JSONPrinter) HandledResources() []string

TODO: implement HandledResources()

func (*JSONPrinter) PrintObj Uses

func (p *JSONPrinter) PrintObj(obj runtime.Object, w io.Writer) error

PrintObj is an implementation of ResourcePrinter.PrintObj which simply writes the object to the Writer.

type JobDescriber Uses

type JobDescriber struct {
    // contains filtered or unexported fields
}

JobDescriber generates information about a job and the pods it has created.

func (*JobDescriber) Describe Uses

func (d *JobDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)

type JobReaper Uses

type JobReaper struct {
    client.Interface
    // contains filtered or unexported fields
}

func (*JobReaper) Stop Uses

func (reaper *JobReaper) Stop(namespace, name string, timeout time.Duration, gracePeriod *api.DeleteOptions) error

type JobScaler Uses

type JobScaler struct {
    // contains filtered or unexported fields
}

func (*JobScaler) Scale Uses

func (scaler *JobScaler) Scale(namespace, name string, newSize uint, preconditions *ScalePrecondition, retry, waitForReplicas *RetryParams) error

Scale updates a Job to a new size, with optional precondition check (if preconditions is not nil), optional retries (if retry is not nil), and then optionally waits for parallelism to reach desired number, which can be less than requested based on job's current progress.

func (*JobScaler) ScaleSimple Uses

func (scaler *JobScaler) ScaleSimple(namespace, name string, preconditions *ScalePrecondition, newSize uint) error

ScaleSimple is responsible for updating job's parallelism.

type JobV1 Uses

type JobV1 struct{}

func (JobV1) Generate Uses

func (JobV1) Generate(genericParams map[string]interface{}) (runtime.Object, error)

func (JobV1) ParamNames Uses

func (JobV1) ParamNames() []GeneratorParam

type JobV1Beta1 Uses

type JobV1Beta1 struct{}

func (JobV1Beta1) Generate Uses

func (JobV1Beta1) Generate(genericParams map[string]interface{}) (runtime.Object, error)

func (JobV1Beta1) ParamNames Uses

func (JobV1Beta1) ParamNames() []GeneratorParam

type LimitRangeDescriber Uses

type LimitRangeDescriber struct {
    client.Interface
}

LimitRangeDescriber generates information about a limit range

func (*LimitRangeDescriber) Describe Uses

func (d *LimitRangeDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)

type NamePrinter Uses

type NamePrinter struct {
    Decoder runtime.Decoder
    Typer   runtime.Typer
}

NamePrinter is an implementation of ResourcePrinter which outputs "resource/name" pair of an object.

func (*NamePrinter) HandledResources Uses

func (p *NamePrinter) HandledResources() []string

TODO: implement HandledResources()

func (*NamePrinter) PrintObj Uses

func (p *NamePrinter) PrintObj(obj runtime.Object, w io.Writer) error

PrintObj is an implementation of ResourcePrinter.PrintObj which decodes the object and print "resource/name" pair. If the object is a List, print all items in it.

type NamespaceDescriber Uses

type NamespaceDescriber struct {
    client.Interface
}

NamespaceDescriber generates information about a namespace

func (*NamespaceDescriber) Describe Uses

func (d *NamespaceDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)

type NamespaceGeneratorV1 Uses

type NamespaceGeneratorV1 struct {
    // Name of namespace
    Name string
}

NamespaceGeneratorV1 supports stable generation of a namespace

func (NamespaceGeneratorV1) Generate Uses

func (g NamespaceGeneratorV1) Generate(genericParams map[string]interface{}) (runtime.Object, error)

Generate returns a namespace using the specified parameters

func (NamespaceGeneratorV1) ParamNames Uses

func (g NamespaceGeneratorV1) ParamNames() []GeneratorParam

ParamNames returns the set of supported input parameters when using the parameter injection generator pattern

func (*NamespaceGeneratorV1) StructuredGenerate Uses

func (g *NamespaceGeneratorV1) StructuredGenerate() (runtime.Object, error)

StructuredGenerate outputs a namespace object using the configured fields

type NamespaceInfo Uses

type NamespaceInfo struct {
    Namespace string
}

type NewControllerConfig Uses

type NewControllerConfig struct {
    Namespace        string
    OldName, NewName string
    Image            string
    Container        string
    DeploymentKey    string
    PullPolicy       api.PullPolicy
}

type NoSuchReaperError Uses

type NoSuchReaperError struct {
    // contains filtered or unexported fields
}

func (*NoSuchReaperError) Error Uses

func (n *NoSuchReaperError) Error() string

type NodeDescriber Uses

type NodeDescriber struct {
    client.Interface
}

NodeDescriber generates information about a node.

func (*NodeDescriber) Describe Uses

func (d *NodeDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)

type ObjectDescriber Uses

type ObjectDescriber interface {
    DescribeObject(object interface{}, extra ...interface{}) (output string, err error)
}

ObjectDescriber is an interface for displaying arbitrary objects with extra information. Use when an object is in hand (on disk, or already retrieved). Implementers may ignore the additional information passed on extra, or use it by default. ObjectDescribers may return ErrNoDescriber if no suitable describer is found.

var DefaultObjectDescriber ObjectDescriber

DefaultObjectDescriber can describe the default Kubernetes objects.

type OutputVersionMapper Uses

type OutputVersionMapper struct {
    meta.RESTMapper

    // output versions takes a list of preferred GroupVersions. Only the first
    // hit for a given group will have effect.  This allows different output versions
    // depending upon the group of the kind being requested
    OutputVersions []unversioned.GroupVersion
}

OutputVersionMapper is a RESTMapper that will prefer mappings that correspond to a preferred output version (if feasible)

func (OutputVersionMapper) RESTMapping Uses

func (m OutputVersionMapper) RESTMapping(gk unversioned.GroupKind, versions ...string) (*meta.RESTMapping, error)

RESTMapping implements meta.RESTMapper by prepending the output version to the preferred version list.

type PersistentVolumeClaimDescriber Uses

type PersistentVolumeClaimDescriber struct {
    client.Interface
}

func (*PersistentVolumeClaimDescriber) Describe Uses

func (d *PersistentVolumeClaimDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)

type PersistentVolumeDescriber Uses

type PersistentVolumeDescriber struct {
    client.Interface
}

func (*PersistentVolumeDescriber) Describe Uses

func (d *PersistentVolumeDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)

type PetSetDescriber Uses

type PetSetDescriber struct {
    // contains filtered or unexported fields
}

func (*PetSetDescriber) Describe Uses

func (p *PetSetDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)

type PodDescriber Uses

type PodDescriber struct {
    client.Interface
}

PodDescriber generates information about a pod and the replication controllers that create it.

func (*PodDescriber) Describe Uses

func (d *PodDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)

type PodReaper Uses

type PodReaper struct {
    client.Interface
}

func (*PodReaper) Stop Uses

func (reaper *PodReaper) Stop(namespace, name string, timeout time.Duration, gracePeriod *api.DeleteOptions) error

type PreconditionError Uses

type PreconditionError struct {
    Precondition  string
    ExpectedValue string
    ActualValue   string
}

A PreconditionError is returned when a resource fails to match the scale preconditions passed to kubectl.

func (PreconditionError) Error Uses

func (pe PreconditionError) Error() string

type PrintOptions Uses

type PrintOptions struct {
    NoHeaders          bool
    WithNamespace      bool
    Wide               bool
    ShowAll            bool
    ShowLabels         bool
    AbsoluteTimestamps bool
    ColumnLabels       []string
}

type ProxyServer Uses

type ProxyServer struct {
    // contains filtered or unexported fields
}

ProxyServer is a http.Handler which proxies Kubernetes APIs to remote API server.

func NewProxyServer Uses

func NewProxyServer(filebase string, apiProxyPrefix string, staticPrefix string, filter *FilterServer, cfg *restclient.Config) (*ProxyServer, error)

NewProxyServer creates and installs a new ProxyServer. It automatically registers the created ProxyServer to http.DefaultServeMux. 'filter', if non-nil, protects requests to the api only.

func (*ProxyServer) Listen Uses

func (s *ProxyServer) Listen(address string, port int) (net.Listener, error)

Listen is a simple wrapper around net.Listen.

func (*ProxyServer) ListenUnix Uses

func (s *ProxyServer) ListenUnix(path string) (net.Listener, error)

ListenUnix does net.Listen for a unix socket

func (*ProxyServer) ServeOnListener Uses

func (s *ProxyServer) ServeOnListener(l net.Listener) error

Serve starts the server using given listener, loops forever.

type RESTClient Uses

type RESTClient interface {
    Get() *client.Request
    Post() *client.Request
    Patch(api.PatchType) *client.Request
    Delete() *client.Request
    Put() *client.Request
}

RESTClient is a client helper for dealing with RESTful resources in a generic way.

type Reaper Uses

type Reaper interface {
    Stop(namespace, name string, timeout time.Duration, gracePeriod *api.DeleteOptions) error
}

A Reaper handles terminating an object as gracefully as possible. timeout is how long we'll wait for the termination to be successful gracePeriod is time given to an API object for it to delete itself cleanly, e.g., pod shutdown. It may or may not be supported by the API object.

func ReaperFor Uses

func ReaperFor(kind unversioned.GroupKind, c client.Interface) (Reaper, error)

func ReaperForReplicationController Uses

func ReaperForReplicationController(c client.Interface, timeout time.Duration) (Reaper, error)

type ReplicaSetDescriber Uses

type ReplicaSetDescriber struct {
    client.Interface
}

ReplicaSetDescriber generates information about a ReplicaSet and the pods it has created.

func (*ReplicaSetDescriber) Describe Uses

func (d *ReplicaSetDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)

type ReplicaSetReaper Uses

type ReplicaSetReaper struct {
    client.Interface
    // contains filtered or unexported fields
}

func (*ReplicaSetReaper) Stop Uses

func (reaper *ReplicaSetReaper) Stop(namespace, name string, timeout time.Duration, gracePeriod *api.DeleteOptions) error

type ReplicaSetScaler Uses

type ReplicaSetScaler struct {
    // contains filtered or unexported fields
}

func (*ReplicaSetScaler) Scale Uses

func (scaler *ReplicaSetScaler) Scale(namespace, name string, newSize uint, preconditions *ScalePrecondition, retry, waitForReplicas *RetryParams) error

Scale updates a ReplicaSet to a new size, with optional precondition check (if preconditions is not nil), optional retries (if retry is not nil), and then optionally waits for it's replica count to reach the new value (if wait is not nil).

func (*ReplicaSetScaler) ScaleSimple Uses

func (scaler *ReplicaSetScaler) ScaleSimple(namespace, name string, preconditions *ScalePrecondition, newSize uint) error

type ReplicationControllerDescriber Uses

type ReplicationControllerDescriber struct {
    client.Interface
}

ReplicationControllerDescriber generates information about a replication controller and the pods it has created.

func (*ReplicationControllerDescriber) Describe Uses

func (d *ReplicationControllerDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)

type ReplicationControllerReaper Uses

type ReplicationControllerReaper struct {
    client.Interface
    // contains filtered or unexported fields
}

func (*ReplicationControllerReaper) Stop Uses

func (reaper *ReplicationControllerReaper) Stop(namespace, name string, timeout time.Duration, gracePeriod *api.DeleteOptions) error

type ReplicationControllerScaler Uses

type ReplicationControllerScaler struct {
    // contains filtered or unexported fields
}

func (*ReplicationControllerScaler) Scale Uses

func (scaler *ReplicationControllerScaler) Scale(namespace, name string, newSize uint, preconditions *ScalePrecondition, retry, waitForReplicas *RetryParams) error

Scale updates a ReplicationController to a new size, with optional precondition check (if preconditions is not nil), optional retries (if retry is not nil), and then optionally waits for it's replica count to reach the new value (if wait is not nil).

func (*ReplicationControllerScaler) ScaleSimple Uses

func (scaler *ReplicationControllerScaler) ScaleSimple(namespace, name string, preconditions *ScalePrecondition, newSize uint) error

type ResourcePrinter Uses

type ResourcePrinter interface {
    // Print receives a runtime object, formats it and prints it to a writer.
    PrintObj(runtime.Object, io.Writer) error
    HandledResources() []string
}

ResourcePrinter is an interface that knows how to print runtime objects.

func GetPrinter Uses

func GetPrinter(format, formatArgument string) (ResourcePrinter, bool, error)

GetPrinter takes a format type, an optional format argument. It will return true if the format is generic (untyped), otherwise it will return false. The printer is agnostic to schema versions, so you must send arguments to PrintObj in the version you wish them to be shown using a VersionedPrinter (typically when generic is true).

func NewVersionedPrinter Uses

func NewVersionedPrinter(printer ResourcePrinter, convertor runtime.ObjectConvertor, versions ...unversioned.GroupVersion) ResourcePrinter

NewVersionedPrinter wraps a printer to convert objects to a known API version prior to printing.

type ResourcePrinterFunc Uses

type ResourcePrinterFunc func(runtime.Object, io.Writer) error

ResourcePrinterFunc is a function that can print objects

func (ResourcePrinterFunc) HandledResources Uses

func (fn ResourcePrinterFunc) HandledResources() []string

TODO: implement HandledResources()

func (ResourcePrinterFunc) PrintObj Uses

func (fn ResourcePrinterFunc) PrintObj(obj runtime.Object, w io.Writer) error

PrintObj implements ResourcePrinter

type ResourceQuotaDescriber Uses

type ResourceQuotaDescriber struct {
    client.Interface
}

ResourceQuotaDescriber generates information about a resource quota

func (*ResourceQuotaDescriber) Describe Uses

func (d *ResourceQuotaDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)

type RetryParams Uses

type RetryParams struct {
    Interval, Timeout time.Duration
}

RetryParams encapsulates the retry parameters used by kubectl's scaler.

func NewRetryParams Uses

func NewRetryParams(interval, timeout time.Duration) *RetryParams

type Rollbacker Uses

type Rollbacker interface {
    Rollback(namespace, name string, updatedAnnotations map[string]string, toRevision int64, obj runtime.Object) (string, error)
}

Rollbacker provides an interface for resources that can be rolled back.

func RollbackerFor Uses

func RollbackerFor(kind unversioned.GroupKind, c client.Interface) (Rollbacker, error)

type RollingUpdater Uses

type RollingUpdater struct {
    // contains filtered or unexported fields
}

RollingUpdater provides methods for updating replicated pods in a predictable, fault-tolerant way.

func NewRollingUpdater Uses

func NewRollingUpdater(namespace string, client client.Interface) *RollingUpdater

NewRollingUpdater creates a RollingUpdater from a client.

func (*RollingUpdater) Update Uses

func (r *RollingUpdater) Update(config *RollingUpdaterConfig) error

Update all pods for a ReplicationController (oldRc) by creating a new controller (newRc) with 0 replicas, and synchronously scaling oldRc and newRc until oldRc has 0 replicas and newRc has the original # of desired replicas. Cleanup occurs based on a RollingUpdaterCleanupPolicy.

Each interval, the updater will attempt to make progress however it can without violating any availability constraints defined by the config. This means the amount scaled up or down each interval will vary based on the timeliness of readiness and the updater will always try to make progress, even slowly.

If an update from newRc to oldRc is already in progress, we attempt to drive it to completion. If an error occurs at any step of the update, the error will be returned.

A scaling event (either up or down) is considered progress; if no progress is made within the config.Timeout, an error is returned.

TODO: make this handle performing a rollback of a partially completed rollout.

type RollingUpdaterCleanupPolicy Uses

type RollingUpdaterCleanupPolicy string

RollingUpdaterCleanupPolicy is a cleanup action to take after the deployment is complete.

const (
    // DeleteRollingUpdateCleanupPolicy means delete the old controller.
    DeleteRollingUpdateCleanupPolicy RollingUpdaterCleanupPolicy = "Delete"
    // PreserveRollingUpdateCleanupPolicy means keep the old controller.
    PreserveRollingUpdateCleanupPolicy RollingUpdaterCleanupPolicy = "Preserve"
    // RenameRollingUpdateCleanupPolicy means delete the old controller, and rename
    // the new controller to the name of the old controller.
    RenameRollingUpdateCleanupPolicy RollingUpdaterCleanupPolicy = "Rename"
)

type RollingUpdaterConfig Uses

type RollingUpdaterConfig struct {
    // Out is a writer for progress output.
    Out io.Writer
    // OldRC is an existing controller to be replaced.
    OldRc *api.ReplicationController
    // NewRc is a controller that will take ownership of updated pods (will be
    // created if needed).
    NewRc *api.ReplicationController
    // UpdatePeriod is the time to wait between individual pod updates.
    UpdatePeriod time.Duration
    // Interval is the time to wait between polling controller status after
    // update.
    Interval time.Duration
    // Timeout is the time to wait for controller updates before giving up.
    Timeout time.Duration
    // CleanupPolicy defines the cleanup action to take after the deployment is
    // complete.
    CleanupPolicy RollingUpdaterCleanupPolicy
    // MaxUnavailable is the maximum number of pods that can be unavailable during the update.
    // Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%).
    // Absolute number is calculated from percentage by rounding up.
    // This can not be 0 if MaxSurge is 0.
    // By default, a fixed value of 1 is used.
    // Example: when this is set to 30%, the old RC can be scaled down to 70% of desired pods
    // immediately when the rolling update starts. Once new pods are ready, old RC
    // can be scaled down further, followed by scaling up the new RC, ensuring
    // that the total number of pods available at all times during the update is at
    // least 70% of desired pods.
    MaxUnavailable intstr.IntOrString
    // MaxSurge is the maximum number of pods that can be scheduled above the desired number of pods.
    // Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%).
    // This can not be 0 if MaxUnavailable is 0.
    // Absolute number is calculated from percentage by rounding up.
    // By default, a value of 1 is used.
    // Example: when this is set to 30%, the new RC can be scaled up immediately
    // when the rolling update starts, such that the total number of old and new pods do not exceed
    // 130% of desired pods. Once old pods have been killed, new RC can be scaled up
    // further, ensuring that total number of pods running at any time during
    // the update is atmost 130% of desired pods.
    MaxSurge intstr.IntOrString
}

RollingUpdaterConfig is the configuration for a rolling deployment process.

type RuntimeSort Uses

type RuntimeSort struct {
    // contains filtered or unexported fields
}

RuntimeSort is an implementation of the golang sort interface that knows how to sort lists of runtime.Object

func NewRuntimeSort Uses

func NewRuntimeSort(field string, objs []runtime.Object) *RuntimeSort

func SortObjects Uses

func SortObjects(decoder runtime.Decoder, objs []runtime.Object, fieldInput string) (*RuntimeSort, error)

func (*RuntimeSort) Len Uses

func (r *RuntimeSort) Len() int

func (*RuntimeSort) Less Uses

func (r *RuntimeSort) Less(i, j int) bool

func (*RuntimeSort) OriginalPosition Uses

func (r *RuntimeSort) OriginalPosition(ix int) int

Returns the starting (original) position of a particular index. e.g. If OriginalPosition(0) returns 5 than the the item currently at position 0 was at position 5 in the original unsorted array.

func (*RuntimeSort) Swap Uses

func (r *RuntimeSort) Swap(i, j int)

type ScaleError Uses

type ScaleError struct {
    FailureType     ScaleErrorType
    ResourceVersion string
    ActualError     error
}

A ScaleError is returned when a scale request passes preconditions but fails to actually scale the controller.

func (ScaleError) Error Uses

func (c ScaleError) Error() string

type ScaleErrorType Uses

type ScaleErrorType int
const (
    ScaleGetFailure ScaleErrorType = iota
    ScaleUpdateFailure
    ScaleUpdateInvalidFailure
)

type ScalePrecondition Uses

type ScalePrecondition struct {
    Size            int
    ResourceVersion string
}

ScalePrecondition describes a condition that must be true for the scale to take place If CurrentSize == -1, it is ignored. If CurrentResourceVersion is the empty string, it is ignored. Otherwise they must equal the values in the resource for it to be valid.

func (*ScalePrecondition) ValidateDeployment Uses

func (precondition *ScalePrecondition) ValidateDeployment(deployment *extensions.Deployment) error

ValidateDeployment ensures that the preconditions match. Returns nil if they are valid, an error otherwise.

func (*ScalePrecondition) ValidateJob Uses

func (precondition *ScalePrecondition) ValidateJob(job *batch.Job) error

ValidateJob ensures that the preconditions match. Returns nil if they are valid, an error otherwise.

func (*ScalePrecondition) ValidateReplicaSet Uses

func (precondition *ScalePrecondition) ValidateReplicaSet(replicaSet *extensions.ReplicaSet) error

ValidateReplicaSet ensures that the preconditions match. Returns nil if they are valid, an error otherwise

func (*ScalePrecondition) ValidateReplicationController Uses

func (precondition *ScalePrecondition) ValidateReplicationController(controller *api.ReplicationController) error

ValidateReplicationController ensures that the preconditions match. Returns nil if they are valid, an error otherwise

type Scaler Uses

type Scaler interface {
    // Scale scales the named resource after checking preconditions. It optionally
    // retries in the event of resource version mismatch (if retry is not nil),
    // and optionally waits until the status of the resource matches newSize (if wait is not nil)
    Scale(namespace, name string, newSize uint, preconditions *ScalePrecondition, retry, wait *RetryParams) error
    // ScaleSimple does a simple one-shot attempt at scaling - not useful on it's own, but
    // a necessary building block for Scale
    ScaleSimple(namespace, name string, preconditions *ScalePrecondition, newSize uint) error
}

Scaler provides an interface for resources that can be scaled.

func ScalerFor Uses

func ScalerFor(kind unversioned.GroupKind, c client.Interface) (Scaler, error)

type SecretDescriber Uses

type SecretDescriber struct {
    client.Interface
}

SecretDescriber generates information about a secret

func (*SecretDescriber) Describe Uses

func (d *SecretDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)

type SecretForDockerRegistryGeneratorV1 Uses

type SecretForDockerRegistryGeneratorV1 struct {
    // Name of secret (required)
    Name string
    // Username for registry (required)
    Username string
    // Email for registry (required)
    Email string
    // Password for registry (required)
    Password string
    // Server for registry (required)
    Server string
}

SecretForDockerRegistryGeneratorV1 supports stable generation of a docker registry secret

func (SecretForDockerRegistryGeneratorV1) Generate Uses

func (s SecretForDockerRegistryGeneratorV1) Generate(genericParams map[string]interface{}) (runtime.Object, error)

Generate returns a secret using the specified parameters

func (SecretForDockerRegistryGeneratorV1) ParamNames Uses

func (s SecretForDockerRegistryGeneratorV1) ParamNames() []GeneratorParam

ParamNames returns the set of supported input parameters when using the parameter injection generator pattern

func (SecretForDockerRegistryGeneratorV1) StructuredGenerate Uses

func (s SecretForDockerRegistryGeneratorV1) StructuredGenerate() (runtime.Object, error)

StructuredGenerate outputs a secret object using the configured fields

type SecretGeneratorV1 Uses

type SecretGeneratorV1 struct {
    // Name of secret (required)
    Name string
    // Type of secret (optional)
    Type string
    // FileSources to derive the secret from (optional)
    FileSources []string
    // LiteralSources to derive the secret from (optional)
    LiteralSources []string
}

SecretGeneratorV1 supports stable generation of an opaque secret

func (SecretGeneratorV1) Generate Uses

func (s SecretGeneratorV1) Generate(genericParams map[string]interface{}) (runtime.Object, error)

Generate returns a secret using the specified parameters

func (SecretGeneratorV1) ParamNames Uses

func (s SecretGeneratorV1) ParamNames() []GeneratorParam

ParamNames returns the set of supported input parameters when using the parameter injection generator pattern

func (SecretGeneratorV1) StructuredGenerate Uses

func (s SecretGeneratorV1) StructuredGenerate() (runtime.Object, error)

StructuredGenerate outputs a secret object using the configured fields

type ServiceAccountDescriber Uses

type ServiceAccountDescriber struct {
    client.Interface
}

ServiceAccountDescriber generates information about a service.

func (*ServiceAccountDescriber) Describe Uses

func (d *ServiceAccountDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)

type ServiceAccountGeneratorV1 Uses

type ServiceAccountGeneratorV1 struct {
    // Name of service account
    Name string
}

ServiceAccountGeneratorV1 supports stable generation of a service account

func (*ServiceAccountGeneratorV1) StructuredGenerate Uses

func (g *ServiceAccountGeneratorV1) StructuredGenerate() (runtime.Object, error)

StructuredGenerate outputs a service account object using the configured fields

type ServiceDescriber Uses

type ServiceDescriber struct {
    client.Interface
}

ServiceDescriber generates information about a service.

func (*ServiceDescriber) Describe Uses

func (d *ServiceDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)

type ServiceGeneratorV1 Uses

type ServiceGeneratorV1 struct{}

The only difference between ServiceGeneratorV1 and V2 is that the service port is named "default" in V1, while it is left unnamed in V2.

func (ServiceGeneratorV1) Generate Uses

func (ServiceGeneratorV1) Generate(params map[string]interface{}) (runtime.Object, error)

func (ServiceGeneratorV1) ParamNames Uses

func (ServiceGeneratorV1) ParamNames() []GeneratorParam

type ServiceGeneratorV2 Uses

type ServiceGeneratorV2 struct{}

func (ServiceGeneratorV2) Generate Uses

func (ServiceGeneratorV2) Generate(params map[string]interface{}) (runtime.Object, error)

func (ServiceGeneratorV2) ParamNames Uses

func (ServiceGeneratorV2) ParamNames() []GeneratorParam

type ServiceReaper Uses

type ServiceReaper struct {
    client.Interface
}

func (*ServiceReaper) Stop Uses

func (reaper *ServiceReaper) Stop(namespace, name string, timeout time.Duration, gracePeriod *api.DeleteOptions) error

type ShortcutExpander Uses

type ShortcutExpander struct {
    RESTMapper meta.RESTMapper
}

ShortcutExpander is a RESTMapper that can be used for Kubernetes resources. It expands the resource first, then invokes the wrapped RESTMapper

func (ShortcutExpander) AliasesForResource Uses

func (e ShortcutExpander) AliasesForResource(resource string) ([]string, bool)

func (ShortcutExpander) KindFor Uses

func (e ShortcutExpander) KindFor(resource unversioned.GroupVersionResource) (unversioned.GroupVersionKind, error)

func (ShortcutExpander) KindsFor Uses

func (e ShortcutExpander) KindsFor(resource unversioned.GroupVersionResource) ([]unversioned.GroupVersionKind, error)

func (ShortcutExpander) RESTMapping Uses

func (e ShortcutExpander) RESTMapping(gk unversioned.GroupKind, versions ...string) (*meta.RESTMapping, error)

func (ShortcutExpander) ResourceFor Uses

func (e ShortcutExpander) ResourceFor(resource unversioned.GroupVersionResource) (unversioned.GroupVersionResource, error)

func (ShortcutExpander) ResourceSingularizer Uses

func (e ShortcutExpander) ResourceSingularizer(resource string) (string, error)

func (ShortcutExpander) ResourcesFor Uses

func (e ShortcutExpander) ResourcesFor(resource unversioned.GroupVersionResource) ([]unversioned.GroupVersionResource, error)

type SortableEvents Uses

type SortableEvents []api.Event

SortableEvents implements sort.Interface for []api.Event based on the Timestamp field

func (SortableEvents) Len Uses

func (list SortableEvents) Len() int

func (SortableEvents) Less Uses

func (list SortableEvents) Less(i, j int) bool

func (SortableEvents) Swap Uses

func (list SortableEvents) Swap(i, j int)

type SortableResourceNames Uses

type SortableResourceNames []api.ResourceName

func (SortableResourceNames) Len Uses

func (list SortableResourceNames) Len() int

func (SortableResourceNames) Less Uses

func (list SortableResourceNames) Less(i, j int) bool

func (SortableResourceNames) Swap Uses

func (list SortableResourceNames) Swap(i, j int)

type SortableResourceQuotas Uses

type SortableResourceQuotas []api.ResourceQuota

func (SortableResourceQuotas) Len Uses

func (list SortableResourceQuotas) Len() int

func (SortableResourceQuotas) Less Uses

func (list SortableResourceQuotas) Less(i, j int) bool

func (SortableResourceQuotas) Swap Uses

func (list SortableResourceQuotas) Swap(i, j int)

type SortingPrinter Uses

type SortingPrinter struct {
    SortField string
    Delegate  ResourcePrinter
    Decoder   runtime.Decoder
}

Sorting printer sorts list types before delegating to another printer. Non-list types are simply passed through

func (*SortingPrinter) HandledResources Uses

func (p *SortingPrinter) HandledResources() []string

TODO: implement HandledResources()

func (*SortingPrinter) PrintObj Uses

func (s *SortingPrinter) PrintObj(obj runtime.Object, out io.Writer) error

type StatusViewer Uses

type StatusViewer interface {
    Status(namespace, name string) (string, bool, error)
}

StatusViewer provides an interface for resources that provides rollout status.

func StatusViewerFor Uses

func StatusViewerFor(kind unversioned.GroupKind, c client.Interface) (StatusViewer, error)

type StructuredGenerator Uses

type StructuredGenerator interface {
    // StructuredGenerator creates an API object using pre-configured parameters
    StructuredGenerate() (runtime.Object, error)
}

StructuredGenerator is an interface for things that can generate API objects not using parameter injection

type TemplatePrinter Uses

type TemplatePrinter struct {
    // contains filtered or unexported fields
}

TemplatePrinter is an implementation of ResourcePrinter which formats data with a Go Template.

func NewTemplatePrinter Uses

func NewTemplatePrinter(tmpl []byte) (*TemplatePrinter, error)

func (*TemplatePrinter) HandledResources Uses

func (p *TemplatePrinter) HandledResources() []string

TODO: implement HandledResources()

func (*TemplatePrinter) PrintObj Uses

func (p *TemplatePrinter) PrintObj(obj runtime.Object, w io.Writer) error

PrintObj formats the obj with the Go Template.

type VersionedPrinter Uses

type VersionedPrinter struct {
    // contains filtered or unexported fields
}

VersionedPrinter takes runtime objects and ensures they are converted to a given API version prior to being passed to a nested printer.

func (*VersionedPrinter) HandledResources Uses

func (p *VersionedPrinter) HandledResources() []string

TODO: implement HandledResources()

func (*VersionedPrinter) PrintObj Uses

func (p *VersionedPrinter) PrintObj(obj runtime.Object, w io.Writer) error

PrintObj implements ResourcePrinter

type YAMLPrinter Uses

type YAMLPrinter struct {
    // contains filtered or unexported fields
}

YAMLPrinter is an implementation of ResourcePrinter which outputs an object as YAML. The input object is assumed to be in the internal version of an API and is converted to the given version first.

func (*YAMLPrinter) HandledResources Uses

func (p *YAMLPrinter) HandledResources() []string

TODO: implement HandledResources()

func (*YAMLPrinter) PrintObj Uses

func (p *YAMLPrinter) PrintObj(obj runtime.Object, w io.Writer) error

PrintObj prints the data as YAML.

Directories

PathSynopsis
cmd
cmd/config
cmd/rollout
cmd/set
cmd/util
cmd/util/editor
cmd/util/jsonmerge
resourcePackage resource assists clients in dealing with RESTful objects that match the Kubernetes API conventions.
testing

Package kubectl imports 65 packages (graph). Updated 2017-03-06. Refresh now. Tools for package owners. This is a quick bug-fix fork (has fewer than three commits, and only during the week it was created).