kubernetes.v0: gopkg.in/kubernetes/kubernetes.v0/pkg/kubectl Index | Files | Directories

package kubectl

import "gopkg.in/kubernetes/kubernetes.v0/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

bash_comp_utils.go describe.go doc.go generate.go interfaces.go kubectl.go proxy_server.go resource_printer.go rolling_updater.go run.go scale.go service.go sorted_event_list.go sorted_resource_name_list.go stop.go version.go watchloop.go

Constants

const (
    DefaultHostAcceptRE   = "^localhost$,^127\\.0\\.0\\.1$,^\\[::1\\]$"
    DefaultPathAcceptRE   = "^/.*"
    DefaultPathRejectRE   = "^/api/.*/exec,^/api/.*/run"
    DefaultMethodRejectRE = "POST,PUT,PATCH"
)
const (
    Interval = time.Second * 1
    Timeout  = time.Minute * 5
)
const MaxRetries = 3

func AbortRollingUpdate Uses

func AbortRollingUpdate(c *RollingUpdaterConfig)

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 *util.StringList, usage string)

func AddLabelsToColumnsFlag Uses

func AddLabelsToColumnsFlag(cmd *cobra.Command, value *util.StringList, usage string)

AddLabelsToColumnsFlag added a user flag to print resource labels into columns. Currently used in kubectl get command

func CreateNewControllerFromCurrentController Uses

func CreateNewControllerFromCurrentController(c *client.Client, namespace, oldName, newName, image, deploymentKey string) (*api.ReplicationController, error)

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 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 FindSourceController Uses

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

func GetApiVersions Uses

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

func GetClientVersion Uses

func GetClientVersion(w io.Writer)

func GetNextControllerAnnotation Uses

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

func GetVersion Uses

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

func IsNoSuchReaperError Uses

func IsNoSuchReaperError(err error) bool

func LoadExistingNextReplicationController Uses

func LoadExistingNextReplicationController(c *client.Client, 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]string

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

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 ParseLabels Uses

func ParseLabels(labelString string) (map[string]string, error)

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

func Rename Uses

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

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 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]string) 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 BasicReplicationController Uses

type BasicReplicationController struct{}

func (BasicReplicationController) Generate Uses

func (BasicReplicationController) Generate(params map[string]string) (runtime.Object, error)

func (BasicReplicationController) ParamNames Uses

func (BasicReplicationController) ParamNames() []GeneratorParam

type ControllerScaleError Uses

type ControllerScaleError struct {
    FailureType     ControllerScaleErrorType
    ResourceVersion string
    ActualError     error
}

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

func (ControllerScaleError) Error Uses

func (c ControllerScaleError) Error() string

type ControllerScaleErrorType Uses

type ControllerScaleErrorType int
const (
    ControllerScaleGetFailure ControllerScaleErrorType = iota
    ControllerScaleUpdateFailure
)

type Describer Uses

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

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

func DescriberFor Uses

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

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

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 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]string) (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 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 recieved from watches.

func NewHumanReadablePrinter Uses

func NewHumanReadablePrinter(noHeaders, withNamespace bool, wide 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 JSONPrinter Uses

type JSONPrinter struct {
}

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

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 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) (string, error)

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) (string, error)

type NamespaceInfo Uses

type NamespaceInfo struct {
    Namespace string
}

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) (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). Implementors 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
    OutputVersion string
}

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(kind string, 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) (string, error)

type PersistentVolumeDescriber Uses

type PersistentVolumeDescriber struct {
    client.Interface
}

func (*PersistentVolumeDescriber) Describe Uses

func (d *PersistentVolumeDescriber) Describe(namespace, name string) (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) (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) (string, error)

type PreconditionError Uses

type PreconditionError struct {
    Precondition  string
    ExpectedValue string
    ActualValue   string
}

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

func (PreconditionError) Error Uses

func (pe PreconditionError) Error() 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 *client.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) Serve Uses

func (s *ProxyServer) Serve(port int) error

Serve starts the server (http.DefaultServeMux) on given port, 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) (string, 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)

func ReaperFor Uses

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

func ReaperForReplicationController Uses

func ReaperForReplicationController(c client.Interface, timeout time.Duration) (Reaper, 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) (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) (string, 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) (string, 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
}

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, version ...string) 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) 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) (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 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, c RollingUpdaterClient) *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,newRc by 1 until oldRc has 0 replicas and newRc has the original # of desired replicas. Cleanup occurs based on a RollingUpdaterCleanupPolicy.

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.

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 RollingUpdaterClient Uses

type RollingUpdaterClient interface {
    ListReplicationControllers(namespace string, selector labels.Selector) (*api.ReplicationControllerList, error)
    GetReplicationController(namespace, name string) (*api.ReplicationController, error)
    UpdateReplicationController(namespace string, rc *api.ReplicationController) (*api.ReplicationController, error)
    CreateReplicationController(namespace string, rc *api.ReplicationController) (*api.ReplicationController, error)
    DeleteReplicationController(namespace, name string) error
    ControllerHasDesiredReplicas(rc *api.ReplicationController) wait.ConditionFunc
}

RollingUpdaterClient abstracts access to ReplicationControllers.

func NewRollingUpdaterClient Uses

func NewRollingUpdaterClient(c client.Interface) RollingUpdaterClient

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
}

RollingUpdaterConfig is the configuration for a rolling deployment process.

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 replication controller for it to be valid.

func (*ScalePrecondition) Validate Uses

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

Validate 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) (string, error)
}

func ScalerFor Uses

func ScalerFor(kind string, c ScalerClient) (Scaler, error)

type ScalerClient Uses

type ScalerClient interface {
    GetReplicationController(namespace, name string) (*api.ReplicationController, error)
    UpdateReplicationController(namespace string, rc *api.ReplicationController) (*api.ReplicationController, error)
    ControllerHasDesiredReplicas(rc *api.ReplicationController) wait.ConditionFunc
}

ScalerClient abstracts access to ReplicationControllers.

func NewScalerClient Uses

func NewScalerClient(c client.Interface) ScalerClient

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) (string, error)

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) (string, error)

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) (string, error)

type ServiceGenerator Uses

type ServiceGenerator struct{}

func (ServiceGenerator) Generate Uses

func (ServiceGenerator) Generate(params map[string]string) (runtime.Object, error)

func (ServiceGenerator) ParamNames Uses

func (ServiceGenerator) 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) (string, error)

type ShortcutExpander Uses

type ShortcutExpander struct {
    meta.RESTMapper
}

ShortcutExpander is a RESTMapper that can be used for Kubernetes resources.

func (ShortcutExpander) VersionAndKindForResource Uses

func (e ShortcutExpander) VersionAndKindForResource(resource string) (defaultVersion, kind string, err error)

VersionAndKindForResource implements meta.RESTMapper. It expands the resource first, then invokes the wrapped mapper.

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 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) 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) 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) 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/util
resourcePackage resource assists clients in dealing with RESTful objects that match the Kubernetes API conventions.

Package kubectl imports 39 packages (graph). Updated 2016-07-25. Refresh now. Tools for package owners.