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
```
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
```
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
```
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)*:
Fixeskubernetes/kubectl#164
**Special notes for your reviewer**:
**Release note**:
```release-note
NONE
```
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
```
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
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
```
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
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
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.
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`.
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
```
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
```
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
```
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.
```
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
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)
```
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
```