Commit Graph

509 Commits (fccb19da9fe63dadcc52ccd81a4501fc42eedd9f)

Author SHA1 Message Date
Slava Semushin f49a0fbd5f Replace UserIDRange/GroupIDRange by IDRange in internal type to reduce difference with external type.
We had IDRange in both types prior 9440a68744 commit that splitted it
into UserIDRange/GroupIDRange. Later, in c91a12d205 commit we had to
revert this changes because they broke backward compatibility but
UserIDRange/GroupIDRange struct left in the internal type.

This commit removes these leftovers and reduces the differences
between internal and external types.
2018-05-04 18:31:42 +02:00
David Eads e1fca70506 slim down printer interface 2018-05-04 11:15:35 -04:00
Kubernetes Submit Queue b52ebfa28e
Merge pull request #63312 from deads2k/cli-44-encoder
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

remove unnecessary encoder

Followups to https://github.com/kubernetes/kubernetes/pull/63105
2018-05-03 16:11:17 -07:00
David Eads 9a48066749 update restmapping to indicate fully qualified resource 2018-05-01 16:34:49 -04:00
David Eads 94e3d94d67 update tests to be specific about the versions they are testing instead of floating 2018-05-01 13:18:41 -04:00
David Eads 04384481cd remove unnecessary encoder 2018-04-30 14:55:15 -04:00
David Eads 6900f8856f rest mappings cannot logically be object converters 2018-04-26 12:47:25 -04:00
David Eads a89291a5de stop duplicating preferred version order 2018-04-26 10:03:36 -04:00
Kubernetes Submit Queue acbccfba84
Merge pull request #62820 from juanvallejo/jvallejo/wire-more-print-flags
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

wire printflags through additional cmds

**Release note**:
```release-note
NONE
```

Adds PrintFlag pattern to more commands.

cc @deads2k @soltysh
2018-04-26 02:20:34 -07:00
juanvallejo ac6ca38dd7 report outputFormat in PrintFlags err 2018-04-25 16:35:56 -04:00
juanvallejo 27bd4ded04 wire printflags through additional cmds 2018-04-25 16:07:32 -04:00
juanvallejo 191a48f4c3 wire PrintFlags through get cmd 2018-04-25 15:02:48 -04:00
juanvallejo df6a7ea654 move "get" cmd pieces to cmd/get 2018-04-25 14:58:12 -04:00
Kubernetes Submit Queue df489968b7
Merge pull request #62877 from deads2k/cli-34-describer
Automatic merge from submit-queue (batch tested with PRs 62982, 63075, 63067, 62877, 63141). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

make describers more generic from the CLI

I've made this change very small so the intent and explanation make sense to people.

Clients are not generic.  Client**Configs** are generic.  We faced this distinction in the apiserver and it took us a little to hurdle it.  When you try to provide a generic example or function, you need to provide Client**Config**, not a kube clientset.  The reason is that the code you're calling may have generated their own clientset, may want to use a dynamic one, or may want to a simple restclient.  As we seek to make `kubectl` primitives more generally applicable, this is an example we'll want to follow.  I suspect we'll be making more changes along these veins as we tease out the generic pieces of `kubectl ` to make a friendly CLI library.


@kubernetes/sig-cli-maintainers 

/hold

Holding for a few days to make sure that people have time to read and digest.

```release-note
NONE
```
2018-04-25 11:53:21 -07:00
David Eads e7fbbe0e3c eliminate indirection from type registration 2018-04-25 09:02:31 -04:00
Kubernetes Submit Queue 9baf337cf3
Merge pull request #63084 from mikedanese/ctx
Automatic merge from submit-queue (batch tested with PRs 59220, 62927, 63084, 63090, 62284). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

replace request.Context with context.Context

Followup on https://github.com/kubernetes/kubernetes/pull/62810

cc @liggitt @kubernetes/sig-api-machinery-pr-reviews 

```release-note
NONE
```
2018-04-24 19:01:17 -07:00
Mike Danese 54fd2aaefd replace request.Context with context.Context 2018-04-24 08:59:00 -07:00
Kubernetes Submit Queue 4692a6bf2e
Merge pull request #62784 from hanxiaoshuai/bugfix0418
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

we should use Infof when we are using format string

**What this PR does / why we need it**:
we should use Infof when we are using format string.
**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-04-23 17:45:20 -07:00
Kubernetes Submit Queue 9031f9a8ca
Merge pull request #62642 from ceshihao/kubectl_get_pod_status
Automatic merge from submit-queue (batch tested with PRs 62642, 62855, 62487, 62858, 62873). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Make pod status to Running if some are Running and some are Completed

**What this PR does / why we need it**:
Make pod status to Running if some are Running and some are Completed

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #62588

**Special notes for your reviewer**:
Only Set Pod status to Completed when no other reason, no Running container and only Completed containers.

Set status to Running if some are Running and some are Completed

**Release note**:

```release-note
Set pod status to "Running" if there is at least one container still reporting as "Running" status and others are "Completed".
```
2018-04-19 15:54:16 -07:00
David Eads 66a95a8f3e make describers more generic from the CLI 2018-04-19 16:22:42 -04:00
ceshihao 6b94e872c6 Make pod status to "Running" if there is at least one container still reporting as "Running" status 2018-04-19 14:24:18 +08:00
Kubernetes Submit Queue 44ede98e94
Merge pull request #61689 from Lion-Wei/kubectl-np
Automatic merge from submit-queue (batch tested with PRs 62510, 61689). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Extend kubectl describe for networkPolicy

**What this PR does / why we need it**:
Recently `networkpolicy` was allowed podSelector and namespaceSelector to be specified together in a NetworkPolicyPeer, so we need to extend `kubectl describe` for networkpolicy.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes kubernetes/kubectl#376

**Special notes for your reviewer**:
Here is the example output of `kubectl describe networkpolicies`:
NetworkPolicy file:
```yaml
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: test-network-policy
  namespace: default
spec:
  podSelector:
    matchLabels:
      role: db
  ingress:
  - from:
    - namespaceSelector:
        matchLabels:
          project: myproject
      podSelector:
        matchLabels:
          role: frontend
    ports:
    - protocol: TCP
      port: 6379
  egress:
  - to:
    - namespaceSelector:
        matchLabels:
          project: myproject
      podSelector:
        matchLabels:
          role: frontend
    ports:
    - protocol: TCP
      port: 6379
```
describe:
```shell
# ./kubectl describe netpol test-network-policy
Name:         test-network-policy
Namespace:    default
Created on:   2018-03-26 15:20:11 +0800 CST
Labels:       <none>
Annotations:  <none>
Spec:
  PodSelector:     role=db
  Allowing ingress traffic:
    To Port: 6379/TCP
    From NamespaceSelector: project=myproject
         PodSelector: role=frontend
  Allowing egress traffic:
    To Port: 6379/TCP
    To NamespaceSelector: project=myproject
       PodSelector: role=frontend
  Policy Types: Ingress, Egress

```

**Release note**:
```release-note
NONE
```
2018-04-18 19:36:11 -07:00
Mike Danese f427531179 boring 2018-04-18 09:55:57 -07:00
Kubernetes Submit Queue 87caa938b7
Merge pull request #62744 from liggitt/describe-cronjob
Automatic merge from submit-queue (batch tested with PRs 60201, 62744). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix kubectl describe cronjob

CronJob describer was attempting to use the internal batch clientset, which speaks to the batch/v1 API group. CronJobs do not exist in that API group.
2018-04-18 07:58:19 -07:00
hangaoshuai 50af9dea0c we should use Infof when we are using format string 2018-04-18 20:12:42 +08:00
Jordan Liggitt d07c417b18
Fix kubectl describe cronjob 2018-04-17 14:47:55 -04:00
juanvallejo 8a7b2fdda3
begin wiring printopts through complete commands 2018-04-13 11:50:54 -04:00
Slava Semushin 8a7d5707d5 PSP: move internal types from extensions to policy. 2018-04-11 18:35:09 +02:00
Wang Guoliang 89669283fe should use time.Since instead of time.Now().Sub 2018-04-10 12:05:51 +08:00
Lion-Wei 69ea7722c8 update network policy describe 2018-04-09 19:12:14 +08:00
juanvallejo 2a202cf49a
update PrintFlags#Complete to receive string template 2018-04-06 16:44:40 -04:00
Kubernetes Submit Queue 57d723ddc2
Merge pull request #62139 from juanvallejo/jvallejo/begin-wiring-print-flags
Automatic merge from submit-queue (batch tested with PRs 62063, 62169, 62155, 62139, 61445). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

begin wiring printflags through set cmds

**Release note**:
```release-note
NONE
```

Begin wiring PrintFlags struct through commands

cc @deads2k @soltysh
2018-04-05 17:42:10 -07:00
juanvallejo 4b4b6c879a
begin wiring printflags through set cmds 2018-04-05 16:34:51 -04:00
Kubernetes Submit Queue 9f4b851e91
Merge pull request #56629 from luksa/fix_custom_column_alignment
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix bad column alignment when using custom columns from OpenAPI schema

Columns printed by `kubectl get` weren't aligned properly when they were coming from the OpenAPI schema. 

This was caused by `CustomColumnPrinter.PrintObj`, which was creating a new `tabwriter.Writer` instead of re-using the tabwriter received through the `out` method parameter (basically, a tabwriter was writing to another tabwriter). Because the PrintObj flushed the tabwriter after writing each individual line, the column widths would reset.

**What this PR does / why we need it**:
This PR fixes the bad column alignment.

**Which issue(s) this PR fixes** 
Fixes #56282 

**Special notes for your reviewer**:
I've aligned how `CustomColumnPrinter.PrintObj` handles tabwriter with how `HumanReadablePrinter.PrintObj` does it (see https://github.com/kubernetes/kubernetes/blob/master/pkg/printers/humanreadable.go#L299-L303)

**Release note**:
```release-note
Fixed column alignment when kubectl get is used with custom columns from OpenAPI schema
```
2018-04-05 09:56:41 -07:00
juanvallejo a3a430ce01
wire through humanreadable flags 2018-04-03 13:59:35 -04:00
Jordan Liggitt 3b8a570437
Restore show-kind function when printing multiple kinds 2018-04-01 00:24:25 -04:00
Kubernetes Submit Queue ea2bd22367
Merge pull request #61304 from juanvallejo/add-template-printer-flags
Automatic merge from submit-queue (batch tested with PRs 57658, 61304, 61560, 61859, 61870). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

wire through template PrintFlags

**Release note**:
```release-note
NONE
```

Begin implementing pieces needed to retrieve `go-template`, `jsonpath` printers from a set of flags.
Proposal: https://docs.google.com/document/d/19ZZFVe9oD1KQmk5uExggRWtRl_hKGfYnBXvHZJlgEro/edit#heading=h.pnvbfi14v4zz

cc @soltysh @deads2k @pwittrock
2018-03-29 15:03:06 -07:00
Kubernetes Submit Queue 831198edbc
Merge pull request #61808 from liggitt/dry-run-printing
Automatic merge from submit-queue (batch tested with PRs 61790, 61808, 60339, 61615, 61757). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Ensure -o yaml populates kind/apiVersion

Fixes #61780 

```release-note
kubectl: fixes issue with `-o yaml` and `-o json` omitting kind and apiVersion when used with `--dry-run`
```
2018-03-28 09:39:12 -07:00
Jordan Liggitt a174d7a2de
Ensure -o yaml populates kind/apiVersion 2018-03-27 23:27:40 -04:00
xiangpengzhao bd02b49c20 Display extended resources in node allocated resources 2018-03-28 10:19:15 +08:00
juanvallejo ec672ca279
wire through template PrintFlags 2018-03-27 18:11:01 -04:00
Kubernetes Submit Queue 99fb4166d9
Merge pull request #59609 from zhangxiaoyu-zidif/add-rs-in-hpa-describe
Automatic merge from submit-queue (batch tested with PRs 61434, 61501, 59609, 61467, 61531). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add others's status in hpa describe

**What this PR does / why we need it**:
Add other status in HPA describe

- rs
- deployment

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
Add all kinds of resource objects' statuses in HPA description.
```
2018-03-26 19:52:10 -07:00
Kubernetes Submit Queue dcdf70a134
Merge pull request #61501 from juanvallejo/jvallejo/add-custom-columns-flags
Automatic merge from submit-queue (batch tested with PRs 61434, 61501, 59609, 61467, 61531). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

wire through custom-column print flags

**Release note**:
```release-note
NONE
```
Begin implementing pieces needed to retrieve custom-column printers from a set of flags.
Proposal: https://docs.google.com/document/d/19ZZFVe9oD1KQmk5uExggRWtRl_hKGfYnBXvHZJlgEro/edit#heading=h.pnvbfi14v4zz

cc @soltysh @deads2k @pwittrock
2018-03-26 19:52:07 -07:00
juanvallejo e4cdb9fc52
wire through custom-column print flags 2018-03-26 10:11:09 -04:00
juanvallejo aa38cea4d1
wire through name/success print flags 2018-03-26 10:00:45 -04:00
Kubernetes Submit Queue f8134deb63
Merge pull request #61440 from juanvallejo/jvallejo/add-json-yaml-printer-flags
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

wire through json/yaml print flags

**Release note**:
```release-note
NONE
```

Begin implementing pieces needed to retrieve json, yaml printers from a set of flags.
Proposal: https://docs.google.com/document/d/19ZZFVe9oD1KQmk5uExggRWtRl_hKGfYnBXvHZJlgEro/edit#heading=h.pnvbfi14v4zz

cc @deads2k @soltysh @pwittrock
2018-03-25 15:58:31 -07:00
Kubernetes Submit Queue 83a4f278ef
Merge pull request #61255 from dixudx/fix_describe_taint
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

fix sorting taints in case the sorting keys are equal

**What this PR does / why we need it**:
/kind bug
/sig cli

When describing node taints, the similar issue mentioned in #61250 also exists.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
xref #61250

**Special notes for your reviewer**:
/cc @kubernetes/sig-cli-bugs 
@kubernetes/sig-cli-api-reviews 

**Release note**:

```release-note
fix sorting taints in case the sorting keys are equal
```
2018-03-25 07:07:57 -07:00
Di Xu a6b567e8b2 include node internal ip as additional information for kubectl 2018-03-23 13:59:22 +08:00
juanvallejo 02be089bb3
wire through json/yaml print flags 2018-03-22 11:32:30 -04:00
Kubernetes Submit Queue 1365ce3419
Merge pull request #60755 from glb/support-b64dec-in-templates
Automatic merge from submit-queue (batch tested with PRs 61354, 61366, 61386, 61394, 60755). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

pkg/printers: Support base64 decode in kubectl get go-template

**What this PR does / why we need it**:

Adds a `base64decode` function to templates in `kubectl` so that it's possible to extract secret data in plaintext instead of base64 without requiring a separate executable to do the decode.

Sample usage:

```sh
kubectl get secret SECRET -o go-template='{{ .data.KEY | base64decode }}'
```

**Which issue(s) this PR fixes**:
Fixes kubernetes/kubernetes#45293.

**Special notes for your reviewer**:

**Release note**:
```release-note
You can now use the `base64decode` function in kubectl go templates to decode base64-encoded data, for example `kubectl get secret SECRET -o go-template='{{ .data.KEY | base64decode }}'`.
```
2018-03-21 23:44:19 -07:00
Kubernetes Submit Queue 787b8c0c6a
Merge pull request #61252 from dixudx/fix_describe_toleration
Automatic merge from submit-queue (batch tested with PRs 60793, 61181, 61267, 61252, 61334). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

fix sorting tolerations in case the keys are equal

**What this PR does / why we need it**:
/kind bug
/sig cli

find a better way to sort `api.Toleration`, in case the key are the same

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #61250

**Special notes for your reviewer**:
/cc @k82cn @kubernetes/sig-cli-api-reviews 
**Release note**:

```release-note
fix sorting tolerations in case the keys are equal
```
2018-03-21 20:23:17 -07:00
Kubernetes Submit Queue 114d481183
Merge pull request #60793 from charrywanganthony/inert_flag_showall
Automatic merge from submit-queue (batch tested with PRs 60793, 61181, 61267, 61252, 61334). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

--show-all is inert in v1.11

**What this PR does / why we need it**:

`--show-all` is inert in v1.11
ref: #60210

**Special notes for your reviewer**:
/assign @deads2k 

**Release note**:

```release-note
`--show-all` (which only affected pods and only for human readable/non-API printers) is inert in v1.11, and will be removed in a future release.
```
2018-03-21 20:23:07 -07:00
Kubernetes Submit Queue 707b7fd179
Merge pull request #59701 from mlmhl/kubectl_describe_pvc_condition
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add description of pvc condition for kubectl describe command

**What this PR does / why we need it**:

As the title says, add description of `PersistentVolumeClaim.Status.Conditions` for `kubectl describe pvc` command, the output will look like this:

```
Conditions:
  Type       Status  LastProbeTime                     LastTransitionTime                Reason  Message
  ----       ------  -----------------                 ------------------                ------  -------
  Resizing   True    Mon, 01 Jan 0001 00:00:00 +0000   Sat, 10 Feb 2018 19:20:56 +0800           
```

**Release note**:

```release-note
NONE
```

/sig storage
/kind enhancement
2018-03-21 11:38:29 -07:00
zhangxiaoyu-zidif 9bed6087ae switch to scale subresource when describe hpa replicas 2018-03-21 11:38:04 +08:00
Chao Wang 71a1970bf6 --show-all is inert in v1.11 2018-03-21 09:13:21 +08:00
Di Xu bd83ed58c7 fix sorting taints in case the sorting keys are equal 2018-03-20 11:01:55 +08:00
mlmhl c29728f220 add unit test for PVC conditions describer 2018-03-17 15:26:30 +08:00
Di Xu 3df1b30d27 fix sorting tolerations in case the keys are equal 2018-03-16 11:05:54 +08:00
Geoff Baskwill f8c56ba4d5 pkg/printers: Support base64 decode in kubectl go-template
Adds a `base64decode` function to templates in `kubectl` so that
it's possible to extract secret data in plaintext instead of
base64 without requiring a separate executable.

Sample usage:

```sh
kubectl get secret SECRET -o go-template='{{ .data.KEY | base64decode }}'
```
2018-03-13 19:33:47 -04:00
Slava Semushin 4621948ed8 kubectl get psp: modify header to show PRIV instead of DATA for column with privileged flag. 2018-03-13 16:08:33 +01:00
Maciej Szulik 5630d29552
Add missing table converters for server side printing 2018-02-28 17:27:45 +01:00
Kubernetes Submit Queue 5f3c3647b2
Merge pull request #60157 from msau42/topology-beta
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Update kubectl describe to print out PV node affinity

**What this PR does / why we need it**:
Print out PV NodeAffinity in kubectl describe.

Sample output:
```
Name:            example-local-pv
Labels:          foo1=bar1
                 foo2=bar2
Annotations:     <none>
Finalizers:      []
StorageClass:    local-storage
Status:          Available
Claim:
Reclaim Policy:  Delete
Access Modes:    RWO
Capacity:        5Gi
Node Affinity:
  Required Terms:
    Term 0:  kubernetes.io/hostname in [my-node]
             foo1 in [bar1, bar2]
    Term 1:  foo2 exists
Message:
Source:
    Type:  LocalVolume (a persistent volume backed by local storage on a node)
    Path:  /mnt/disks/ssd1
Events:    <none>
```

No NodeAffinity is set:
```
Name:            nfs
Labels:          <none>
Annotations:     <none>
Finalizers:      []
StorageClass:    
Status:          Available
Claim:           
Reclaim Policy:  Retain
Access Modes:    RWX
Capacity:        1Mi
Node Affinity:   <none>
Message:         
Source:
    Type:      NFS (an NFS mount that lasts the lifetime of a pod)
    Server:    10.244.1.4
    Path:      /exports
    ReadOnly:  false
Events:        <none>
```

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #60119

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-02-27 11:44:52 -08:00
Beata Skiba d003550bd2 Differentiate between target and target average value 2018-02-26 18:46:43 +01:00
Beata Skiba afe1724695 Add support for external metrics in kubectl 2018-02-26 13:54:35 +01:00
Kubernetes Submit Queue 0f9b5e9fc0
Merge pull request #60269 from smarterclayton/crd_printing
Automatic merge from submit-queue (batch tested with PRs 60324, 60269, 59771, 60314, 59941). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Implement a stub server printer for CRDs

This wires up TableConvertor to CRDs and puts a basic implementation in place for custom paths. However, since our OpenAPISchema can't store OpenAPI extension fields there is no way to expose the custom column piece that get.go supports today (`x-kubernetes-print-columns`). That piece can be implemented separately and needs discussion.

As this is purely exposing the default interface, very low risk. Will add an e2e test that covers this under a registered CRD.

@soltysh @sttts @kubernetes/sig-api-machinery-pr-reviews

A couple of options for wiring up the actual definition:

1. add a new "extensions" map to spec.validation
   1. Downside: won't handle future child nested fields, not the correct schema
2. try to change the OpenAPISchema3 field to support extensions
   1. Would require a breaking protobuf change, is also very difficult
   2. Could store the entire schema as opaque JSON and then parse on load (might be the right thing anyway)
3. Support this as an annotation in 1.11 - `alpha.customresource.k8s.io/x-kubernetes-print-columns` like the CLI

Part of #58536
2018-02-24 20:01:39 -08:00
Clayton Coleman fb6b1c0fba
CRD should have server side printing
Add the plumbing for server side printing. Not connected until we
support a way to get OpenAPI extensions from CRDs.
2018-02-24 13:44:05 -05:00
Kubernetes Submit Queue 54237e6cea
Merge pull request #60219 from smarterclayton/namespaces
Automatic merge from submit-queue (batch tested with PRs 60054, 60202, 60219, 58090, 60275). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Namespace should support table printing

@soltysh 

Part of #58536
2018-02-23 23:15:40 -08:00
Kubernetes Submit Queue 2f09876c44
Merge pull request #60265 from mlmhl/storageclass_describe
Automatic merge from submit-queue (batch tested with PRs 57672, 60299, 59757, 60283, 60265). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add description of MountOptions to StorageClass describe printer

**What this PR does / why we need it**:

Print `StorageClass.MountOptions` for `kubectl describe` command.

**Release note**:

```release-note
NONE
```
2018-02-23 21:21:50 -08:00
juanvallejo 9946374f82
handle Table response in client
This patch adds support for the "server-side GET operation"
introduced by pull/40848 and proposed by kubernetes/community#363.
2018-02-23 10:41:04 -05:00
mlmhl 37569ca97d add description of mount options to StorageClass describe printer 2018-02-23 10:43:40 +08:00
Kubernetes Submit Queue 948f28a74c
Merge pull request #60149 from aveshagarwal/master-kubectl-priority-issue
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix kubectl describe output for priority class objects.

**What this PR does / why we need it**:

Fixes `kubectl describe priorityclass`  (try https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/#example-priorityclass)  

```
Name:           high-priority
Value:          %!s(int32=1000000)
GlobalDefault:  %!s(bool=false)
Description:    This priority class should be used for XYZ service pods only.
Annotations:    <none>
Events:         <none>

```

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
None
```

@bsalamat @kubernetes/sig-scheduling-bugs  @kubernetes/sig-cli-bugs 
/king bug
/sig scheduling
/sig cli
2018-02-22 17:18:29 -08:00
Clayton Coleman 1970f89e43
Namespace should support table printing 2018-02-22 11:37:40 -05:00
Michelle Au 61417bd9ff Update kubectl describe to print out PV node affinity 2018-02-21 13:02:39 -08:00
Avesh Agarwal 87d6ee451e Fix kubectl describe for priority class objects. 2018-02-21 13:07:06 -05:00
David Eads be04e7c1b1 collapse printing paths 2018-02-21 08:15:22 -05:00
Kubernetes Submit Queue 370540f90d
Merge pull request #60057 from deads2k/cli-07-printer
Automatic merge from submit-queue (batch tested with PRs 59391, 58097, 60057, 60090). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

cleanup printers some more

This cleans up some more dead printer flags and unnecessary arguments for various methods.  We're getting closer.  Still need to clean up some ugly around `PrintSuccess` and then its time to start trimming layers.

@kubernetes/sig-cli-maintainers 

```release-note
NONE
```
2018-02-20 13:51:35 -08:00
Kubernetes Submit Queue 6235a60906
Merge pull request #60032 from humblec/allowvolumeexpansion
Automatic merge from submit-queue (batch tested with PRs 59634, 59821, 57850, 59916, 60032). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

AllowVolumeExpansion field to storageclass describe

Signed-off-by: Humble Chirammal <hchiramm@redhat.com>



**What this PR does / why we need it**:

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note

```
2018-02-20 12:39:43 -08:00
David Eads dd6405681f cleanup printers some more 2018-02-20 12:59:40 -05:00
Humble Chirammal 0512d036d5 AllowVolumExpansion field to describe printer.
Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
2018-02-19 16:27:57 +05:30
Jeff Grafton ef56a8d6bb Autogenerated: hack/update-bazel.sh 2018-02-16 13:43:01 -08:00
Kubernetes Submit Queue bb500a73b6
Merge pull request #59353 from juanvallejo/jvallejo/update-name-printer-output
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

update name printer output to kind.group/name

**Release note**:
```release-note
NONE
```

Followup to https://github.com/kubernetes/kubernetes/pull/59227

Updates output via `-o name` to be pipeable.

cc @deads2k
2018-02-15 10:37:19 -08:00
juanvallejo 765f9ec68b
update -o name format to kind.group/name 2018-02-15 10:33:06 -05:00
Di Xu 48388fec7e fix all the typos across the project 2018-02-11 11:04:14 +08:00
mlmhl 49dcdbe2c5 add description of pvc condition for kubectl describe command 2018-02-10 19:22:15 +08:00
Kubernetes Submit Queue b922ffc491
Merge pull request #54685 from zjj2wry/node_detail_unschedule
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

add unchedule information to kubectl describe node

**What this PR does / why we need it**:
Fixes #53721

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

**Special notes for your reviewer**:
cc @smarterclayton
now output: 
```
		Name:               bar
		Roles:              <none>
		Labels:             <none>
		Annotations:        <none>
		Taints:             <none>
		Unschedulable:      true
		CreationTimestamp:  Mon, 01 Jan 0001 00:00:00 +0000
```

**Release note**:

```release-note
NONE
```
2018-02-08 04:13:21 -08:00
Kubernetes Submit Queue 6827c3cf47
Merge pull request #59309 from zhangxiaoyu-zidif/fix-node-describe
Automatic merge from submit-queue (batch tested with PRs 59539, 59309). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

fix describe when allocatable CPU/Memory is 0

**What this PR does / why we need it**:

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-02-08 02:18:37 -08:00
zhangxiaoyu-zidif ba2404fde0 fix describe when allocatable CPU/Memory is 0 2018-02-08 16:33:09 +08:00
Kubernetes Submit Queue e87f1cbc88
Merge pull request #52942 from amitkumarj441/patch-3
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix typo

**What this PR does / why we need it**: To fix typo in annotations

**Release note**:

```release-note
NONE
```
2018-02-06 07:10:00 -08:00
zhengjiajin df4586b775 add unchedule information to kubectl describe node 2018-02-06 20:14:46 +08:00
Kubernetes Submit Queue 9ee71b720e
Merge pull request #59059 from smarterclayton/move_partial_object
Automatic merge from submit-queue (batch tested with PRs 59158, 38320, 59059, 55516, 59357). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Promote v1alpha1 meta to v1beta1

No code changes, just renames. We can discuss if there are any field / naming changes here or in a follow-up

Parent #58536
Fixes #53224
Prereq to #55637

@kubernetes/sig-api-machinery-pr-reviews @deads2k

```release-note
The `meta.k8s.io/v1alpha1` objects for retrieving tabular responses from the server (`Table`) or fetching just the `ObjectMeta` for an object (as `PartialObjectMetadata`) are now beta as part of `meta.k8s.io/v1beta1`.  Clients may request alternate representations of normal Kubernetes objects by passing an `Accept` header like `application/json;as=Table;g=meta.k8s.io;v=v1beta1` or `application/json;as=PartialObjectMetadata;g=meta.k8s.io;v1=v1beta1`.  Older servers will ignore this representation or return an error if it is not available.  Clients may request fallback to the normal object by adding a non-qualified mime-type to their `Accept` header like `application/json` - the server will then respond with either the alternate representation if it is supported or the fallback mime-type which is the normal object response.
```
2018-02-05 12:40:37 -08:00
Kubernetes Submit Queue f65f07225f
Merge pull request #59169 from NickrenREN/kubectl-pv-terminating
Automatic merge from submit-queue (batch tested with PRs 55439, 58564, 59028, 59169, 59259). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

kubectl: Add Terminating state to PVs

kubectl shows PV `Terminating` status, just like Pod and [PVC](https://github.com/kubernetes/kubernetes/pull/55873)

**What this PR does / why we need it**:
We will postpone PV deletion if it is bound to a PVC, see #58743, so we may keep PV waiting for deletion for a longer time than before so users should know what is going on.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
xref: https://github.com/kubernetes/community/pull/1608

**Special notes for your reviewer**:

**Release note**:
```release-note
NONE
```
/sig cli
/sig storage
/assign @jsafrane 

I tested this PR on my local host.
```
nickren@nickren-14:~/test/test$ kubectl delete -f pv.yaml 
persistentvolume "task-pv-volume" deleted
nickren@nickren-14:~/test/test$ kubectl get pv
NAME             CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS        CLAIM                   STORAGECLASS   REASON    AGE
task-pv-volume   1Gi        RWO            Delete           Terminating   default/task-pv-claim   standard                 27s
nickren@nickren-14:~/test/test$ kubectl describe pv task-pv-volume
Name:            task-pv-volume
Labels:          type=local
Annotations:     pv.kubernetes.io/bound-by-controller=yes
Finalizers:      [kubernetes.io/pv-protection]
StorageClass:    standard
Status:          Terminating (since Thu, 01 Feb 2018 13:18:51 +0800)
Claim:           default/task-pv-claim
Reclaim Policy:  Delete
Access Modes:    RWO
Capacity:        1Gi
Message:         
Source:
    Type:          HostPath (bare host directory volume)
    Path:          /tmp/data
    HostPathType:  
Events:            <none>
```
2018-02-02 17:17:42 -08:00
Clayton Coleman d07a608607 Promote v1alpha1 meta to v1beta1
No code changes, just renames
2018-02-02 14:00:45 -05:00
NickrenREN 7364c4c019 Add Terminating state to PVs 2018-02-02 23:33:45 +08:00
Bobby (Babak) Salamat 384a86caa9 Add NominatedNodeName to PodStatus 2018-01-30 13:13:57 -08:00
Kubernetes Submit Queue 5efb88ddf7
Merge pull request #58840 from alexcope/docbug
Automatic merge from submit-queue (batch tested with PRs 57500, 58840, 58883). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add allowPrivilegeEscalation to kubectl describe psp

**What this PR does / why we need it**:
Add allowPrivilegeEscalation to kubectl describe psp

**Which issue(s) this PR fixes**
Fixes #57974 

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-01-26 13:34:36 -08:00
Alex Cope 723c1ecb78 Add allowPrivilegeEscalation to kubectl describe psp
This fixes issue #57974
2018-01-25 16:41:46 -08:00
Manuel de Brito Fontes a39ae8ee08 Show all the annotations in ingress rules 2018-01-19 14:13:17 -03:00
Kubernetes Submit Queue 44d0ba29d3
Merge pull request #56960 from islinwb/remove_unused_code_ut_pkg
Automatic merge from submit-queue (batch tested with PRs 53631, 56960). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Remove unused code in UT files in pkg/

**What this PR does / why we need it**:
Remove unused code in UT files in pkg/ .

**Release note**:

```release-note
NONE
```
2018-01-18 02:41:29 -08:00
Kubernetes Submit Queue ff626a35fe
Merge pull request #57507 from dixudx/describe_pod_hostport
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

add hostPorts to pod describer

**What this PR does / why we need it**:
Missing `HostPorts` when describing pods

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:
/assign @mengqiy @shiywang
**Release note**:

```release-note
None
```
2018-01-16 10:26:19 -08:00
Kubernetes Submit Queue 1dbb4197c4
Merge pull request #56331 from shiywang/fix_indent
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Remove spaces from kubectl describe hpa

Fixes comment left here: https://github.com/kubernetes/kubernetes/pull/36033#discussion_r108020701

@kubernetes/sig-cli-pr-reviews  @DirectXMan12 

```release-note
remove spaces from kubectl describe hpa
```
2018-01-16 00:10:26 -08:00
linweibin fa8afc1d39 Remove unused code in UT files in pkg/ 2018-01-15 16:02:35 +08:00
Di Xu f91858d868 add hostPorts to pod describer 2018-01-11 23:12:45 +08:00
Kubernetes Submit Queue 35a0ff7d72
Merge pull request #56680 from weekface/weekface/tiny-fix
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Remove some useless code

**What this PR does / why we need it**:
code optimization,remove some useless code.

**Release note**:

```release-note
NONE
```
2018-01-03 09:22:22 -08:00
Kubernetes Submit Queue d3188b91bf
Merge pull request #56952 from Lion-Wei/kubectl-3
Automatic merge from submit-queue (batch tested with PRs 56952, 57697). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

remove /k8s.io/kubernetes/pkg/kubectl/testing

**What this PR does / why we need it**:

The package `/k8s.io/kubernetes/pkg/kubectl/testing` only have one type `TestStruct` and only used in `printers_test.go`, so removed it and created a similar type in `printers_test.go`.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes kubernetes/kubectl#164

**Special notes for your reviewer**:


**Release note**:
```release-note
NONE
```
2018-01-03 00:30:30 -08:00
Kubernetes Submit Queue b48e288ead
Merge pull request #57657 from kkmsft/kubectl-providerID
Automatic merge from submit-queue (batch tested with PRs 57699, 57657). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add 'ProviderID' to the output of kubectl describe node....

**What this PR does / why we need it**:
This PR adds displaying 'ProviderID' field in the kubectl  describe node.. command output.

**Release note**:

```release-note
NONE
```
2018-01-02 21:44:43 -08:00
Lion-Wei 071200128f remove /k8s.io/kubernetes/pkg/kubectl/testing 2018-01-03 09:39:33 +08:00
Kubernetes Submit Queue a0f8dd85b3
Merge pull request #57399 from php-coder/fix_flex_pvs_describe
Automatic merge from submit-queue (batch tested with PRs 57399, 57751, 57475). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

printFlexPersistentVolumeSource: fix format

**What this PR does / why we need it**:
This PR fixes invalid format.

**Special notes for your reviewer**:
Addresses https://github.com/kubernetes/kubernetes/pull/56460#discussion_r153583731
Fixes #57694

**Release note**:
```release-note
NONE
```

PTAL @liggitt 
CC @simo5
2018-01-02 10:57:51 -08:00
Krishnakumar R afb23afdb9 Add 'ProviderID' to the output of kubectl describe node.... 2017-12-27 11:24:06 +00:00
Jeff Grafton efee0704c6 Autogenerate BUILD files 2017-12-23 13:12:11 -08:00
Slava Semushin 1c41db6178 printFlexPersistentVolumeSource: fix format. 2017-12-19 13:16:12 +01:00
Kubernetes Submit Queue 403a3fa10a
Merge pull request #57202 from php-coder/fix_vsphere_volume_describer
Automatic merge from submit-queue (batch tested with PRs 55977, 56198, 57202, 57254, 57214). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix format string in describers

**What this PR does / why we need it**:
This PR fixes bug in the Vsphere Volume Source and other describers.

Before this fix `kubectl describe` could show something like this:
```
Source:
	Type:       vSphereVolume (a Persistent Disk resource in vSphere)
	VolumePath:     StoragePolicyName:  %v

	FSType:                             volumes/PVDISK_001
%!(EXTRA string=ext4, string=)Events:   <none>
```
It happened because format string was accidentally split to 2 strings and was interpreted in a wrong way.

**Release note**:
```release-note
NONE
```

CC @simo5
2017-12-17 08:26:50 -08:00
Slava Semushin 41bd2f5f85 Fix format string in describers. 2017-12-15 15:54:25 +01:00
Jordan Liggitt d073c10dbc
Refactor flex pv to allow secret namespace 2017-12-13 23:32:16 -05:00
weekface 7df64d59fb Remove useless error 2017-12-05 11:21:31 +08:00
Marko Luksa 947b3fa66d Fix bad column alignment when using custom columns from OpenAPI schema 2017-11-30 09:58:56 +01:00
Shiyang Wang f42f79edb0 fix spaces around the / 2017-11-27 18:28:18 +08:00
Haoran Wang 98faf6b39c support flexvlome in psp 2017-11-23 16:06:51 +08:00
Kubernetes Submit Queue 8f23d76de1
Merge pull request #55873 from jsafrane/show-pvc-terminating
Automatic merge from submit-queue (batch tested with PRs 55873, 56156). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

kubectl: Add Terminating state to PVCs

kubectl should show something when a PVC has a deletion timestamp and is waiting for deletion. This patch follows Pod - it adds Terminating state.

For easier discovery of errors, finalizers are printed in `kubectl describe pvc`.

This is part of [PVC finalizer feature for 1.9](https://github.com/kubernetes/community/blob/master/contributors/design-proposals/storage/postpone-pvc-deletion-if-used-in-a-pod.md) where we will keep PVC waiting for deletion for a longer time than before so users should know what is going on.

/sig cli

**Release note**:
```release-note
NONE
```
2017-11-22 06:43:23 -08:00
Kubernetes Submit Queue ce1c9c57c5
Merge pull request #54811 from juanvallejo/jvallejo/consolidate-outputOpts-printOpts
Automatic merge from submit-queue (batch tested with PRs 54811, 54292, 56103). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

consolidate printer OutputOpts w PrintOpts

This patch removes the use of printers.OutputOptions in favor of only
having a single struct for setting / passing printer options set by user
flags.

This PR is related to https://github.com/kubernetes/kubernetes/pull/50113 and aims to break the set of changes 
introduced in [this commit](f4d717450f) in order to make them easier to review.

**Release note**:
```release-note
NONE
```

cc @fabianofranz @mengqiy @shiywang @seans3
2017-11-21 00:02:36 -08:00
Mitsuhiro Tanino 334a0f0620 Block Volume: cmdline printer update 2017-11-20 20:42:21 -05:00
juanvallejo d3773b4b06
consolidate printer OutputOpts w PrintOpts
This patch removes the use of printers.OutputOptions in favor of only
having a single struct for setting / passing printer options set by user
flags.
2017-11-20 14:49:23 -05:00
Huamin Chen bb34a0b7ef use SecretObject to reference iSCSI CHAP secret
Signed-off-by: Huamin Chen <hchen@redhat.com>
2017-11-18 20:02:44 +00:00
Kubernetes Submit Queue 941c6aa1db
Merge pull request #55835 from smarterclayton/table_printer_meta
Automatic merge from submit-queue (batch tested with PRs 55642, 55897, 55835, 55496, 55313). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Table printers and server generation should always copy ListMeta

Tables should be a mapping from lists, so if the incoming object has these add them to the table. Paging over server side tables was broken without this. Add tests on the generic creater and on the resttest compatibility.


@deads2k
2017-11-18 10:46:35 -08:00
Vladimir Vivien af0c2bda94 CSI - API change for CSI volume source type
This commit tracks source code update to support the CSI volume source type additionn.
2017-11-17 19:17:42 -05:00
Clayton Coleman d2a62fd422 Table printers and server generation should always copy ListMeta
Tables should be a mapping from lists, so if the incoming object has
these add them to the table. Allows paging over server side tables.
Add tests on the generic creater and on the resttest compatibility.
2017-11-17 10:30:32 -05:00
pospispa 22370d925e kubectl: Add Terminating state to PVCs
kubectl should show something when a PVC has a deletion timestamp and is
waiting for deletion. This patch follows Pod - it adds Terminating state.

For easier discovery of errors, finalizers are printed in `kubectl describe
pvc`.
2017-11-16 12:39:15 +01:00
Michelle Au b60bd37114 StorageClass API changes for VolumeBindingMode 2017-11-15 09:19:47 -08:00
Dr. Stefan Schimanski bec617f3cc Update generated files 2017-11-09 12:14:08 +01:00
Dr. Stefan Schimanski 012b085ac8 pkg/apis/core: mechanical import fixes in dependencies 2017-11-09 12:14:08 +01:00
Kubernetes Submit Queue 134e89e663
Merge pull request #54548 from wackxu/desser
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

update the wrong format of string TargetPort

**What this PR does / why we need it**:

update the wrong format of string TargetPort

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #54546 

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-11-06 16:57:10 -08:00
Kubernetes Submit Queue 9459f4753a
Merge pull request #54853 from xiangpengzhao/des-netpol
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Describe NetworkPolicyEgressRule and IPBlock

**What this PR does / why we need it**:
- Describe IPBlock for NetworkPolicyIngressRule.
- Describe NetworkPolicyEgressRule
- Add test case for NetworkPolicyEgressRule
- Describe PolicyTypes

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:
/cc @thockin @caseydavenport @cmluciano 

**Release note**:

```release-note
NONE
```
2017-11-06 13:21:19 -08:00
xiangpengzhao c691be3acf Switch field types to PodSelector and NamespaceSelector 2017-11-06 15:22:50 +08:00
Nikhita Raghunath 3b0b95ecbf Remove TPR remnants
There are still TPR types and generated client
in the extensions group. It is better to clean
that up, now that it has been removed from master.
2017-11-03 21:15:58 +05:30
xiangpengzhao bcdff4f174 Fix wrong format and output. 2017-11-03 11:54:43 +08:00
Kubernetes Submit Queue e2c3137900
Merge pull request #46341 from zhangxiaoyu-zidif/add-unittest-for-secret
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add unittest for describe secret

**What this PR does / why we need it**:
add unittest for describe secret


**Release note**:

```release-note
NONE
```
2017-11-01 04:33:15 -07:00
xiangpengzhao 3921ac9dd1 Describe PolicyTypes for Network Policy. 2017-11-01 16:11:27 +08:00
Kubernetes Submit Queue ed00d9c062
Merge pull request #54445 from crimsonfaith91/rem
Automatic merge from submit-queue (batch tested with PRs 53190, 54790, 54445, 52607, 54801). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

remove created-by annotation

**What this PR does / why we need it**:
This PR removes `CreatedByAnnotation`.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #50720

**Release note**:

```release-note
The `kubernetes.io/created-by` annotation is no longer added to controller-created objects. Use the  `metadata.ownerReferences` item that has `controller` set to `true` to determine which controller, if any, owns an object.
```
2017-10-31 20:10:21 -07:00
Kubernetes Submit Queue a80985a283
Merge pull request #54617 from YuxiJin-tobeyjin/printpodwide
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add unit test for get pod -o wide

**What this PR does / why we need it**:
Add unit test for get pod -o wide;
In func printPod, one can choose to use "options.Wide", so unit test is needed accordingly.

**Release note**:

```release-note
```
NONE
2017-10-31 11:32:12 -07:00
xiangpengzhao 1aaac98e7a Add test case for NetworkPolicyEgressRule. 2017-10-31 19:47:01 +08:00
xiangpengzhao 0cf5a2dedc Describe NetworkPolicyEgressRule. 2017-10-31 19:46:48 +08:00
xiangpengzhao d735f660bc Describe IPBlock for NetworkPolicyIngressRule. 2017-10-31 18:03:14 +08:00
Kubernetes Submit Queue bd28e6d0ea
Merge pull request #46951 from aanm/kubectl-describe-netpol
Automatic merge from submit-queue (batch tested with PRs 54761, 54748, 53991, 54485, 46951). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Enhanced the network policy describer.

**Which issue this PR fixes**: Fixes https://github.com/kubernetes/kubectl/issues/17

**Special notes for your reviewer**: I need help to set up the right clientset for the unt tests

@kubernetes/sig-network-pr-reviews 

ping @adohe 

As suggested in https://github.com/kubernetes/kubectl/issues/17 , the output is similar to:
```
Name:           access-backend
Namespace:      default
Created on:     2017-06-04 21:45:56 -0700 PDT
Labels:         <none>
Annotations:    <none>
Spec:
  Pod Selector:     foo in (bar1,bar2),foo2 notin (bar1,bar2),id=app1,id2=app3
  Allowing ingress traffic:
    To Port: 80/TCP
    To Port: 82/TCP
    From Pod Selector: id=app2,id2=app3
    From Namespace Selector: id=app2,id2=app3
    From Namespace Selector: foo in (bar1,bar2),id=app2,id2=app3
    ----------
    To Port: <any> (traffic allowed to all ports)
    From: <any> (traffic not restricted by source)
```
2017-10-30 15:38:36 -07:00
Kubernetes Submit Queue 25a98328b6
Merge pull request #54625 from wackxu/pppri
Automatic merge from submit-queue (batch tested with PRs 53796, 54666, 54516, 54625, 54704). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

print priority when describe pod

**What this PR does / why we need it**:

show the priority of pod when describe pod when we use pod priority

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #54624 

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-10-30 13:48:38 -07:00
Jun Xiang Tee efbfead4ef remove created-by annotation 2017-10-30 12:49:44 -07:00
wackxu 8808d505d6 print priority and priorityClassName when describe pod 2017-10-28 10:01:24 +08:00
YuxiJin-tobeyjin 131d612b13 Add unit test for get pod -o wide 2017-10-27 10:39:09 +08:00
Maru Newby adc338d330 Remove all traces of federation 2017-10-26 13:37:37 -07:00
Kubernetes Submit Queue 7d5dc528a0 Merge pull request #54013 from vladimirvivien/scaleio-secret-multi-tenancy
Automatic merge from submit-queue (batch tested with PRs 49865, 53731, 54013, 54513, 51502). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

ScaleIO - Ability to specify Secret's name and namespace 

**What this PR does / why we need it**:
This PR is to decouple the ScaleIO secret from the same namespace as that of the StorageClass/PVC/PV that uses it (#53619). Currently, authorized non-admin k8s user, who creates volumes, may end up having unauthorized access to ScaleIO secret information.  This PR introduces secret parameter that allows specification of secret's namespace.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #53619 

**Release note**:
```release-note
ScaleIO persistent volumes now support referencing a secret in a namespace other than the bound persistent volume claim's namespace; this is controlled during provisioning with the `secretNamespace` storage class parameter; StoragePool and ProtectionDomain attributes no longer defaults to the value `default`
```
2017-10-26 13:24:34 -07:00
David Eads 322c6b5848 make printing deterministic 2017-10-26 07:56:09 -04:00
Kubernetes Submit Queue b9838a191d Merge pull request #51267 from zjj2wry/print-bug
Automatic merge from submit-queue (batch tested with PRs 53760, 48996, 51267, 54414). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

fix issue(#51245)1、kubectl printObj should not print header when occur…

… error. 2、kubectl get ns --all-namespaces should not have NAMESPACE column



**What this PR does / why we need it**:
closes #51245

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

**Special notes for your reviewer**:
now we will just get this.
```
admindeMacBook-Pro-2:kubectl admin$ ./kubectl get ns --all-namespaces
error: namespace is not namespaced
```

**Release note**:

```release-note
NONE
```
2017-10-25 17:37:07 -07:00