package cmd
import "k8s.io/kubernetes/pkg/kubectl/cmd"
Example (PrintMultiContainersReplicationControllerWithWide)¶
Code:
{
f, tf, _, ns := cmdtesting.NewAPIFactory()
p := printers.NewHumanReadablePrinter(nil, nil, printers.PrintOptions{
Wide: true,
ColumnLabels: []string{},
})
printersinternal.AddHandlers(p)
tf.Printer = p
tf.Client = &fake.RESTClient{
APIRegistry: api.Registry,
NegotiatedSerializer: ns,
Client: nil,
}
cmd := NewCmdRun(f, os.Stdin, os.Stdout, os.Stderr)
ctrl := &api.ReplicationController{
ObjectMeta: metav1.ObjectMeta{
Name: "foo",
Labels: map[string]string{"foo": "bar"},
CreationTimestamp: metav1.Time{Time: time.Now().AddDate(-10, 0, 0)},
},
Spec: api.ReplicationControllerSpec{
Replicas: 1,
Selector: map[string]string{"foo": "bar"},
Template: &api.PodTemplateSpec{
ObjectMeta: metav1.ObjectMeta{
Labels: map[string]string{"foo": "bar"},
},
Spec: api.PodSpec{
Containers: []api.Container{
{
Name: "foo",
Image: "someimage",
},
{
Name: "foo2",
Image: "someimage2",
},
},
},
},
},
Status: api.ReplicationControllerStatus{
Replicas: 1,
},
}
mapper, _ := f.Object()
err := f.PrintObject(cmd, mapper, ctrl, os.Stdout)
if err != nil {
fmt.Printf("Unexpected error: %v", err)
}
// Output:
// NAME DESIRED CURRENT READY AGE CONTAINER(S) IMAGE(S) SELECTOR
// foo 1 1 0 10y foo,foo2 someimage,someimage2 foo=bar
}
Output:
NAME DESIRED CURRENT READY AGE CONTAINER(S) IMAGE(S) SELECTOR foo 1 1 0 10y foo,foo2 someimage,someimage2 foo=bar
Example (PrintPodHideTerminated)¶
Code:
{ f, tf, _, ns := cmdtesting.NewAPIFactory() p := printers.NewHumanReadablePrinter(nil, nil, printers.PrintOptions{ ColumnLabels: []string{}, }) printersinternal.AddHandlers(p) tf.Printer = p tf.Client = &fake.RESTClient{ APIRegistry: api.Registry, NegotiatedSerializer: ns, Client: nil, } cmd := NewCmdRun(f, os.Stdin, os.Stdout, os.Stderr) podList := newAllPhasePodList() // filter pods filterFuncs := f.DefaultResourceFilterFunc() filterOpts := f.DefaultResourceFilterOptions(cmd, false) _, filteredPodList, errs := cmdutil.FilterResourceList(podList, filterFuncs, filterOpts) if errs != nil { fmt.Printf("Unexpected filter error: %v\n", errs) } for _, pod := range filteredPodList { mapper, _ := f.Object() err := f.PrintObject(cmd, mapper, pod, os.Stdout) if err != nil { fmt.Printf("Unexpected error: %v", err) } } // Output: // NAME READY STATUS RESTARTS AGE // test1 1/2 Pending 6 10y // test2 1/2 Running 6 10y // test5 1/2 Unknown 6 10y }
Output:
NAME READY STATUS RESTARTS AGE test1 1/2 Pending 6 10y test2 1/2 Running 6 10y test5 1/2 Unknown 6 10y
Example (PrintPodShowAll)¶
Code:
{
f, tf, _, ns := cmdtesting.NewAPIFactory()
p := printers.NewHumanReadablePrinter(nil, nil, printers.PrintOptions{
ShowAll: true,
ColumnLabels: []string{},
})
printersinternal.AddHandlers(p)
tf.Printer = p
tf.Client = &fake.RESTClient{
APIRegistry: api.Registry,
NegotiatedSerializer: ns,
Client: nil,
}
cmd := NewCmdRun(f, os.Stdin, os.Stdout, os.Stderr)
podList := newAllPhasePodList()
mapper, _ := f.Object()
err := f.PrintObject(cmd, mapper, podList, os.Stdout)
if err != nil {
fmt.Printf("Unexpected error: %v", err)
}
// Output:
// NAME READY STATUS RESTARTS AGE
// test1 1/2 Pending 6 10y
// test2 1/2 Running 6 10y
// test3 1/2 Succeeded 6 10y
// test4 1/2 Failed 6 10y
// test5 1/2 Unknown 6 10y
}
Output:
NAME READY STATUS RESTARTS AGE test1 1/2 Pending 6 10y test2 1/2 Running 6 10y test3 1/2 Succeeded 6 10y test4 1/2 Failed 6 10y test5 1/2 Unknown 6 10y
Example (PrintPodWithShowLabels)¶
Code:
{
f, tf, _, ns := cmdtesting.NewAPIFactory()
p := printers.NewHumanReadablePrinter(nil, nil, printers.PrintOptions{
ShowLabels: true,
ColumnLabels: []string{},
})
printersinternal.AddHandlers(p)
tf.Printer = p
tf.Client = &fake.RESTClient{
APIRegistry: api.Registry,
NegotiatedSerializer: ns,
Client: nil,
}
nodeName := "kubernetes-node-abcd"
cmd := NewCmdRun(f, os.Stdin, os.Stdout, os.Stderr)
pod := &api.Pod{
ObjectMeta: metav1.ObjectMeta{
Name: "test1",
CreationTimestamp: metav1.Time{Time: time.Now().AddDate(-10, 0, 0)},
Labels: map[string]string{
"l1": "key",
"l2": "value",
},
},
Spec: api.PodSpec{
Containers: make([]api.Container, 2),
NodeName: nodeName,
},
Status: api.PodStatus{
Phase: "podPhase",
ContainerStatuses: []api.ContainerStatus{
{Ready: true, RestartCount: 3, State: api.ContainerState{Running: &api.ContainerStateRunning{}}},
{RestartCount: 3},
},
},
}
mapper, _ := f.Object()
err := f.PrintObject(cmd, mapper, pod, os.Stdout)
if err != nil {
fmt.Printf("Unexpected error: %v", err)
}
// Output:
// NAME READY STATUS RESTARTS AGE LABELS
// test1 1/2 podPhase 6 10y l1=key,l2=value
}
Output:
NAME READY STATUS RESTARTS AGE LABELS test1 1/2 podPhase 6 10y l1=key,l2=value
Example (PrintPodWithWideFormat)¶
Code:
{
f, tf, _, ns := cmdtesting.NewAPIFactory()
p := printers.NewHumanReadablePrinter(nil, nil, printers.PrintOptions{
Wide: true,
ColumnLabels: []string{},
})
printersinternal.AddHandlers(p)
tf.Printer = p
tf.Client = &fake.RESTClient{
APIRegistry: api.Registry,
NegotiatedSerializer: ns,
Client: nil,
}
nodeName := "kubernetes-node-abcd"
cmd := NewCmdRun(f, os.Stdin, os.Stdout, os.Stderr)
pod := &api.Pod{
ObjectMeta: metav1.ObjectMeta{
Name: "test1",
CreationTimestamp: metav1.Time{Time: time.Now().AddDate(-10, 0, 0)},
},
Spec: api.PodSpec{
Containers: make([]api.Container, 2),
NodeName: nodeName,
},
Status: api.PodStatus{
Phase: "podPhase",
ContainerStatuses: []api.ContainerStatus{
{Ready: true, RestartCount: 3, State: api.ContainerState{Running: &api.ContainerStateRunning{}}},
{RestartCount: 3},
},
PodIP: "10.1.1.3",
},
}
mapper, _ := f.Object()
err := f.PrintObject(cmd, mapper, pod, os.Stdout)
if err != nil {
fmt.Printf("Unexpected error: %v", err)
}
// Output:
// NAME READY STATUS RESTARTS AGE IP NODE
// test1 1/2 podPhase 6 10y 10.1.1.3 kubernetes-node-abcd
}
Output:
NAME READY STATUS RESTARTS AGE IP NODE test1 1/2 podPhase 6 10y 10.1.1.3 kubernetes-node-abcd
Example (PrintReplicationController)¶
Code:
{
f, tf, _, ns := cmdtesting.NewAPIFactory()
p := printers.NewHumanReadablePrinter(nil, nil, printers.PrintOptions{
ColumnLabels: []string{},
})
printersinternal.AddHandlers(p)
tf.Printer = p
tf.Client = &fake.RESTClient{
APIRegistry: api.Registry,
NegotiatedSerializer: ns,
Client: nil,
}
cmd := NewCmdRun(f, os.Stdin, os.Stdout, os.Stderr)
ctrl := &api.ReplicationController{
ObjectMeta: metav1.ObjectMeta{
Name: "foo",
Labels: map[string]string{"foo": "bar"},
CreationTimestamp: metav1.Time{Time: time.Now().AddDate(-10, 0, 0)},
},
Spec: api.ReplicationControllerSpec{
Replicas: 1,
Selector: map[string]string{"foo": "bar"},
Template: &api.PodTemplateSpec{
ObjectMeta: metav1.ObjectMeta{
Labels: map[string]string{"foo": "bar"},
},
Spec: api.PodSpec{
Containers: []api.Container{
{
Name: "foo",
Image: "someimage",
},
{
Name: "foo2",
Image: "someimage",
},
},
},
},
},
Status: api.ReplicationControllerStatus{
Replicas: 1,
},
}
mapper, _ := f.Object()
err := f.PrintObject(cmd, mapper, ctrl, os.Stdout)
if err != nil {
fmt.Printf("Unexpected error: %v", err)
}
// Output:
// NAME DESIRED CURRENT READY AGE
// foo 1 1 0 10y
}
Output:
NAME DESIRED CURRENT READY AGE foo 1 1 0 10y
Example (PrintReplicationControllerWithNamespace)¶
Code:
{
f, tf, _, ns := cmdtesting.NewAPIFactory()
p := printers.NewHumanReadablePrinter(nil, nil, printers.PrintOptions{
WithNamespace: true,
ColumnLabels: []string{},
})
printersinternal.AddHandlers(p)
tf.Printer = p
tf.Client = &fake.RESTClient{
APIRegistry: api.Registry,
NegotiatedSerializer: ns,
Client: nil,
}
cmd := NewCmdRun(f, os.Stdin, os.Stdout, os.Stderr)
ctrl := &api.ReplicationController{
ObjectMeta: metav1.ObjectMeta{
Name: "foo",
Namespace: "beep",
Labels: map[string]string{"foo": "bar"},
CreationTimestamp: metav1.Time{Time: time.Now().AddDate(-10, 0, 0)},
},
Spec: api.ReplicationControllerSpec{
Replicas: 1,
Selector: map[string]string{"foo": "bar"},
Template: &api.PodTemplateSpec{
ObjectMeta: metav1.ObjectMeta{
Labels: map[string]string{"foo": "bar"},
},
Spec: api.PodSpec{
Containers: []api.Container{
{
Name: "foo",
Image: "someimage",
},
},
},
},
},
Status: api.ReplicationControllerStatus{
Replicas: 1,
ReadyReplicas: 1,
},
}
mapper, _ := f.Object()
err := f.PrintObject(cmd, mapper, ctrl, os.Stdout)
if err != nil {
fmt.Printf("Unexpected error: %v", err)
}
// Output:
// NAMESPACE NAME DESIRED CURRENT READY AGE
// beep foo 1 1 1 10y
}
Output:
NAMESPACE NAME DESIRED CURRENT READY AGE beep foo 1 1 1 10y
Example (PrintServiceWithNamespacesAndLabels)¶
Code:
{
f, tf, _, ns := cmdtesting.NewAPIFactory()
p := printers.NewHumanReadablePrinter(nil, nil, printers.PrintOptions{
WithNamespace: true,
ColumnLabels: []string{"l1"},
})
printersinternal.AddHandlers(p)
tf.Printer = p
tf.Client = &fake.RESTClient{
APIRegistry: api.Registry,
NegotiatedSerializer: ns,
Client: nil,
}
cmd := NewCmdRun(f, os.Stdin, os.Stdout, os.Stderr)
svc := &api.ServiceList{
Items: []api.Service{
{
ObjectMeta: metav1.ObjectMeta{
Name: "svc1",
Namespace: "ns1",
CreationTimestamp: metav1.Time{Time: time.Now().AddDate(-10, 0, 0)},
Labels: map[string]string{
"l1": "value",
},
},
Spec: api.ServiceSpec{
Ports: []api.ServicePort{
{Protocol: "UDP", Port: 53},
{Protocol: "TCP", Port: 53},
},
Selector: map[string]string{
"s": "magic",
},
ClusterIP: "10.1.1.1",
},
Status: api.ServiceStatus{},
},
{
ObjectMeta: metav1.ObjectMeta{
Name: "svc2",
Namespace: "ns2",
CreationTimestamp: metav1.Time{Time: time.Now().AddDate(-10, 0, 0)},
Labels: map[string]string{
"l1": "dolla-bill-yall",
},
},
Spec: api.ServiceSpec{
Ports: []api.ServicePort{
{Protocol: "TCP", Port: 80},
{Protocol: "TCP", Port: 8080},
},
Selector: map[string]string{
"s": "kazam",
},
ClusterIP: "10.1.1.2",
},
Status: api.ServiceStatus{},
}},
}
ld := strings.NewLineDelimiter(os.Stdout, "|")
defer ld.Flush()
mapper, _ := f.Object()
err := f.PrintObject(cmd, mapper, svc, ld)
if err != nil {
fmt.Printf("Unexpected error: %v", err)
}
// Output:
// |NAMESPACE NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE L1|
// |ns1 svc1 10.1.1.1 <unknown> 53/UDP,53/TCP 10y value|
// |ns2 svc2 10.1.1.2 <unknown> 80/TCP,8080/TCP 10y dolla-bill-yall|
// ||
}
Output:
|NAMESPACE NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE L1| |ns1 svc1 10.1.1.1 <unknown> 53/UDP,53/TCP 10y value| |ns2 svc2 10.1.1.2 <unknown> 80/TCP,8080/TCP 10y dolla-bill-yall| ||
Index ¶
- Constants
- func CreateClusterRoleBinding(f cmdutil.Factory, cmdOut io.Writer, cmd *cobra.Command, args []string) error
- func CreateConfigMap(f cmdutil.Factory, cmdOut io.Writer, cmd *cobra.Command, args []string) error
- func CreateDeployment(f cmdutil.Factory, cmdOut, cmdErr io.Writer, cmd *cobra.Command, args []string) error
- func CreateExternalNameService(f cmdutil.Factory, cmdOut io.Writer, cmd *cobra.Command, args []string) error
- func CreateNamespace(f cmdutil.Factory, cmdOut io.Writer, cmd *cobra.Command, args []string) error
- func CreatePodDisruptionBudget(f cmdutil.Factory, cmdOut io.Writer, cmd *cobra.Command, args []string) error
- func CreateQuota(f cmdutil.Factory, cmdOut io.Writer, cmd *cobra.Command, args []string) error
- func CreateRoleBinding(f cmdutil.Factory, cmdOut io.Writer, cmd *cobra.Command, args []string) error
- func CreateSecretDockerRegistry(f cmdutil.Factory, cmdOut io.Writer, cmd *cobra.Command, args []string) error
- func CreateSecretGeneric(f cmdutil.Factory, cmdOut io.Writer, cmd *cobra.Command, args []string) error
- func CreateSecretTLS(f cmdutil.Factory, cmdOut io.Writer, cmd *cobra.Command, args []string) error
- func CreateServiceAccount(f cmdutil.Factory, cmdOut io.Writer, cmd *cobra.Command, args []string) error
- func CreateServiceClusterIP(f cmdutil.Factory, cmdOut io.Writer, cmd *cobra.Command, args []string) error
- func CreateServiceLoadBalancer(f cmdutil.Factory, cmdOut io.Writer, cmd *cobra.Command, args []string) error
- func CreateServiceNodePort(f cmdutil.Factory, cmdOut io.Writer, cmd *cobra.Command, args []string) error
- func DeleteResult(r *resource.Result, out io.Writer, ignoreNotFound bool, shortOutput bool, mapper meta.RESTMapper) error
- func Deprecated(baseName, to string, parent, cmd *cobra.Command) string
- func DescribeMatchingResources(mapper meta.RESTMapper, typer runtime.ObjectTyper, f cmdutil.Factory, namespace, rsrc, prefix string, describerSettings *printers.DescriberSettings, out io.Writer, originalError error) error
- func NameFromCommandArgs(cmd *cobra.Command, args []string) (string, error)
- func NewCmdAnnotate(f cmdutil.Factory, out io.Writer) *cobra.Command
- func NewCmdApiVersions(f cmdutil.Factory, out io.Writer) *cobra.Command
- func NewCmdApply(f cmdutil.Factory, out, errOut io.Writer) *cobra.Command
- func NewCmdApplySetLastApplied(f cmdutil.Factory, out, err io.Writer) *cobra.Command
- func NewCmdApplyViewLastApplied(f cmdutil.Factory, out, err io.Writer) *cobra.Command
- func NewCmdAttach(f cmdutil.Factory, cmdIn io.Reader, cmdOut, cmdErr io.Writer) *cobra.Command
- func NewCmdAutoscale(f cmdutil.Factory, out io.Writer) *cobra.Command
- func NewCmdCertificate(f cmdutil.Factory, out io.Writer) *cobra.Command
- func NewCmdCertificateApprove(f cmdutil.Factory, out io.Writer) *cobra.Command
- func NewCmdCertificateDeny(f cmdutil.Factory, out io.Writer) *cobra.Command
- func NewCmdClusterInfo(f cmdutil.Factory, out io.Writer) *cobra.Command
- func NewCmdClusterInfoDump(f cmdutil.Factory, cmdOut io.Writer) *cobra.Command
- func NewCmdCompletion(f cmdutil.Factory, out io.Writer, boilerPlate string) *cobra.Command
- func NewCmdConvert(f cmdutil.Factory, out io.Writer) *cobra.Command
- func NewCmdCordon(f cmdutil.Factory, out io.Writer) *cobra.Command
- func NewCmdCp(f cmdutil.Factory, cmdIn io.Reader, cmdOut, cmdErr io.Writer) *cobra.Command
- func NewCmdCreate(f cmdutil.Factory, out, errOut io.Writer) *cobra.Command
- func NewCmdCreateClusterRole(f cmdutil.Factory, cmdOut io.Writer) *cobra.Command
- func NewCmdCreateClusterRoleBinding(f cmdutil.Factory, cmdOut io.Writer) *cobra.Command
- func NewCmdCreateConfigMap(f cmdutil.Factory, cmdOut io.Writer) *cobra.Command
- func NewCmdCreateDeployment(f cmdutil.Factory, cmdOut, cmdErr io.Writer) *cobra.Command
- func NewCmdCreateNamespace(f cmdutil.Factory, cmdOut io.Writer) *cobra.Command
- func NewCmdCreatePodDisruptionBudget(f cmdutil.Factory, cmdOut io.Writer) *cobra.Command
- func NewCmdCreateQuota(f cmdutil.Factory, cmdOut io.Writer) *cobra.Command
- func NewCmdCreateRole(f cmdutil.Factory, cmdOut io.Writer) *cobra.Command
- func NewCmdCreateRoleBinding(f cmdutil.Factory, cmdOut io.Writer) *cobra.Command
- func NewCmdCreateSecret(f cmdutil.Factory, cmdOut, errOut io.Writer) *cobra.Command
- func NewCmdCreateSecretDockerRegistry(f cmdutil.Factory, cmdOut io.Writer) *cobra.Command
- func NewCmdCreateSecretGeneric(f cmdutil.Factory, cmdOut io.Writer) *cobra.Command
- func NewCmdCreateSecretTLS(f cmdutil.Factory, cmdOut io.Writer) *cobra.Command
- func NewCmdCreateService(f cmdutil.Factory, cmdOut, errOut io.Writer) *cobra.Command
- func NewCmdCreateServiceAccount(f cmdutil.Factory, cmdOut io.Writer) *cobra.Command
- func NewCmdCreateServiceClusterIP(f cmdutil.Factory, cmdOut io.Writer) *cobra.Command
- func NewCmdCreateServiceExternalName(f cmdutil.Factory, cmdOut io.Writer) *cobra.Command
- func NewCmdCreateServiceLoadBalancer(f cmdutil.Factory, cmdOut io.Writer) *cobra.Command
- func NewCmdCreateServiceNodePort(f cmdutil.Factory, cmdOut io.Writer) *cobra.Command
- func NewCmdDelete(f cmdutil.Factory, out, errOut io.Writer) *cobra.Command
- func NewCmdDescribe(f cmdutil.Factory, out, cmdErr io.Writer) *cobra.Command
- func NewCmdDrain(f cmdutil.Factory, out, errOut io.Writer) *cobra.Command
- func NewCmdEdit(f cmdutil.Factory, out, errOut io.Writer) *cobra.Command
- func NewCmdExec(f cmdutil.Factory, cmdIn io.Reader, cmdOut, cmdErr io.Writer) *cobra.Command
- func NewCmdExplain(f cmdutil.Factory, out, cmdErr io.Writer) *cobra.Command
- func NewCmdExposeService(f cmdutil.Factory, out io.Writer) *cobra.Command
- func NewCmdGet(f cmdutil.Factory, out io.Writer, errOut io.Writer) *cobra.Command
- func NewCmdHelp(f cmdutil.Factory, out io.Writer) *cobra.Command
- func NewCmdLabel(f cmdutil.Factory, out io.Writer) *cobra.Command
- func NewCmdLogs(f cmdutil.Factory, out io.Writer) *cobra.Command
- func NewCmdOptions(out io.Writer) *cobra.Command
- func NewCmdPatch(f cmdutil.Factory, out io.Writer) *cobra.Command
- func NewCmdPortForward(f cmdutil.Factory, cmdOut, cmdErr io.Writer) *cobra.Command
- func NewCmdProxy(f cmdutil.Factory, out io.Writer) *cobra.Command
- func NewCmdReplace(f cmdutil.Factory, out io.Writer) *cobra.Command
- func NewCmdRollingUpdate(f cmdutil.Factory, out io.Writer) *cobra.Command
- func NewCmdRun(f cmdutil.Factory, cmdIn io.Reader, cmdOut, cmdErr io.Writer) *cobra.Command
- func NewCmdScale(f cmdutil.Factory, out io.Writer) *cobra.Command
- func NewCmdStop(f cmdutil.Factory, out io.Writer) *cobra.Command
- func NewCmdTaint(f cmdutil.Factory, out io.Writer) *cobra.Command
- func NewCmdTop(f cmdutil.Factory, out, errOut io.Writer) *cobra.Command
- func NewCmdTopNode(f cmdutil.Factory, out io.Writer) *cobra.Command
- func NewCmdTopPod(f cmdutil.Factory, out io.Writer) *cobra.Command
- func NewCmdUncordon(f cmdutil.Factory, out io.Writer) *cobra.Command
- func NewCmdVersion(f cmdutil.Factory, out io.Writer) *cobra.Command
- func NewKubectlCommand(f cmdutil.Factory, in io.Reader, out, err io.Writer) *cobra.Command
- func ReapResult(r *resource.Result, f cmdutil.Factory, out io.Writer, isDefaultDelete, ignoreNotFound bool, timeout time.Duration, gracePeriod int, waitForDeletion, shortOutput bool, mapper meta.RESTMapper, quiet bool) error
- func Run(f cmdutil.Factory, cmdIn io.Reader, cmdOut, cmdErr io.Writer, cmd *cobra.Command, args []string, argsLenAtDash int) error
- func RunApiVersions(f cmdutil.Factory, w io.Writer) error
- func RunApply(f cmdutil.Factory, cmd *cobra.Command, out, errOut io.Writer, options *ApplyOptions) error
- func RunAutoscale(f cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []string, options *resource.FilenameOptions) error
- func RunClusterInfo(f cmdutil.Factory, out io.Writer, cmd *cobra.Command) error
- func RunCompletion(out io.Writer, boilerPlate string, cmd *cobra.Command, args []string) error
- func RunCreate(f cmdutil.Factory, cmd *cobra.Command, out, errOut io.Writer, options *CreateOptions) error
- func RunCreateSubcommand(f cmdutil.Factory, cmd *cobra.Command, out io.Writer, options *CreateSubcommandOptions) error
- func RunDescribe(f cmdutil.Factory, out, cmdErr io.Writer, cmd *cobra.Command, args []string, options *resource.FilenameOptions, describerSettings *printers.DescriberSettings) error
- func RunEdit(f cmdutil.Factory, out, errOut io.Writer, cmd *cobra.Command, args []string, options *resource.FilenameOptions) error
- func RunEditOnCreate(f cmdutil.Factory, out, errOut io.Writer, cmd *cobra.Command, options *resource.FilenameOptions) error
- func RunExplain(f cmdutil.Factory, out, cmdErr io.Writer, cmd *cobra.Command, args []string) error
- func RunExpose(f cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []string, options *resource.FilenameOptions) error
- func RunGet(f cmdutil.Factory, out, errOut io.Writer, cmd *cobra.Command, args []string, options *GetOptions) error
- func RunHelp(cmd *cobra.Command, args []string)
- func RunPatch(f cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []string, options *PatchOptions) error
- func RunProxy(f cmdutil.Factory, out io.Writer, cmd *cobra.Command) error
- func RunReplace(f cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []string, options *resource.FilenameOptions) error
- func RunRollingUpdate(f cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []string, options *resource.FilenameOptions) error
- func RunScale(f cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []string, shortOutput bool, options *resource.FilenameOptions) error
- func RunStop(f cmdutil.Factory, cmd *cobra.Command, args []string, out io.Writer, options *resource.FilenameOptions) error
- func RunVersion(f cmdutil.Factory, out io.Writer, cmd *cobra.Command) error
- func SupportEviction(clientset internalclientset.Interface) (string, error)
- func ValidateArgs(cmd *cobra.Command, args []string) error
- type AnnotateOptions
- func (o *AnnotateOptions) Complete(f cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []string) (err error)
- func (o AnnotateOptions) RunAnnotate(f cmdutil.Factory, cmd *cobra.Command) error
- func (o AnnotateOptions) Validate() error
- type ApplyOptions
- type AttachOptions
- func (p *AttachOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, argsIn []string) error
- func (p *AttachOptions) GetContainerName(pod *api.Pod) (string, error)
- func (p *AttachOptions) Run() error
- func (p *AttachOptions) Validate() error
- type CertificateOptions
- func (options *CertificateOptions) Complete(cmd *cobra.Command, args []string) error
- func (options *CertificateOptions) RunCertificateApprove(f cmdutil.Factory, out io.Writer) error
- func (options *CertificateOptions) RunCertificateDeny(f cmdutil.Factory, out io.Writer) error
- func (options *CertificateOptions) Validate() error
- type ConvertOptions
- func (o *ConvertOptions) Complete(f cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []string) (err error)
- func (o *ConvertOptions) RunConvert() error
- type CreateClusterRoleOptions
- type CreateOptions
- type CreateRoleOptions
- func (c *CreateRoleOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, args []string) error
- func (c *CreateRoleOptions) RunCreateRole() error
- func (c *CreateRoleOptions) Validate() error
- type CreateSubcommandOptions
- type DefaultRemoteAttach
- type DefaultRemoteExecutor
- type DeleteOptions
- func (o *DeleteOptions) Complete(f cmdutil.Factory, out, errOut io.Writer, args []string) error
- func (o *DeleteOptions) RunDelete() error
- func (o *DeleteOptions) Validate(f cmdutil.Factory, cmd *cobra.Command) error
- type DrainOptions
- func (o *DrainOptions) RunCordonOrUncordon(desired bool) error
- func (o *DrainOptions) RunDrain() error
- func (o *DrainOptions) SetupDrain(cmd *cobra.Command, args []string) error
- type EditMode
- type ExecOptions
- func (p *ExecOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, argsIn []string, argsLenAtDash int) error
- func (p *ExecOptions) Run() error
- func (p *ExecOptions) Validate() error
- type GetOptions
- type HeapsterTopOptions
- type LabelOptions
- func (o *LabelOptions) Complete(f cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []string) (err error)
- func (o *LabelOptions) RunLabel(f cmdutil.Factory, cmd *cobra.Command) error
- func (o *LabelOptions) Validate() error
- type LogsOptions
- func (o *LogsOptions) Complete(f cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []string) error
- func (o LogsOptions) RunLogs() error
- func (o LogsOptions) Validate() error
- type PatchOptions
- type PortForwardOptions
- func (o *PortForwardOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, args []string, cmdOut io.Writer, cmdErr io.Writer) error
- func (o PortForwardOptions) RunPortForward() error
- func (o PortForwardOptions) Validate() error
- type RemoteAttach
- type RemoteExecutor
- type SetLastAppliedOptions
- func (o *SetLastAppliedOptions) Complete(f cmdutil.Factory, cmd *cobra.Command) error
- func (o *SetLastAppliedOptions) RunSetLastApplied(f cmdutil.Factory, cmd *cobra.Command) error
- func (o *SetLastAppliedOptions) Validate(f cmdutil.Factory, cmd *cobra.Command) error
- type StreamOptions
- type TaintOptions
- func (o *TaintOptions) Complete(f cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []string) (err error)
- func (o TaintOptions) RunTaint() error
- func (o TaintOptions) Validate(args []string) error
- type TopNodeOptions
- func (o *TopNodeOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, args []string, out io.Writer) error
- func (o TopNodeOptions) RunTopNode() error
- func (o *TopNodeOptions) Validate() error
- type TopOptions
- type TopPodOptions
- func (o *TopPodOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, args []string, out io.Writer) error
- func (o TopPodOptions) RunTopPod() error
- func (o *TopPodOptions) Validate() error
- type ViewLastAppliedOptions
Examples ¶
- package (PrintMultiContainersReplicationControllerWithWide)
- package (PrintPodHideTerminated)
- package (PrintPodShowAll)
- package (PrintPodWithShowLabels)
- package (PrintPodWithWideFormat)
- package (PrintReplicationController)
- package (PrintReplicationControllerWithNamespace)
- package (PrintServiceWithNamespacesAndLabels)
Constants ¶
const ( EvictionKind = "Eviction" EvictionSubresource = "pods/eviction" )
Functions ¶
func CreateClusterRoleBinding ¶
func CreateClusterRoleBinding(f cmdutil.Factory, cmdOut io.Writer, cmd *cobra.Command, args []string) error
CreateClusterRoleBinding is the implementation of the create configmap command.
func CreateConfigMap ¶
CreateConfigMap is the implementation of the create configmap command.
func CreateDeployment ¶
func CreateDeployment(f cmdutil.Factory, cmdOut, cmdErr io.Writer, cmd *cobra.Command, args []string) error
CreateDeployment implements the behavior to run the create deployment command
func CreateExternalNameService ¶
func CreateExternalNameService(f cmdutil.Factory, cmdOut io.Writer, cmd *cobra.Command, args []string) error
CreateExternalNameService is the implementation of the service externalname command
func CreateNamespace ¶
CreateNamespace implements the behavior to run the create namespace command
func CreatePodDisruptionBudget ¶
func CreatePodDisruptionBudget(f cmdutil.Factory, cmdOut io.Writer, cmd *cobra.Command, args []string) error
CreatePodDisruptionBudget implements the behavior to run the create pdb command.
func CreateQuota ¶
CreateQuota implements the behavior to run the create quota command
func CreateRoleBinding ¶
func CreateRoleBinding(f cmdutil.Factory, cmdOut io.Writer, cmd *cobra.Command, args []string) error
func CreateSecretDockerRegistry ¶
func CreateSecretDockerRegistry(f cmdutil.Factory, cmdOut io.Writer, cmd *cobra.Command, args []string) error
CreateSecretDockerRegistry is the implementation of the create secret docker-registry command
func CreateSecretGeneric ¶
func CreateSecretGeneric(f cmdutil.Factory, cmdOut io.Writer, cmd *cobra.Command, args []string) error
CreateSecretGeneric is the implementation of the create secret generic command
func CreateSecretTLS ¶
CreateSecretTLS is the implementation of the create secret tls command
func CreateServiceAccount ¶
func CreateServiceAccount(f cmdutil.Factory, cmdOut io.Writer, cmd *cobra.Command, args []string) error
CreateServiceAccount implements the behavior to run the create service account command
func CreateServiceClusterIP ¶
func CreateServiceClusterIP(f cmdutil.Factory, cmdOut io.Writer, cmd *cobra.Command, args []string) error
CreateServiceClusterIP implements the behavior to run the create service clusterIP command
func CreateServiceLoadBalancer ¶
func CreateServiceLoadBalancer(f cmdutil.Factory, cmdOut io.Writer, cmd *cobra.Command, args []string) error
CreateServiceLoadBalancer is the implementation of the service loadbalancer command
func CreateServiceNodePort ¶
func CreateServiceNodePort(f cmdutil.Factory, cmdOut io.Writer, cmd *cobra.Command, args []string) error
CreateServiceNodePort is the implementation of the create service nodeport command
func DeleteResult ¶
func DeleteResult(r *resource.Result, out io.Writer, ignoreNotFound bool, shortOutput bool, mapper meta.RESTMapper) error
func Deprecated ¶
func DescribeMatchingResources ¶
func DescribeMatchingResources(mapper meta.RESTMapper, typer runtime.ObjectTyper, f cmdutil.Factory, namespace, rsrc, prefix string, describerSettings *printers.DescriberSettings, out io.Writer, originalError error) error
func NameFromCommandArgs ¶
NameFromCommandArgs is a utility function for commands that assume the first argument is a resource name
func NewCmdAnnotate ¶
func NewCmdApiVersions ¶
func NewCmdApply ¶
func NewCmdApplySetLastApplied ¶
func NewCmdApplyViewLastApplied ¶
func NewCmdAttach ¶
func NewCmdAutoscale ¶
func NewCmdCertificate ¶
func NewCmdCertificateApprove ¶
func NewCmdCertificateDeny ¶
func NewCmdClusterInfo ¶
func NewCmdClusterInfoDump ¶
NewCmdCreateSecret groups subcommands to create various types of secrets
func NewCmdCompletion ¶
func NewCmdConvert ¶
NewCmdConvert creates a command object for the generic "convert" action, which translates the config file into a given version.
func NewCmdCordon ¶
func NewCmdCp ¶
NewCmdCp creates a new Copy command.
func NewCmdCreate ¶
func NewCmdCreateClusterRole ¶
ClusterRole is a command to ease creating ClusterRoles.
func NewCmdCreateClusterRoleBinding ¶
ClusterRoleBinding is a command to ease creating ClusterRoleBindings.
func NewCmdCreateConfigMap ¶
ConfigMap is a command to ease creating ConfigMaps.
func NewCmdCreateDeployment ¶
NewCmdCreateDeployment is a macro command to create a new deployment
func NewCmdCreateNamespace ¶
NewCmdCreateNamespace is a macro command to create a new namespace
func NewCmdCreatePodDisruptionBudget ¶
NewCmdCreatePodDisruptionBudget is a macro command to create a new pod disruption budget.
func NewCmdCreateQuota ¶
NewCmdCreateQuota is a macro command to create a new quota
func NewCmdCreateRole ¶
Role is a command to ease creating Roles.
func NewCmdCreateRoleBinding ¶
RoleBinding is a command to ease creating RoleBindings.
func NewCmdCreateSecret ¶
NewCmdCreateSecret groups subcommands to create various types of secrets
func NewCmdCreateSecretDockerRegistry ¶
NewCmdCreateSecretDockerRegistry is a macro command for creating secrets to work with Docker registries
func NewCmdCreateSecretGeneric ¶
NewCmdCreateSecretGeneric is a command to create generic secrets from files, directories, or literal values
func NewCmdCreateSecretTLS ¶
NewCmdCreateSecretTLS is a macro command for creating secrets to work with Docker registries
func NewCmdCreateService ¶
NewCmdCreateService is a macro command to create a new service
func NewCmdCreateServiceAccount ¶
NewCmdCreateServiceAccount is a macro command to create a new service account
func NewCmdCreateServiceClusterIP ¶
NewCmdCreateServiceClusterIP is a command to create a clusterIP service
func NewCmdCreateServiceExternalName ¶
NewCmdCreateServiceExternalName is a macro command for creating a ExternalName service
func NewCmdCreateServiceLoadBalancer ¶
NewCmdCreateServiceLoadBalancer is a macro command for creating a LoadBalancer service
func NewCmdCreateServiceNodePort ¶
NewCmdCreateServiceNodePort is a macro command for creating a NodePort service
func NewCmdDelete ¶
func NewCmdDescribe ¶
func NewCmdDrain ¶
func NewCmdEdit ¶
func NewCmdExec ¶
func NewCmdExplain ¶
NewCmdExplain returns a cobra command for swagger docs
func NewCmdExposeService ¶
func NewCmdGet ¶
NewCmdGet creates a command object for the generic "get" action, which retrieves one or more resources from a server.
func NewCmdHelp ¶
func NewCmdLabel ¶
func NewCmdLogs ¶
NewCmdLog creates a new pod logs command
func NewCmdOptions ¶
NewCmdOptions implements the options command
func NewCmdPatch ¶
func NewCmdPortForward ¶
func NewCmdProxy ¶
func NewCmdReplace ¶
func NewCmdRollingUpdate ¶
func NewCmdRun ¶
func NewCmdScale ¶
NewCmdScale returns a cobra command with the appropriate configuration and flags to run scale
func NewCmdStop ¶
func NewCmdTaint ¶
func NewCmdTop ¶
func NewCmdTopNode ¶
func NewCmdTopPod ¶
func NewCmdUncordon ¶
func NewCmdVersion ¶
func NewKubectlCommand ¶
NewKubectlCommand creates the `kubectl` command and its nested children.
func ReapResult ¶
func ReapResult(r *resource.Result, f cmdutil.Factory, out io.Writer, isDefaultDelete, ignoreNotFound bool, timeout time.Duration, gracePeriod int, waitForDeletion, shortOutput bool, mapper meta.RESTMapper, quiet bool) error
func Run ¶
func Run(f cmdutil.Factory, cmdIn io.Reader, cmdOut, cmdErr io.Writer, cmd *cobra.Command, args []string, argsLenAtDash int) error
func RunApiVersions ¶
func RunApply ¶
func RunApply(f cmdutil.Factory, cmd *cobra.Command, out, errOut io.Writer, options *ApplyOptions) error
func RunAutoscale ¶
func RunAutoscale(f cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []string, options *resource.FilenameOptions) error
func RunClusterInfo ¶
func RunCompletion ¶
func RunCreate ¶
func RunCreate(f cmdutil.Factory, cmd *cobra.Command, out, errOut io.Writer, options *CreateOptions) error
func RunCreateSubcommand ¶
func RunCreateSubcommand(f cmdutil.Factory, cmd *cobra.Command, out io.Writer, options *CreateSubcommandOptions) error
RunCreateSubcommand executes a create subcommand using the specified options
func RunDescribe ¶
func RunDescribe(f cmdutil.Factory, out, cmdErr io.Writer, cmd *cobra.Command, args []string, options *resource.FilenameOptions, describerSettings *printers.DescriberSettings) error
func RunEdit ¶
func RunEdit(f cmdutil.Factory, out, errOut io.Writer, cmd *cobra.Command, args []string, options *resource.FilenameOptions) error
func RunEditOnCreate ¶
func RunEditOnCreate(f cmdutil.Factory, out, errOut io.Writer, cmd *cobra.Command, options *resource.FilenameOptions) error
func RunExplain ¶
RunExplain executes the appropriate steps to print a model's documentation
func RunExpose ¶
func RunExpose(f cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []string, options *resource.FilenameOptions) error
func RunGet ¶
func RunGet(f cmdutil.Factory, out, errOut io.Writer, cmd *cobra.Command, args []string, options *GetOptions) error
RunGet implements the generic Get command TODO: convert all direct flag accessors to a struct and pass that instead of cmd
func RunHelp ¶
func RunPatch ¶
func RunPatch(f cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []string, options *PatchOptions) error
func RunProxy ¶
func RunReplace ¶
func RunReplace(f cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []string, options *resource.FilenameOptions) error
func RunRollingUpdate ¶
func RunRollingUpdate(f cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []string, options *resource.FilenameOptions) error
func RunScale ¶
func RunScale(f cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []string, shortOutput bool, options *resource.FilenameOptions) error
RunScale executes the scaling
func RunStop ¶
func RunStop(f cmdutil.Factory, cmd *cobra.Command, args []string, out io.Writer, options *resource.FilenameOptions) error
func RunVersion ¶
func SupportEviction ¶
func SupportEviction(clientset internalclientset.Interface) (string, error)
SupportEviction uses Discovery API to find out if the server support eviction subresource If support, it will return its groupVersion; Otherwise, it will return ""
func ValidateArgs ¶
Types ¶
type AnnotateOptions ¶
type AnnotateOptions struct { // Filename options resource.FilenameOptions // contains filtered or unexported fields }
AnnotateOptions have the data required to perform the annotate operation
func (*AnnotateOptions) Complete ¶
func (o *AnnotateOptions) Complete(f cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []string) (err error)
Complete adapts from the command line args and factory to the data required.
func (AnnotateOptions) RunAnnotate ¶
RunAnnotate does the work
func (AnnotateOptions) Validate ¶
func (o AnnotateOptions) Validate() error
Validate checks to the AnnotateOptions to see if there is sufficient information run the command.
type ApplyOptions ¶
type ApplyOptions struct { FilenameOptions resource.FilenameOptions Selector string Force bool Prune bool Cascade bool GracePeriod int PruneResources []pruneResource Timeout time.Duration }
type AttachOptions ¶
type AttachOptions struct { StreamOptions CommandName string Pod *api.Pod Attach RemoteAttach PodClient coreclient.PodsGetter Config *restclient.Config }
AttachOptions declare the arguments accepted by the Exec command
func (*AttachOptions) Complete ¶
Complete verifies command line arguments and loads data from the command environment
func (*AttachOptions) GetContainerName ¶
func (p *AttachOptions) GetContainerName(pod *api.Pod) (string, error)
GetContainerName returns the name of the container to attach to, with a fallback.
func (*AttachOptions) Run ¶
func (p *AttachOptions) Run() error
Run executes a validated remote execution against a pod.
func (*AttachOptions) Validate ¶
func (p *AttachOptions) Validate() error
Validate checks that the provided attach options are specified.
type CertificateOptions ¶
type CertificateOptions struct { resource.FilenameOptions // contains filtered or unexported fields }
func (*CertificateOptions) Complete ¶
func (options *CertificateOptions) Complete(cmd *cobra.Command, args []string) error
func (*CertificateOptions) RunCertificateApprove ¶
func (*CertificateOptions) RunCertificateDeny ¶
func (*CertificateOptions) Validate ¶
func (options *CertificateOptions) Validate() error
type ConvertOptions ¶
type ConvertOptions struct { resource.FilenameOptions // contains filtered or unexported fields }
ConvertOptions have the data required to perform the convert operation
func (*ConvertOptions) Complete ¶
func (o *ConvertOptions) Complete(f cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []string) (err error)
Complete collects information required to run Convert command from command line.
func (*ConvertOptions) RunConvert ¶
func (o *ConvertOptions) RunConvert() error
RunConvert implements the generic Convert command
type CreateClusterRoleOptions ¶
type CreateClusterRoleOptions struct { *CreateRoleOptions }
func (*CreateClusterRoleOptions) RunCreateRole ¶
func (c *CreateClusterRoleOptions) RunCreateRole() error
type CreateOptions ¶
type CreateOptions struct { FilenameOptions resource.FilenameOptions Selector string EditBeforeCreate bool }
type CreateRoleOptions ¶
type CreateRoleOptions struct { Name string Verbs []string Resources []schema.GroupVersionResource ResourceNames []string DryRun bool OutputFormat string Namespace string Client internalversionrbac.RbacInterface Mapper meta.RESTMapper Out io.Writer PrintObject func(obj runtime.Object) error }
func (*CreateRoleOptions) Complete ¶
func (*CreateRoleOptions) RunCreateRole ¶
func (c *CreateRoleOptions) RunCreateRole() error
func (*CreateRoleOptions) Validate ¶
func (c *CreateRoleOptions) Validate() error
type CreateSubcommandOptions ¶
type CreateSubcommandOptions struct { // Name of resource being created Name string // StructuredGenerator is the resource generator for the object being created StructuredGenerator kubectl.StructuredGenerator // DryRun is true if the command should be simulated but not run against the server DryRun bool // OutputFormat OutputFormat string }
CreateSubcommandOptions is an options struct to support create subcommands
type DefaultRemoteAttach ¶
type DefaultRemoteAttach struct{}
DefaultRemoteAttach is the standard implementation of attaching
func (*DefaultRemoteAttach) Attach ¶
func (*DefaultRemoteAttach) Attach(method string, url *url.URL, config *restclient.Config, stdin io.Reader, stdout, stderr io.Writer, tty bool, terminalSizeQueue term.TerminalSizeQueue) error
type DefaultRemoteExecutor ¶
type DefaultRemoteExecutor struct{}
DefaultRemoteExecutor is the standard implementation of remote command execution
func (*DefaultRemoteExecutor) Execute ¶
func (*DefaultRemoteExecutor) Execute(method string, url *url.URL, config *restclient.Config, stdin io.Reader, stdout, stderr io.Writer, tty bool, terminalSizeQueue term.TerminalSizeQueue) error
type DeleteOptions ¶
type DeleteOptions struct { resource.FilenameOptions Selector string DeleteAll bool IgnoreNotFound bool Cascade bool DeleteNow bool ForceDeletion bool WaitForDeletion bool GracePeriod int Timeout time.Duration Include3rdParty bool Output string Mapper meta.RESTMapper Result *resource.Result Out io.Writer ErrOut io.Writer // contains filtered or unexported fields }
func (*DeleteOptions) Complete ¶
func (*DeleteOptions) RunDelete ¶
func (o *DeleteOptions) RunDelete() error
func (*DeleteOptions) Validate ¶
type DrainOptions ¶
type DrainOptions struct { Factory cmdutil.Factory Force bool GracePeriodSeconds int IgnoreDaemonsets bool Timeout time.Duration DeleteLocalData bool Out io.Writer ErrOut io.Writer // contains filtered or unexported fields }
func (*DrainOptions) RunCordonOrUncordon ¶
func (o *DrainOptions) RunCordonOrUncordon(desired bool) error
RunCordonOrUncordon runs either Cordon or Uncordon. The desired value for "Unschedulable" is passed as the first arg.
func (*DrainOptions) RunDrain ¶
func (o *DrainOptions) RunDrain() error
RunDrain runs the 'drain' command
func (*DrainOptions) SetupDrain ¶
func (o *DrainOptions) SetupDrain(cmd *cobra.Command, args []string) error
SetupDrain populates some fields from the factory, grabs command line arguments and looks up the node using Builder
type EditMode ¶
type EditMode string
const ( NormalEditMode EditMode = "normal_mode" EditBeforeCreateMode EditMode = "edit_before_create_mode" )
type ExecOptions ¶
type ExecOptions struct { StreamOptions Command []string FullCmdName string SuggestedCmdUsage string Executor RemoteExecutor PodClient coreclient.PodsGetter Config *restclient.Config }
ExecOptions declare the arguments accepted by the Exec command
func (*ExecOptions) Complete ¶
func (p *ExecOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, argsIn []string, argsLenAtDash int) error
Complete verifies command line arguments and loads data from the command environment
func (*ExecOptions) Run ¶
func (p *ExecOptions) Run() error
Run executes a validated remote execution against a pod.
func (*ExecOptions) Validate ¶
func (p *ExecOptions) Validate() error
Validate checks that the provided exec options are specified.
type GetOptions ¶
type GetOptions struct { resource.FilenameOptions IgnoreNotFound bool Raw string }
GetOptions 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()
type HeapsterTopOptions ¶
func (*HeapsterTopOptions) Bind ¶
func (o *HeapsterTopOptions) Bind(flags *pflag.FlagSet)
type LabelOptions ¶
type LabelOptions struct { // Filename options resource.FilenameOptions // contains filtered or unexported fields }
LabelOptions have the data required to perform the label operation
func (*LabelOptions) Complete ¶
func (o *LabelOptions) Complete(f cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []string) (err error)
Complete adapts from the command line args and factory to the data required.
func (*LabelOptions) RunLabel ¶
RunLabel does the work
func (*LabelOptions) Validate ¶
func (o *LabelOptions) Validate() error
Validate checks to the LabelOptions to see if there is sufficient information run the command.
type LogsOptions ¶
type LogsOptions struct { Namespace string ResourceArg string Options runtime.Object Mapper meta.RESTMapper Typer runtime.ObjectTyper ClientMapper resource.ClientMapper Decoder runtime.Decoder Object runtime.Object LogsForObject func(object, options runtime.Object) (*restclient.Request, error) Out io.Writer }
func (*LogsOptions) Complete ¶
func (o *LogsOptions) Complete(f cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []string) error
func (LogsOptions) RunLogs ¶
func (o LogsOptions) RunLogs() error
RunLogs retrieves a pod log
func (LogsOptions) Validate ¶
func (o LogsOptions) Validate() error
type PatchOptions ¶
type PatchOptions struct { resource.FilenameOptions Local bool OutputFormat string }
PatchOptions 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()
type PortForwardOptions ¶
type PortForwardOptions struct { Namespace string PodName string RESTClient *restclient.RESTClient Config *restclient.Config PodClient coreclient.PodsGetter Ports []string PortForwarder portForwarder StopChannel chan struct{} ReadyChannel chan struct{} }
PortForwardOptions contains all the options for running the port-forward cli command.
func (*PortForwardOptions) Complete ¶
func (o *PortForwardOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, args []string, cmdOut io.Writer, cmdErr io.Writer) error
Complete completes all the required options for port-forward cmd.
func (PortForwardOptions) RunPortForward ¶
func (o PortForwardOptions) RunPortForward() error
RunPortForward implements all the necessary functionality for port-forward cmd.
func (PortForwardOptions) Validate ¶
func (o PortForwardOptions) Validate() error
Validate validates all the required options for port-forward cmd.
type RemoteAttach ¶
type RemoteAttach interface { Attach(method string, url *url.URL, config *restclient.Config, stdin io.Reader, stdout, stderr io.Writer, tty bool, terminalSizeQueue term.TerminalSizeQueue) error }
RemoteAttach defines the interface accepted by the Attach command - provided for test stubbing
type RemoteExecutor ¶
type RemoteExecutor interface { Execute(method string, url *url.URL, config *restclient.Config, stdin io.Reader, stdout, stderr io.Writer, tty bool, terminalSizeQueue term.TerminalSizeQueue) error }
RemoteExecutor defines the interface accepted by the Exec command - provided for test stubbing
type SetLastAppliedOptions ¶
type SetLastAppliedOptions struct { FilenameOptions resource.FilenameOptions Selector string InfoList []*resource.Info Mapper meta.RESTMapper Typer runtime.ObjectTyper Namespace string EnforceNamespace bool DryRun bool ShortOutput bool CreateAnnotation bool Output string Codec runtime.Encoder PatchBufferList [][]byte Factory cmdutil.Factory Out io.Writer ErrOut io.Writer }
func (*SetLastAppliedOptions) Complete ¶
func (*SetLastAppliedOptions) RunSetLastApplied ¶
func (*SetLastAppliedOptions) Validate ¶
type StreamOptions ¶
type StreamOptions struct { Namespace string PodName string ContainerName string Stdin bool TTY bool // minimize unnecessary output Quiet bool // InterruptParent, if set, is used to handle interrupts while attached InterruptParent *interrupt.Handler In io.Reader Out io.Writer Err io.Writer // contains filtered or unexported fields }
type TaintOptions ¶
type TaintOptions struct {
// contains filtered or unexported fields
}
TaintOptions have the data required to perform the taint operation
func (*TaintOptions) Complete ¶
func (o *TaintOptions) Complete(f cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []string) (err error)
Complete adapts from the command line args and factory to the data required.
func (TaintOptions) RunTaint ¶
func (o TaintOptions) RunTaint() error
RunTaint does the work
func (TaintOptions) Validate ¶
func (o TaintOptions) Validate(args []string) error
Validate checks to the TaintOptions to see if there is sufficient information run the command.
type TopNodeOptions ¶
type TopNodeOptions struct { ResourceName string Selector string NodeClient coreclient.NodesGetter HeapsterOptions HeapsterTopOptions Client *metricsutil.HeapsterMetricsClient Printer *metricsutil.TopCmdPrinter }
TopNodeOptions contains all the options for running the top-node cli command.
func (*TopNodeOptions) Complete ¶
func (o *TopNodeOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, args []string, out io.Writer) error
func (TopNodeOptions) RunTopNode ¶
func (o TopNodeOptions) RunTopNode() error
func (*TopNodeOptions) Validate ¶
func (o *TopNodeOptions) Validate() error
type TopOptions ¶
type TopOptions struct{}
TopOptions contains all the options for running the top cli command.
type TopPodOptions ¶
type TopPodOptions struct { ResourceName string Namespace string Selector string AllNamespaces bool PrintContainers bool PodClient coreclient.PodsGetter HeapsterOptions HeapsterTopOptions Client *metricsutil.HeapsterMetricsClient Printer *metricsutil.TopCmdPrinter }
func (*TopPodOptions) Complete ¶
func (o *TopPodOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, args []string, out io.Writer) error
func (TopPodOptions) RunTopPod ¶
func (o TopPodOptions) RunTopPod() error
func (*TopPodOptions) Validate ¶
func (o *TopPodOptions) Validate() error
type ViewLastAppliedOptions ¶
type ViewLastAppliedOptions struct { FilenameOptions resource.FilenameOptions Selector string LastAppliedConfigurationList []string OutputFormat string Factory cmdutil.Factory Out io.Writer ErrOut io.Writer }
func (*ViewLastAppliedOptions) Complete ¶
func (o *ViewLastAppliedOptions) Complete(f cmdutil.Factory, args []string) error
func (*ViewLastAppliedOptions) RunApplyViewLastApplied ¶
func (o *ViewLastAppliedOptions) RunApplyViewLastApplied() error
func (*ViewLastAppliedOptions) Validate ¶
func (o *ViewLastAppliedOptions) Validate(cmd *cobra.Command) error
func (*ViewLastAppliedOptions) ValidateOutputArgs ¶
func (o *ViewLastAppliedOptions) ValidateOutputArgs(cmd *cobra.Command) error
Source Files ¶
annotate.go apiversions.go apply.go apply_set_last_applied.go apply_view_last_applied.go attach.go autoscale.go certificates.go clusterinfo.go clusterinfo_dump.go cmd.go completion.go convert.go cp.go create.go create_clusterrole.go create_clusterrolebinding.go create_configmap.go create_deployment.go create_namespace.go create_pdb.go create_quota.go create_role.go create_rolebinding.go create_secret.go create_service.go create_serviceaccount.go delete.go describe.go drain.go edit.go exec.go explain.go expose.go get.go help.go label.go logs.go options.go patch.go portforward.go proxy.go replace.go rollingupdate.go run.go scale.go stop.go taint.go top.go top_node.go top_pod.go version.go
Directories ¶
- Version
- v1.6.2
- Published
- Apr 19, 2017
- Platform
- js/wasm
- Imports
- 95 packages
- Last checked
- 3 minutes ago –
Tools for package owners.