Commit Graph

3954 Commits (d118e44320a5084407554f2b0f08bf50f0569aba)

Author SHA1 Message Date
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
Kubernetes Submit Queue 127dc0653f
Merge pull request #54818 from apelisse/propagate-error-diff
Automatic merge from submit-queue (batch tested with PRs 54728, 54818). 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>.

diff: Propragate errors when diffing

Because of that, errors while diffing would potentially not do anything,
leaving the user clueless of what was going on.

**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-30 20:29:18 -07:00
Kubernetes Submit Queue 812f1a3edb
Merge pull request #54533 from mengqiy/kubectl_scheme
Automatic merge from submit-queue (batch tested with PRs 54533, 54777, 54763, 54806, 54703). 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 kubectl's own instance of Scheme and Registry

Create kubectl's own instance of Registry and Scheme.
Switch most command that doesn't depend on internal types to use kubectl's own scheme and register.

There are some hack of registering the internal types in some of unit test now, they should be gone after switch to the external type.

Switch kubectl's factory code to use kubectl's scheme will create a lot of ripples.
I don't want make this PR a super giant PR, so I will do it in a followup PR.

Partially addressed #48564.

Copy the summary from https://github.com/kubernetes/kubernetes/pull/54533#issuecomment-340522302:
- creates pkg/kubectl/scheme (install.go and scheme.go) with
deps on properly vendored k8s.io packages.
- deletes about 80% percent of dependence on pkg/api/legacyscheme
- replaces direct dependence from pkg/kubectl on
pkg/apis/rbac
to a vendor style dependence on
k8s.io/api/rbac
and removes dependencies on rbac paths containing internalversion
- replaces almost 50% of direct dependence on pkg/api with (properly vendored)
k8s.io/api/core/v1
- deletes all of dependence on pkg/apis/policy and k8s.io/api/policy/v1beta1

```release-note
NONE
```

/assign @monopole @apelisse
cc: @pwittrock
2017-10-30 17:38:14 -07:00
Antoine Pelisse b916739d4f diff: Propragate errors when diffing
Because of that, errors while diffing would potentially not do anything,
leaving the user clueless of what was going on.
2017-10-30 14:16:36 -07:00
Kubernetes Submit Queue 81b1fa4588
Merge pull request #53796 from lichuqiang/kubectl_fix_1
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 print format of rootScoped resourced in kubectl

**What this PR does / why we need it**:
remove _NAMESPACE_ filed when querying rootScoped resource with kubectl

**Which issue this PR fixes**

fixes #53767

**Special notes for your reviewer**:
/cc @smarterclayton 


**Release note**:
```release-note
NONE
```
2017-10-30 13:47:56 -07:00
Kubernetes Submit Queue 12e5db561e
Merge pull request #53768 from smarterclayton/chunking_cli
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>.

Support api chunking in kubectl get

This enables chunking in the resource builder to make it easy to
retrieve resources in pages and visit partial result sets. This adds
`--chunk-size` to `kubectl get` only so that users can get comfortable
with the use of chunking in beta. Future changes will enable chunking
for all CLI commands so that bulk actions can be performed more
efficiently.

```
$ kubectl get pods --all-namespaces
... print batch of 500 pods ...
... print second batch of 500 pods ...
...
```

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

```release-note
`kubectl get` will by default fetch large lists of resources in chunks of up to 500 items rather than requesting all resources up front from the server. This reduces the perceived latency of managing large clusters since the server returns the first set of results to the client much more quickly.  A new flag `--chunk-size=SIZE` may be used to alter the number of items or disable this feature when `0` is passed.  This is a beta feature.
```
2017-10-29 15:59:54 -07: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
ymqytw 35468469eb create an instance of registry and scheme for kubectl 2017-10-27 14:51:47 -07:00
Clayton Coleman 4780ad0297
Support api chunking in kubectl get
This enables chunking in the resource builder to make it easy to
retrieve resources in pages and visit partial result sets. This adds
`--chunk-size` to `kubectl get` only so that users can get comfortable
with the use of chunking in beta. Future changes will enable chunking
for all CLI commands so that bulk actions can be performed more
efficiently.
2017-10-27 17:23:36 -04:00
Kubernetes Submit Queue 51652d1c23 Merge pull request #53816 from marun/remove-federation
Automatic merge from submit-queue (batch tested with PRs 54112, 54150, 53816, 54321, 54338). 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 federation

This PR removes the federation codebase and associated tooling from the tree.

The first commit just removes the `federation` path and should be uncontroversial.  The second commit removes references and associated tooling and suggests careful review.

Requirements for merge:

- [x] Bazel jobs no longer hard-code federation as a target ([test infra #4983](https://github.com/kubernetes/test-infra/pull/4983))
- [x] `federation-e2e` jobs are not run by default for k/k

**Release note**:

```release-note
Development of Kubernetes Federation has moved to github.com/kubernetes/federation.  This move out of tree also means that Federation will begin releasing separately from Kubernetes.  The impact of this is Federation-specific behavior will no longer be included in kubectl, kubefed will no longer be released as part of Kubernetes, and the Federation servers will no longer be included in the hyperkube binary and image.
```

cc: @kubernetes/sig-multicluster-pr-reviews @kubernetes/sig-testing-pr-reviews
2017-10-26 17:07:28 -07:00
Maru Newby adc338d330 Remove all traces of federation 2017-10-26 13:37:37 -07:00
zhengjiajin dd9ab89e31 fix issue(#52994)kubectl set resource can not update multi resource in local 2017-10-26 15:33:22 +08:00
Kubernetes Submit Queue 455256e292 Merge pull request #54470 from frodenas/kubectl-policy-deps
Automatic merge from submit-queue (batch tested with PRs 54336, 54470, 54334, 54175). 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 drain command to use policy V1Beta1 instead of unversioned API

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

Removes kubectl dependency on `k8s.io/kubernetes/pkg/apis/policy` by switching to `k8s.io/api/policy/v1beta1`. Part of 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 https://github.com/kubernetes/kubectl/issues/90

**Special notes for your reviewer**:

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

**Release note**:

```release-note
NONE
```
2017-10-25 15:16:08 -07:00
Kubernetes Submit Queue 5719eb0e31 Merge pull request #54559 from zjj2wry/create-ns-dep
Automatic merge from submit-queue (batch tested with PRs 52003, 54559, 54518). 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 kubectl create namespace dependencies on kubernetes/pkg/api

**What this PR does / why we need it**:
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**:

**Release note**:

```release-note
NONE
```
2017-10-25 11:38:39 -07:00
Kubernetes Submit Queue 671efe1255 Merge pull request #54506 from juanvallejo/jvallejo/remove-check-resource-builder
Automatic merge from submit-queue (batch tested with PRs 54399, 54557, 54506). 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 mutual exclusivity check - local, unstructured builder attrs

**Release note**:
```release-note
NONE
```
Remove incorrect mutual exclusivity check between the resource builder `Local` and `Unstructured` attributes.

Related comment: https://github.com/kubernetes/kubernetes/pull/48763#discussion_r146437490
Followup to https://github.com/kubernetes/kubernetes/pull/48763

cc @smarterclayton
2017-10-25 09:50:09 -07:00
Ferran Rodenas c1802dc472 Update kubectl drain command to use policy V1Beta1 instead of unversioned API
Signed-off-by: Ferran Rodenas <frodenas@gmail.com>
2017-10-25 16:44:57 +02:00
zhengjiajin d2bd6a7ff1 Remove kubectl create namespace dependencies on kubernetes/pkg/api 2017-10-25 20:26:11 +08:00
Kubernetes Submit Queue 6ba5f77d5d Merge pull request #53920 from apelisse/diff
Automatic merge from submit-queue (batch tested with PRs 53051, 52489, 53920). 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 `kubectl alpha diff` to diff resources

`kubectl alpha diff` lets you diff your resources against live
resources, or last applied, or even preview what changes are going to be
applied on the cluster.

This is still quite premature, and mostly untested.

**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**:
Clearly not ready for Release note.
```release-note
NONE
```

kubernetes/community#287
2017-10-24 21:38:23 -07:00
Kubernetes Submit Queue 8f79857b42 Merge pull request #54094 from juanvallejo/jvallejo/exit-plugin-cmd-w-correct-exit-code
Automatic merge from submit-queue (batch tested with PRs 54107, 54184, 54377, 54094, 54111). 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>.

exit with correct exit code on plugin failure

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

Correctly exits after a plugin command execution failure with the correct exit code.
Related downstream bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1501756

**Before**
```
$ kubectl plugin will-fail-plugin
ls: cannot access 'does-not-exist': No such file or directory
error: exit status 2

$ echo $?
1
```

**After**
```
$ kubectl plugin will-fail-plugin
ls: cannot access 'does-not-exist': No such file or directory
error: exit status 2

$ echo $?
2
```

cc @fabianofranz
2017-10-24 15:59:13 -07:00
Kubernetes Submit Queue 2ad7d6f711 Merge pull request #54083 from juanvallejo/jvallejo/update-resource-builder-cmd-drain
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 resource selector - kubectl drain

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

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

Updates resource builder in cmd/drain.go to parse resource args similar to other commands.

cc @liggitt
2017-10-24 14:16:39 -07:00
Kubernetes Submit Queue 39218a1b44 Merge pull request #54270 from WanLinghao/set_command_fix
Automatic merge from submit-queue (batch tested with PRs 54270, 54479). 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 set command

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

1. fix some errors in 'kubectl set' series command

2.remove unused function in kubectl set env command

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

```
NONE
```
2017-10-24 11:52:04 -07:00
juanvallejo 6144799f75
remove mutual exclusivity check - local, unstructured builder attrs 2017-10-24 14:16:47 -04:00
Antoine Pelisse ed38f43495 apply/strategy: Improve test performance
Test running time goes from 150 seconds to 7 seconds with that one
simple trick. Do not re-parse openapi schema for every test, but keep
one version for the whole test (specifically since it's read-only anyway).
2017-10-23 20:29:39 -07:00
Kubernetes Submit Queue 78c7e7f79f Merge pull request #54441 from apelisse/fix-apply-govet
Automatic merge from submit-queue (batch tested with PRs 53479, 54373, 54441, 54443). 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 govet in pkg/kubectl/apply

**What this PR does / why we need it**: Fix govet warning by explicitly using field keys.

**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-23 18:39:08 -07:00
Kubernetes Submit Queue f7dbe30f2b Merge pull request #54373 from dims/better-error-check-for-cluster-info
Automatic merge from submit-queue (batch tested with PRs 53479, 54373, 54441, 54443). 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>.

Better error check for kubectl cluster-info

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

In RunClusterInfo, We try to connect to the api service and get some
information, but we just ignore the errors from Do().Visit(). We should
return the error returned by Do().Visit() so the "kubectl cluster-info"
would fail correctly with an error code.
In RunClusterInfo, We try to connect to the api service and get some
information, but we just ignore the errors from Do().Visit(). We should
return the error returned by Do().Visit() so the "kubectl cluster-info"
would fail correctly with an error code.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-10-23 18:39:05 -07:00
Kubernetes Submit Queue 6949b518d6 Merge pull request #54245 from deads2k/cli-03-postraw
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 kubectl create --raw -f

Adds `--raw` to `kubectl create` to match `kubectl get --raw`.  It re-uses the transport, reads the input stream (stdin or a single file for now) and posts directly to the endpoint specified.  This let's you direct data directly at a subresource (as a for instance).  I'd like to see this extended to `kubectl replace` too, so that we have full access to subresources via scripting without having to reproduce the transports.

@kubernetes/sig-cli-pr-reviews 

```release-note
add `--raw` to `kubectl create` to POST using the normal transport
```
2017-10-23 17:16:01 -07:00
Antoine Pelisse 5fa8702af4 Fix govet in pkg/kubectl/apply 2017-10-23 14:07:01 -07:00
Kubernetes Submit Queue ca8d97d673 Merge pull request #53743 from DirectXMan12/feature/polymorphic-scale-client
Automatic merge from submit-queue (batch tested with PRs 53743, 53564). 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>.

Polymorphic Scale Client

This PR introduces a polymorphic scale client based on discovery information that's able to scale scalable resources in arbitrary group-versions, as long as they present the scale subresource in their discovery information.

Currently, it supports `extensions/v1beta1.Scale` and `autoscaling/v1.Scale`, but supporting other versions of scale if/when we produce them should be fairly trivial.

It also updates the HPA to use this client, meaning the HPA will now work on any scalable resource, not just things in the `extensions/v1beta1` API group.

**Release note**:
```release-note
Introduces a polymorphic scale client, allowing HorizontalPodAutoscalers to properly function on scalable resources in any API group.
```

Unblocks #29698
Unblocks #38756
Unblocks #49504 
Fixes #38810
2017-10-23 13:39:07 -07:00
Antoine Pelisse 011a45cde7 Implement `kubectl alpha diff` to diff resources
`kubectl alpha diff` lets you diff your resources against live
resources, or last applied, or even preview what changes are going to be
applied on the cluster.

This is still quite premature, and mostly untested.
2017-10-23 10:49:02 -07:00
David Eads 58f39a15de add kubectl create --raw -f 2017-10-23 12:50:46 -04:00
Davanum Srinivas 998f33272d Better error check for kubectl cluster-info
In RunClusterInfo, We try to connect to the api service and get some
information, but we just ignore the errors from Do().Visit(). We should
return the error returned by Do().Visit() so the "kubectl cluster-info"
would fail correctly with an error code.
2017-10-22 19:46:13 -04:00
Kubernetes Submit Queue 668bedd943 Merge pull request #53863 from marun/fed-move-cluster
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>.

fed: Move cluster generator & constants from kubectl to kubefed pkg

This will ensure the history of the federation-only files can be cheaply retained during the branch filtering that will occur for #52992.

cc: @kubernetes/sig-multicluster-pr-reviews

/sig multicluster
/area federation
/assign irfanurrehman shashidharatd
/release-note-none
2017-10-21 04:44:10 -07:00
Kubernetes Submit Queue 9403fcc9c7 Merge pull request #54024 from pwittrock/resource-validation-deps
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>.

kubectl resource builder to use versioned list

Switch to using a versioned listed when return an object from the resource builder.

This is necessary to allow cli's built outside the kubernetes/kubernetes repo to vendor the resource builder logic without vendoring all of Kubernetes.

The following commands call the modified function.  (identified by changing the function name and recompiling)

- [x] `attach`
  - pkg/kubectl/cmd/attach.go:155: builder.Do().Object
  - passes to `AttachablePodForObject` which does not support Lists of any kind
- [x] `get`
  - pkg/kubectl/cmd/get.go:251: r.Object
  - [x] check if isList with `IsListType` -> `GetItemsPtr` -> check for presence of `Items` field
  - [x] pass to `ResourceVersion` -> `CommonAccessor` -> checks for `metav1.ListInterface` (which this PR introduces a compile time check to ensure v1.List implements this)
  - [x] pass to `ExtractList` -> checks if items implement `runtime.RawExtension`
- [x] `rolling_update`
  - pkg/kubectl/cmd/rollingupdate.go:207: request.Object
  - only accepts lists of length 1.  updated in PR to support both api.List and v1.List
- [x] `rollout_status`
  - pkg/kubectl/cmd/rollout/rollout_status.go:107: r.Object
  - passes to `ResourceVersion` -> `CommonAccessor` -> checks for `metav1.ListInterface`

```release-note
NONE
```

Closes kubernetes/kubectl#81
2017-10-20 21:31:10 -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 67e9fb6288 Merge pull request #53916 from juanvallejo/jvallejo/update-dockercfg-data
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 .dockercfg content to config.json

update the data format of .dockercfg to match the new docker config.json
format, which encapsulates all registry auth objects in an overall
"auths" object when an option `--config-format` is specified with the value
`--config-format=config.json`:

```
{
    "auths": {
        "reg.url": {
            "auth": "...=="
        }
    }
}
```

**Release note**:
```release-note
secret data containing Docker registry auth objects is now generated using the config.json format
```

cc @bparees @fabianofranz
2017-10-20 10:37:26 -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
WanLinghao c79aba664b fix some small errors in 'kubectl set' series command
modified:   pkg/kubectl/cmd/set/set_env.go
modified:   pkg/kubectl/cmd/set/set_serviceaccount.go
modified:   pkg/kubectl/cmd/set/set_subject.go
2017-10-20 12:48:34 +08:00
Solly Ross eac2049fc9 [client-go] avoid Registry in fake REST client
Previously, the fake RESTClient in client-go required a Registry.  It
used the Registry to fetch the GroupVersion for the fake client.
However, the way it did so was dubious in some cases (it hard-coded the
default API group in places), and not strictly necssary.

This updates the fake client to just recieve the GroupVersion and
internal group name directly, instead of requiring a Registry, so that
it can be consumed in unit tests where a Registry isn't necessarily
readily available (e.g. elsewhere in client-go).
2017-10-19 11:01:44 -04:00
juanvallejo ee2f9c95e7
update resource selector - kubectl drain 2017-10-19 10:10:06 -04:00
Kubernetes Submit Queue eb041b00ea Merge pull request #53609 from juanvallejo/jvallejo/set-user-specified-ns-dry-run-create
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 user-specified  ns to --dry-run created obj

Fixes https://github.com/kubernetes/kubernetes/issues/51068

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

Includes a namespace in a created resource's metadata when `--dry-run` is used if:
- a namespace was explicitly set by the user (via `--namespace`)
- No errors occur accessing the object's metadata

cc @fabianofranz @deads2k
2017-10-19 00:24:42 -07:00
Kubernetes Submit Queue 29d2f15c9e Merge pull request #47636 from xiangpengzhao/some-cleanup
Automatic merge from submit-queue (batch tested with PRs 51310, 51458, 47636). 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>.

Clean up some service related description

**What this PR does / why we need it**:
As per the review comment https://github.com/kubernetes/kubernetes/pull/47250#discussion_r121162426, send this cleanup PR.

**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**:
since this is minor cleanup, there is no related issue. see https://github.com/kubernetes/kubernetes/pull/47250#discussion_r121162426

**Release note**:

```release-note
NONE
```
2017-10-18 20:47:10 -07:00
juanvallejo 96d3f4552f
exit with correct exit code on plugin failure 2017-10-18 19:01:29 -04:00
juanvallejo 027c8b9ef2
update .dockercfg content to config.json
update the data format of .dockercfg to match the new docker config.json
format, which encapsulates all registry auth objects in an overall
"auths" object:

{
    "auths": {
        "reg.url": {
            "auth": "...=="
        }
    }
}
2017-10-18 14:33:14 -04: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
Phillip Wittrock fd169a6218 Switch to v1.List instead of allowing the conversion fn to be provided. 2017-10-18 09:30:46 -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