Commit Graph

862 Commits (284e8182a402cfd545fc000fedaea071fed873b0)

Author SHA1 Message Date
Kubernetes Submit Queue 890bd2174c
Merge pull request #60210 from deads2k/cli-12-showall
Automatic merge from submit-queue (batch tested with PRs 55637, 57461, 60268, 60290, 60210). 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>.

deprecate --show-all

`--show-all` is a pod-only filter that only affects human-readable printing of pods and only from `kubectl get`.  It hides pods which are in a terminal state.  Even at the beginning this was questionable, since you often (usually?) want to see the pods that have failed: all happy pods are alike, but every unhappy pod is unhappy in its own way.  In addition, it only worked on human-readable printers.  Doing a `-o name` or `-o yaml` showed a different set of results!

Per the mailing list discussion here: https://groups.google.com/forum/#!topic/kubernetes-sig-cli/0SxgDxObxD0

```release-note
`--show-all` (which only affected pods and only for human readable/non-API printers) is now defaulted to true and deprecated.  It will be inert in 1.11 and removed in a future release.
```

/assign @adohe 
/assign @pwittrock 
/assign @soltysh 

@kubernetes/sig-cli-maintainers
2018-02-23 09:49:48 -08:00
Kubernetes Submit Queue 4f083dee54
Merge pull request #60208 from soltysh/remove_factory_metricsclient_method
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 factory metricsclient method

**What this PR does / why we need it**:
Alternative approach to https://github.com/kubernetes/kubernetes/pull/60142 which fixed the `NewCmdTopPod` return arguments

/assign @deads2k 

**Release note**:
```release-note
None
```
2018-02-22 22:45:58 -08:00
Maciej Szulik 999273fbd7
Remove ClientSetForVersion & ClientConfigForVersion from factory 2018-02-22 15:50:27 +01:00
David Eads c9cb705816 deprecate --show-all 2018-02-22 08:19:12 -05:00
David Eads f084311326 remove metrics client factory method 2018-02-22 07:45:04 -05:00
Kubernetes Submit Queue 7d64d30177
Merge pull request #60094 from juanvallejo/jvallejo/remove-printobjectspecificmessage
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 f.PrintObjectSpecificMessage

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

Mailing list discussion: https://groups.google.com/forum/#!topic/kubernetes-sig-cli/gZWg8Ulo3Ao

Removes the `PrintObjectSpecificMessage` helper in an effort to reduce printing stack complexity, and avoid special-casing resources.
2018-02-22 00:35:21 -08:00
juanvallejo e3d81517ae remove f.PrintObjectSpecificMessage 2018-02-21 21:06:49 -05:00
David Eads d8a5420b7c remove unneeded factory codec methods 2018-02-21 15:20:20 -05:00
David Eads be04e7c1b1 collapse printing paths 2018-02-21 08:15:22 -05:00
Maciej Szulik 5d721bff81
Remove pkg/client/unversioned 2018-02-21 13:08:11 +01: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
David Eads dd6405681f cleanup printers some more 2018-02-20 12:59:40 -05:00
Jeff Grafton ef56a8d6bb Autogenerated: hack/update-bazel.sh 2018-02-16 13:43:01 -08:00
Kubernetes Submit Queue 01ec7a9eb8
Merge pull request #59809 from phsiao/59733_port_forward_with_target_port
Automatic merge from submit-queue (batch tested with PRs 59809, 59955). 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 port-forward should resolve service port to target port

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

Continues on the work in #59705, this PR adds additional support for looking up targetPort for a service, as well as enable using svc/name to select a pod.

**Which issue(s) this PR fixes**:
Fixes #15180
Fixes #59733

**Special notes for your reviewer**:

I decided to create pkg/kubectl/util/service_port.go to contain two functions that might be re-usable.

**Release note**:
```release-note
`kubectl port-forward` now supports specifying a service to port forward to: `kubectl port-forward svc/myservice 8443:443`
```
2018-02-15 22:42:30 -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
Shawn Hsiao 4a0bbf2363 kubectl port-forward support resolving service port to target port, and support Service as resource type 2018-02-14 12:02:57 -05:00
Di Xu 48388fec7e fix all the typos across the project 2018-02-11 11:04:14 +08:00
Kubernetes Submit Queue 15dbd4e2ae
Merge pull request #59227 from juanvallejo/jvallejo/remove-mapper-dep-printer
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 mapper dependency for cmdutil.Factory#PrintSuccess

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

Part of a series of patches removing printing stack dependency on mappings the rest mapper

**Before**
```
$ kubectl label pod/my-pod label=label
pod "my-pod" labeled
```

**After**
```
$ kubectl label pod/my-pod label=label
pods "my-pod" labeled
```

cc @deads2k
2018-02-07 08:39:15 -08:00
juanvallejo beb5ea641a
remove mapper dependency - PrintSuccess 2018-02-07 10:10:45 -05:00
Juan Vallejo 4026356b1c
Revert "fail earlier on discovery failures" 2018-02-01 13:02:10 -05:00
Kubernetes Submit Queue 235714e7f3
Merge pull request #58298 from p0lyn0mial/generic_scaler_scalerfor_continued
Automatic merge from submit-queue (batch tested with PRs 58955, 58968, 58971, 58963, 58298). 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>.

removes the remainder from ScalerFor method

**What this PR does / why we need it**:
this PR removes existing scalers from `ScalerFor` method

**Release note**:

```release-note
NONE
```
2018-01-29 13:48:51 -08:00
p0lyn0mial 71eb1ff3b1 removes the remainder from ScalerFor method
all remaining scalers were replaced by GenericScaler exept JobScaler.
It is not clear whether JobScaler could use generic scaler or not.
For more details see the pull request.
2018-01-29 20:02:27 +01:00
Kubernetes Submit Queue f2ac9671f0
Merge pull request #57229 from niuzhenguo/cleanup_validargs
Automatic merge from submit-queue (batch tested with PRs 57229, 58907). 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>.

Abstract cmd valid args get behind the factory

**What this PR does / why we need it**:
This abstract retrieving the list of handled resources for valid args as a function to follow more conventions.

**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-01-27 00:31:30 -08:00
Jordan Liggitt e1e1be74da
Prefer exact resource name matches to shortname expansions 2018-01-26 01:45:38 -05:00
Di Xu 97ec47ba55 use containing API group when resolving shortname from discovery 2018-01-25 09:38:34 +08:00
Frederic Branczyk b1448adb59
kubectl: Use metrics-server for kubectl top commands 2018-01-22 21:45:06 +01:00
juanvallejo 13add66f1e
tolerate more than one gvklist item
Some third-party resources could be part of more than one api group.
Allow this to be the case when adding openapi models to openapi data.
2018-01-19 14:24:03 -05:00
David Eads 49f12fa70f fail earlier on discovery failures 2018-01-16 16:02:13 -05:00
Kubernetes Submit Queue f008f147f8
Merge pull request #52321 from Mashimiao/factory-tfix
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>.

small tfix in cmd factory comment

Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>

**What this PR does / why we need it**:
tfix in cmd factory comment

**Release note**:
```release-note
NONE
```
2018-01-15 11:34:48 -08:00
p0lyn0mial dd9de90b0a the changes introduced in this commit plumbs in the generic scaler into kubectl.
note that we don't change the behaviour of kubectl.
For example it won't scale new resources. That's the end goal.
The first step is to retrofit existing code to use the generic scaler.
2018-01-12 09:21:18 +01:00
Zhenguo Niu c3d77eea54 Abstract cmd valid args get behind the factory 2018-01-09 09:58:07 +08:00
Eric Chiang ea085e0a32 client-go: remove import of github.com/gregjones/httpcache 2018-01-08 09:54:12 -08:00
Maciej Szulik 2f9532f047 Allow kubectl set image/env on a cronjob 2018-01-04 10:27:37 +01:00
Jeff Grafton efee0704c6 Autogenerate BUILD files 2017-12-23 13:12:11 -08:00
Kubernetes Submit Queue 6236cddab7
Merge pull request #54881 from juanvallejo/jvallejo/use-printer-for-cmd-through-factory
Automatic merge from submit-queue (batch tested with PRs 56676, 57050, 54881, 56822, 57113). 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 PrinterForCommand is consumed through cmdutil.Factory

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

This patch is one in a series of patches that aims to move all
printing functions to the `cmdutil.Factory` in order to make
the factory the one-stop shop for accessing printers in the client.

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

@fabianofranz @mengqiy @shiywang
2017-12-16 19:19:44 -08:00
Kubernetes Submit Queue 8e161212f6
Merge pull request #55913 from wackxu/refauto
Automatic merge from submit-queue (batch tested with PRs 55900, 55995, 55913, 55467, 55376). 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>.

Use structured generator for kubectl autoscale

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

Use structured generator for kubectl autoscale

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
part of  # https://github.com/kubernetes/kubectl/issues/138

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

**Release note**:

```release-note
Use structured generator for kubectl autoscale 
```
2017-12-14 00:45:18 -08:00
juanvallejo 8c9c2ee2d8
update type-check to use printers.PritnHandler 2017-12-05 13:39:55 -05:00
juanvallejo c53120e6b9
ensure PrinterForCommand is consumed through cmdutil.Factory 2017-12-05 13:39:29 -05:00
supereagle 032416c75d use core client with explicit version
fix more usage of deprecated core client
2017-11-25 08:14:10 +08:00
Kubernetes Submit Queue 9a0bbd0aa9
Merge pull request #53765 from tanshanshan/fix-bug1
Automatic merge from submit-queue (batch tested with PRs 54529, 53765). 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  #53735, check whether  interface conversion is ok

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

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

fix #53735

avoid interface conversion error 

**Special notes for your reviewer**:

**Release note**:

```release-note
```
2017-11-21 21:38:59 -08:00
juanvallejo f5ab356043
pass printOpts by pointer 2017-11-20 14:49:23 -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
wackxu 87054639a2 refactor kubectl autoscale to use the new generator 2017-11-20 14:12:20 +08:00
Clayton Coleman 8f4b6c8771
All commands must declare Unstructured or Internal
Callers must take a dependency on one or the other set of conversions
and default client behavior. Future changes may add a Versioned() type,
but this is an accurate reflection of current code state.
2017-11-19 20:41:02 -05:00
Clayton Coleman 04ab96d2bd
Unify Object and UnstructuredObject
The unified RESTMapper and Typer follow the new rules, but on error will
fallback to the legacy path (while still supporting Unstructured
objects). This allows callers to handle the appropriate distinction
themselves if necessary.

Add a LocalParam() method to the resource.Builder that DRYs up a large
chunk of complicated code in set commands.
2017-11-19 19:16:50 -05:00
Clayton Coleman 7563a0c4d8
Remove unstructured error checking from affected code
Also remove error messages that depended on ObjectKinds() - future
changes will potentially remove this interface and the replacements here
are equivalent.
2017-11-19 19:16:50 -05:00
Clayton Coleman e298aa39c3
Add a lazy discovery interface for Unstructured
Delays the error until the first call and then preserves it for others.
More closely matches the intent of the Object() calls. Loaders are now
lazy and don't need to return errors directly.

Sets the stage for collapsing unstructured and structured builders
together.
2017-11-19 19:16:50 -05:00
Clayton Coleman 5038eb2a3f
Remove use of VersionedObject and simplify builder in generic methods
Reduce all uses of Unstructured to the simpler form, and avoid asking
for mapper or typer unless it is required. Use Typed() for places that
previously used VersionedObject, and remove paths for versioned objects
from code that is now using unstructured.
2017-11-19 19:16:49 -05:00
Clayton Coleman 0229fd4bd1
Unify unstructured and versioned object in resource.Builder
resource.Builder should be aware of both paths, and the caller is
responsible for determining the different path via use.
2017-11-19 19:02:25 -05:00
Clayton Coleman 98e0c69907 Revert "refactor builder in kubectl factory"
This reverts commit 06c5be9802.
2017-11-19 19:02:21 -05:00
Kubernetes Submit Queue fa3047880d
Merge pull request #54867 from juanvallejo/jvallejo/move-print-success-cmdutil-factory
Automatic merge from submit-queue (batch tested with PRs 55233, 55927, 55903, 54867, 55940). 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>.

move cmd/util/printing.go#PrintSuccess to factory_builder.go

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

This patch is one in a series of patches that aims to move all
printing functions to the `cmdutil.Factory` in order to make
the factory the one-stop shop for accessing printers in the client.

This PR is related to https://github.com/kubernetes/kubernetes/pull/50113 and aims to break that set of changes
by introducing a portion of them in this commit in order to make 
them easier to review.

@fabianofranz @mengqiy @shiywang @seans3
2017-11-18 12:26:15 -08:00
Kubernetes Submit Queue 153b5f50f2
Merge pull request #53483 from apelisse/openapi-columns
Automatic merge from submit-queue (batch tested with PRs 50457, 55558, 53483, 55731, 52842). 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 openapi custom columns in `kubectl get`

Change the name of the flag to something slightly more user-friendly,
while making it default true. The flag is kept so that someone can
revert it temporarly if things go wrong.

**What this PR does / why we need it**: OpenAPI can specify for some columns to be used in `kubectl get`. That's very useful for non-core/hard-coded type in order to print more valuable data in get.

**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**:

Closes kubernetes/kubectl#143

**Release note**:
```release-note
`kubectl get` will now use OpenAPI schema extensions by default to select columns for custom types.
```
2017-11-18 11:36:19 -08:00
Antoine Pelisse 9778b1a9ba openapi: Add EmptyResource/CreateOpenAPISchemaFunc test utils
Add a new EmptyResource class that implements openapi.Resources, but
just doesn't have any resources. That is useful for tests that expect
the OpenAPISchema to be working, but don't expect any actual result.

Also implement CreateOpenAPISchemaFunc to simply plug in the TestFactory
code when you want to use an actual APISchema.
2017-11-15 14:02:13 -08:00
juanvallejo 701d6536a2
move cmd/util/printing.go#PrintSuccess to factory_builder.go 2017-11-15 10:46:39 -05:00
Clayton Coleman b366afa00a
Move category expander out of kubectl/resource 2017-11-14 17:38:16 -05:00
Kubernetes Submit Queue e725361722
Merge pull request #54877 from juanvallejo/jvallejo/move-PrintResourceInfoRorCommand-cmdutil-factory
Automatic merge from submit-queue (batch tested with PRs 54602, 54877, 55243, 55509, 55128). 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>.

move cmd/util/printing.go#PrintResourceInfoForCommand -> factory…

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

This patch is one in a series of patches that aims to move all
printing functions to the `cmdutil.Factory` in order to make
the factory the one-stop shop for accessing printers in the client.

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

@fabianofranz @mengqiy @shiywang @seans3
2017-11-14 03:03:23 -08:00
Kubernetes Submit Queue 7650665059
Merge pull request #54554 from zjj2wry/set-dep
Automatic merge from submit-queue (batch tested with PRs 53337, 55465, 55512, 55522, 54554). 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>.

switch UpdatePodSpecForObject to work on v1.PodSpec, use info.VersionedObject, and avoid conversion completely

**What this PR does / why we need it**:
ref #54212
ref #https://github.com/kubernetes/kubectl/issues/83

**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 @liggitt @pwittrock 
**Release note**:

```release-note
NONE
```
2017-11-11 12:44:30 -08:00
Kubernetes Submit Queue 0ca74ef2e3
Merge pull request #54858 from wackxu/createpri
Automatic merge from submit-queue (batch tested with PRs 54460, 55258, 54858, 55506, 55510). 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 create subcommand for priorityclass

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

add `create priorityclass` sub command


**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 #54857

**Special notes for your reviewer**:

**Release note**:

```release-note
add create priorityclass sub command
```
2017-11-11 10:45:23 -08:00
zhengjiajin dc312142ab remove todo: switch UpdatePodSpecForObject to work on v1.PodSpec, use info.VersionedObject, and avoid conversion completely 2017-11-11 02:36:12 +08:00
Antoine Pelisse 5c3c0f6e5b Add apelisse to OWNERS
I wrote most of this code anyway.
2017-11-09 15:39:31 -08:00
juanvallejo 4418591226
move cmd/util/printing.go#PrintResourceInfoForCommand -> factory_builder.go 2017-11-09 15:13:18 -05:00
Kubernetes Submit Queue f4d470c75c
Merge pull request #55162 from deads2k/cli-06-tolerate-error
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>.

tolerate discovery errors in the restmapper

Found this while investigating a related problem.  The restmapper can use the information it has found.  It doesn't have to discard all of it.
2017-11-09 08:36:44 -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
Dr. Stefan Schimanski d13b936a2a pkg/apis/core: fixup conversion func names in dependencies 2017-11-09 12:14:07 +01:00
Kubernetes Submit Queue 2ee10cc73e
Merge pull request #55092 from mengqiy/refactor_factory
Automatic merge from submit-queue (batch tested with PRs 55092, 55348, 55095, 55277, 55352). 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>.

refactor build in kubectl factory

Refactor kubectl factory and resource builder.

This will be helpful for `kinflate`.

```release-note
NONE
```

/assign @monopole
2017-11-08 21:18:16 -08:00
yland 456df2c74e Replace some occurances of kubernetes internal api types in kubectl 2017-11-08 18:27:45 +01:00
ymqytw 06c5be9802 refactor builder in kubectl factory 2017-11-07 20:16:27 -08:00
wackxu 741c58be7f add create subcommand for priorityclass 2017-11-07 15:03:01 +08:00
David Eads 8203b0b135 tolerate discovery errors in the restmapper 2017-11-06 08:22:44 -05:00
Kubernetes Submit Queue 2ecb368026
Merge pull request #53679 from kow3ns/workloadsv1
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>.

Workloads V1

**What this PR does / why we need it**: This PR promotes the Deployment, ReplicaSet, and DaemonSet StatefulSet, ControllerRevision kinds to the apps/v1 group version.

https://github.com/kubernetes/features/issues/353

**Special notes for your reviewer**:
There will be at least two followups to this PR. The first to add a scale sub-resource when the correct location is resolved, and the second to deal with Conditions in the workloads API.

While it would have been preferable to move the kinds individually providing a lesser burden on reviewers, this proved impracticable due to the intricacies of version resolution in kubectl for objects of the different kinds in the same group.  

```release-note
DaemonSet, Deployment, ReplicaSet, and StatefulSet have been promoted to GA and are available in the apps/v1 group version.
```
2017-11-03 15:17:16 -07:00
Kenneth Owens 5590c1fb94 gets the correct version of kubernetes client for DaemonSet and StatefulSet History and Rollback and updates test-cmd for new versions 2017-11-03 10:16:50 -07:00
ymqytw 5557f2e444 discovery client not depend on pkg/api/legacyscheme 2017-11-02 14:59:21 -07:00
Antoine Pelisse 8f7262e819 Update kube-openapi to use validation 2017-11-02 09:25:03 -07:00
Kubernetes Submit Queue 037b8ab8b3
Merge pull request #54446 from smarterclayton/cleanup_get
Automatic merge from submit-queue (batch tested with PRs 54446, 54202). 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>.

Create a new package for generic commands like get

This is in preparation for cleaning up the structure of `kubectl get` to ease implementing serverside get and streaming API responses. Moves a hardcoded constant into a method in preparation for a future serverside implementation. Also improves some existing description text.
2017-10-31 15:51:23 -07:00
Kubernetes Submit Queue f46f0efd31
Merge pull request #54572 from ellenkorbes/ellenmakesamess
Automatic merge from submit-queue (batch tested with PRs 54572, 54686). 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 partial env docs & examples

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

It adds documentation and examples to kubectl env.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: This PR partially addresses [#98](https://github.com/kubernetes/kubectl/issues/98).

**Special notes for your reviewer**:

This is a partial PR. I'm mostly looking for feedback as to whether I'm on the right track with this issue. Any feedback is appreciated. Thanks.

(This is my contribution to Outreachy's Kubernetes internship application.)

**Release note**:


```release-note
NONE
```
2017-10-30 21:45:14 -07:00
Clayton Coleman 93fed120fb
Move printing the valid resource types to a function
Should be calculated from discovery in the future. Also improve
descriptions on the affected commands.
2017-10-30 23:45:45 -04:00
Ellen Körbes 413eaecf32 Added comments & examples/tests to kubectl env package 2017-10-29 20:23:20 -02:00
ymqytw 4487cc5e15 switch some commands to use its own scheme 2017-10-27 18:31:42 -07:00
Maru Newby adc338d330 Remove all traces of federation 2017-10-26 13:37:37 -07:00
Kubernetes Submit Queue 507790c9c6 Merge pull request #54181 from apelisse/update-kube-openapi
Automatic merge from submit-queue (batch tested with PRs 54199, 54181, 54196). 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 openapi to use kube-openapi code

**What this PR does / why we need it**: OpenAPI code has moved to `github.com/kubernetes/kube-openapi`. Let's use that code as a dependency, since now it's duplicated.

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

**Special notes for your reviewer**:

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

No user visible changes. Just code moving around.
2017-10-20 18:57:03 -07:00
Kubernetes Submit Queue d7eebdfdbe Merge pull request #54113 from spzala/groupkindvalidationtest
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>.

Create new unit tests for version and kind validation

This is a follow up PR per discussion in the
https://github.com/kubernetes/kubernetes/pull/53587
Creating new unit tests here for basic and aggregated validation of version
and kind group.



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

**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**:

**Release note**:

```release-note
NONE
```
2017-10-20 09:29:24 -07:00
Antoine Pelisse 3ed58475c4 Update openapi to use kube-openapi code 2017-10-20 09:21:06 -07:00
Kubernetes Submit Queue 2d914ee703 Merge pull request #53984 from sttts/sttts-legacyscheme
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>.

pkg/api: extract Scheme/Registry/Codecs into pkg/api/legacyscheme

This serves as

- a preparation for the pkg/api->pkg/apis/core move
- and makes the dependency to the scheme explicit when vizualizing
  left depenncies.

The later helps with our our efforts to split up the monolithic repo
into self-contained sub-repos, e.g. for kubectl, controller-manager
and kube-apiserver in the future.
2017-10-18 10:49:10 -07:00
Dr. Stefan Schimanski cad0364e73 Update bazel 2017-10-18 17:24:04 +02:00
Dr. Stefan Schimanski 7773a30f67 pkg/api/legacyscheme: fixup imports 2017-10-18 17:23:55 +02:00
Sahdev P. Zala 07be0a057a Create new unit tests for version and kind validation
This is a follow up PR per discussion in the
https://github.com/kubernetes/kubernetes/pull/53587
Creating new unit tests here for basic and aggregated validation of version
and kind group.
2017-10-17 23:10:20 -04:00
tanshanshan d2caaf1cbe fix bug 2017-10-18 10:06:06 +08:00
Kubernetes Submit Queue d97c759110 Merge pull request #53587 from spzala/master
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>.

Provide aggregated validation errors for version and kind

Currently the validation checks is done individually for version and
kind group. For example, if user provided yaml file is missing apiVersion
and kind fields, first they will receive error on apiVersion. Once user
update the file and try to recreate, an error on missing kind is displayed.
The behavior is same for wrong types of the fields.
These errors should be aggregated and displayed.

Examples of current validation:
1
test.yaml is missing apiVersion and kind:
$kubectl.sh create -f /home/sahdev/go/src/bugfixes/test.yaml
error: error validating "/home/sahdev/go/src/bugfixes/test.yaml": error validating data: apiVersion not set; if you choose to ignore these errors, turn validation off with --validate=false
2.
test.yaml is fixed for apiVersion but missing kind:
$kubectl.sh create -f /home/sahdev/go/src/bugfixes/test.yaml
error: error validating "/home/sahdev/go/src/bugfixes/test.yaml": error validating data: kind not set; if you choose to ignore these errors, turn validation off with --validate=false

Examples with aggregated validation: 
1.
error: error validating "/home/sahdev/go/src/bugfixes/test.yaml": error validating data: [apiVersion not set, kind not set]; if you choose to ignore these errors, turn validation off with --validate=false
2.
error: error validating "/home/sahdev/go/src/bugfixes/testmix.yaml": error validating data: [apiVersion isn't string type, kind not set]; if you choose to ignore these errors, turn validation off with --validate=false



**What this PR does / why we need it**:
To provide aggregated validations to user for version and kind group.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-10-17 16:35:39 -07:00
Sahdev P. Zala 0c0a4696c7 Provide aggregated validation errors for version and kind
Currently the validation checks is done individually for version and
kind group. For example, if user provided yaml file is missing apiVersion
and kind fields, first they will receive error on apiVersion. Once user
update the file and try to recreate, an error on missing kind is displayed.
The behavior is same for wrong types of the fields.
These errors should be aggregated and displayed.
2017-10-17 13:31:12 -04:00
Kubernetes Submit Queue 74cd0f0766 Merge pull request #53861 from pwittrock/resource-validation-deps
Automatic merge from submit-queue (batch tested with PRs 53106, 52193, 51250, 52449, 53861). 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>.

Move version-conversion code out of shared kubectl resource package

```release-note
NONE
```
2017-10-16 14:47:28 -07:00
Phillip Wittrock 7ab3f96100 Move kubectl type conversion libs out of the resource & util package and into the conversion command.
Kubectl shouldn't have code that does type conversion.  This should be in the server.
2017-10-16 11:54:31 -07:00
Jeff Grafton aee5f457db update BUILD files 2017-10-15 18:18:13 -07:00
Kubernetes Submit Queue 4548a07c0e Merge pull request #53781 from sttts/sttts-kill-pkg-api-util
Automatic merge from submit-queue (batch tested with PRs 47039, 53681, 53303, 53181, 53781). 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>.

Get rid of pkg/api/util

Old helpers we can replace with apimachinery tools.
2017-10-12 15:45:31 -07:00
Kubernetes Submit Queue dc404d49d4 Merge pull request #53303 from liggitt/discovery-logging
Automatic merge from submit-queue (batch tested with PRs 47039, 53681, 53303, 53181, 53781). 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>.

Avoid fetching entire discovery tree when possible

For specific commands, we use discovery to determine whether a particular resource is available.

We should avoid fetching the entire discovery tree to check a single resource group version. As the number of groups grows, the performance hit and potential to encounter an error also grows.

```release-note
NONE
```
2017-10-12 15:45:26 -07:00
Dr. Stefan Schimanski a6f0cd01ee Get rid of pkg/api/util 2017-10-12 16:36:32 +02:00
Kubernetes Submit Queue 87bd30a142 Merge pull request #53606 from juanvallejo/jvallejo/add-approx-pod-template-factory-method
Automatic merge from submit-queue (batch tested with PRs 53606, 49361). 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 ApproximatePodTemplateForObject factory method

Makes it possible to get at a pod spec template even if an object is scaled to zero, for use with commands that care about pod templates.

**Release note**:

```release-note
NONE
```

Related downstream patch and use-case: https://github.com/openshift/origin/pull/16379

cc @smarterclayton
2017-10-11 22:41:29 -07:00
Jordan Liggitt 59c4d7fdf3
Avoid fetching entire discovery tree when possible 2017-10-12 00:27:42 -04:00
Antoine Pelisse d1ce36371e kubectl: Remove swagger 1.2 entirely. 2017-10-10 14:50:56 -07:00