Commit Graph

1873 Commits (032e450ec41f2fb06420e4fd1b0aac44f58c2ff5)

Author SHA1 Message Date
Kubernetes Submit Queue 4ab5a76338 Merge pull request #33103 from deads2k/controller-03-kill-non-generatedclient
Automatic merge from submit-queue

switch controller manager to generated clients

Switches the controller manager to generated clients.

@ncdc ptal
2016-09-22 11:37:01 -07:00
deads2k 43db7c0c44 generated code that was missing before 2016-09-22 13:30:42 -04:00
deads2k 483af28944 fix up service lister 2016-09-22 09:12:37 -04:00
Kubernetes Submit Queue 5af04d1dd1 Merge pull request #32876 from errordeveloper/more-cert-utils
Automatic merge from submit-queue

Refactor cert utils into one pkg, add funcs from bootkube for kubeadm to use

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

We have ended-up with rather incomplete and fragmented collection of utils for handling certificates. It may be worse to consider using `cfssl` for doing all of these things, but for now there is some functionality that we need in `kubeadm` that we can borrow from bootkube. It makes sense to move the utils from bookube into core, as discussed in #31221.

**Special notes for your reviewer**: I've taken the opportunity to review names of existing funcs and tried to make some improvements in that area (with help from @peterbourgon).

**Release note**:

```release-note
NONE
```
2016-09-22 01:29:46 -07:00
Antoine Pelisse 938872582e Revert "simplify RC and SVC listers" 2016-09-21 15:49:38 -07:00
Chao Xu a4e62297d6 fix tests 2016-09-21 14:44:39 -07:00
Kubernetes Submit Queue 2d9d84dc64 Merge pull request #32888 from deads2k/client-10-fixup-remaining-listers
Automatic merge from submit-queue

simplify RC and SVC listers

Make the RC and SVC listers use the common list functions that more closely match client APIs, are consistent with other listers, and avoid unnecessary copies.
2016-09-21 04:13:56 -07:00
Clayton Coleman 07f079216e
Make clientcmd defaulting a function of ConfigOverrides and LoadingRules
This commit moves away from using a global variable for default
configuration checking, and instead exposes a method on LoadingRules to
determine whether a particular restclient.Config should be considered
"default". This allows kubectl to provide its own defaults (the same
as before, KUBERNETES_MASTER and the static localhost:8080 values) while
allowing other clients to avoid defining them.

In-cluster config defaulting is now easier to read.
2016-09-21 01:28:06 -04:00
deads2k b83a317003 switch controller manager to generated clientset 2016-09-20 12:53:47 -04:00
deads2k adda69c7ca generated code 2016-09-20 12:53:46 -04:00
Kubernetes Submit Queue 0e5def2054 Merge pull request #33040 from wongma7/storage-codegen
Automatic merge from submit-queue

Add storage api group to hack/update-codegen.sh

Add it to the script then run it in the second commit. 1.4 needs the same change, I'll do it in my other PR.
2016-09-20 08:48:43 -07:00
deads2k 16fbb47189 fix up service lister 2016-09-20 08:24:33 -04:00
deads2k 185a7adf84 fix RC lister 2016-09-20 08:24:32 -04:00
Kubernetes Submit Queue 76f2ddf4e8 Merge pull request #32292 from pmorie/subresource-fake
Automatic merge from submit-queue

Add godoc on using FakeClient with subresources

Add a little godoc on using FakeClient with subresources, hoping to prevent future occurences of #32127.
2016-09-19 23:51:23 -07:00
Matthew Wong 7ba1410521 Generate clientset 1.5 2016-09-19 15:54:08 -04:00
Kubernetes Submit Queue a089791f3e Merge pull request #32989 from lojies/fixspellerr
Automatic merge from submit-queue

fix a spell mistake

**What this PR does / why we need it**:
fixed a spell mistake

**Which issue this PR fixes** :

**Special notes for your reviewer**:

**Release note**:
<!--  Steps to write your release note:
1. Use the release-note-* labels to set the release note state (if you have access) 
2. Enter your extended release note in the below block; leaving it blank means using the PR title as the release note. If no release note is required, just write `NONE`. 
-->
```release-note
```
2016-09-19 11:41:00 -07:00
Kubernetes Submit Queue 87b40782c9 Merge pull request #31150 from ncdc/handle-init-container-terminated-pod-running-condition
Automatic merge from submit-queue

Check init containers in PodContainerRunning

Sometimes when an init container runs and terminates quickly, PodContainerRunning can go into a
state where the pod indicates it's still running, but the container is already terminated. Handle
that condition by returning ErrContainerTerminated when it happens.

See also #29952

@smarterclayton @fabianofranz
2016-09-19 05:43:21 -07:00
Ilya Dmitrichenko 386fae4592
Refactor utils that deal with certs
- merge `pkg/util/{crypto,certificates}`
- add funcs from `github.com/kubernetes-incubator/bootkube/pkg/tlsutil`
- ensure naming of funcs is fairly consistent
2016-09-19 09:03:42 +01:00
lojies fc9f029e5a fix a spell mistake 2016-09-18 15:04:59 +08:00
deads2k 1bf17eb4e9 change factorization of listers to make them easier to add 2016-09-16 14:49:00 -04:00
Kubernetes Submit Queue e8fbcb1669 Merge pull request #32654 from soltysh/sj_clientset
Automatic merge from submit-queue

Switch ScheduledJob controller to use clientset

**What this PR does / why we need it**:
This is part of #25442. I've applied here the same fix I've applied in the manual client in #29187, see the 1st commit for that (@caesarxuchao we've talked about it in #29856).

@deads2k as promised 
@janetkuo ptal
2016-09-16 05:03:57 -07:00
Kubernetes Submit Queue 27c093ea90 Merge pull request #32048 from smarterclayton/consistent_errors
Automatic merge from submit-queue

Handle Stream() errors consistently in restclient

We should be following the same rules for Stream() as the normal body
request flow.

Also add slightly more output on a server error - in the future we may
want to clean this up but it's potentially hiding bad responses.

Related to #32009 but isn't the fix (so far)
2016-09-15 20:13:48 -07:00
Kubernetes Submit Queue fcc97f37ee Merge pull request #32718 from mikedanese/mv-informer
Automatic merge from submit-queue

move informer and controller to pkg/client/cache

@kubernetes/sig-api-machinery
2016-09-15 16:44:30 -07:00
Mike Danese a765d59932 move informer and controller to pkg/client/cache
Signed-off-by: Mike Danese <mikedanese@google.com>
2016-09-15 12:50:08 -07:00
deads2k 4359c79f53 add FirstHitRESTMapper for adding thirdparty resources 2016-09-15 10:26:39 -04:00
Mike Danese 2cbbaf4384 autogenerated 2016-09-14 16:33:12 -07:00
Kubernetes Submit Queue 9aca785bc8 Merge pull request #32613 from madhusudancs/fed-clientcmd-bug-31947-fix
Automatic merge from submit-queue

Fix clientcmd for a non-host cluster client running in a pod. 

This is based on @errordeveloper's PR #32438. It fixes a case where default config is invalid and original config, i.e. `mergedConfig` is empty. It also adds a test for the case where default config is invalid and original config is neither invalid nor empty.

cc @errordeveloper @kubernetes/sig-cluster-federation @pwittrock @colhom
2016-09-14 13:10:27 -07:00
Maciej Szulik 5894834cc8 Generated changes for clientset 2016-09-14 11:27:29 +02:00
Madhusudan.C.S c4acaa6717 Add a test to verify that the client config is returned when default config is invalid. 2016-09-13 15:34:56 -07:00
Madhusudan.C.S 0433fe0d72 Do not return original config, i.e. mergeConfig, when it is empty and default config is invalid. 2016-09-13 15:33:51 -07:00
deads2k e5dbfdacc0 generated client 2016-09-13 08:54:23 -04:00
deads2k 8fac64b43f add localSAR 2016-09-13 08:54:23 -04:00
Kubernetes Submit Queue ac8aae584d Merge pull request #32393 from smarterclayton/incluster_namespace
Automatic merge from submit-queue

Allow namespace to be loaded from in-cluster config

This is a follow on from the previous commit that fixed ClientConfig.
Namespace can also be defaulted from ICC, and this correctly handles
that logic. Also add two debugging lines to ensure that it is easier in
the future to uncover problems here.

Fixes #32352

@deads2k
2016-09-13 04:02:21 -07:00
Kubernetes Submit Queue a44d2f8009 Merge pull request #32243 from caesarxuchao/generate-1-5-clientset
Automatic merge from submit-queue

Generate 1 5 clientset

Generate the 1.5 clientset. Stop updating 1.4 clientset. Remove 1.2 clientset.

@nikhiljindal @lavalamp 

I will rebase #31994 atop of this one.
2016-09-12 23:04:50 -07:00
Chao Xu 70d62a93a5 other manual changes 2016-09-12 10:24:18 -07:00
deads2k f756e43e7f convert rolling updater to generated client 2016-09-12 07:38:34 -04:00
deads2k 11c4de457d generated client code 2016-09-12 07:38:34 -04:00
Kubernetes Submit Queue 60b63b7cda Merge pull request #31767 from asalkeld/bad-context-error
Automatic merge from submit-queue

Add a check in ConfirmUsable() to validate the contextName

**What this PR does / why we need it**:
When a context name is provided, but can't be found (miss spelling), it currently
uses the defaults. This PR will cause the command to fail, to prevent unexpected side effects
of using the wrong configuration.

**Which issue this PR fixes**
fixes #21062

**Special notes for your reviewer**:
None

**Release note**:
```release-note
Error if a contextName is provided but not found in the kubeconfig.
```
2016-09-11 02:00:34 -07:00
Kubernetes Submit Queue bc835c608a Merge pull request #31586 from brendandburns/kubectl
Automatic merge from submit-queue

When prompting for passwords, don't echo to the terminal

@deads2k 
@kubernetes/kubectl
2016-09-10 13:58:13 -07:00
Wojciech Tyczynski e240aff741 Revert "Use scale subresource" 2016-09-10 18:35:07 +02:00
Kubernetes Submit Queue a5d6bf4095 Merge pull request #31111 from fraenkel/scale_subresource
Automatic merge from submit-queue

Use scale subresource

Fixes #29698

Use scale subresource for ReplicationController, ReplicaSet and Deployment.
Couldn't do Jobs and PetSet since they live in a different group.
2016-09-10 06:26:25 -07:00
Kubernetes Submit Queue c7d1e38412 Merge pull request #30963 from plutov/master
Automatic merge from submit-queue

Example of unversioned pkg uses correct Config struct

Currently this Doc has incorrect example - https://godoc.org/k8s.io/kubernetes/pkg/client/unversioned

So when developers use it they are confused why `client` pkg has no `Config` struct, actually this is a struct from `restclient` pkg.

Also pkg name and variable name should be equal:
`client, err := client.New(config)`

Thanks,
Alex
2016-09-10 04:27:05 -07:00
Ilya Dmitrichenko a96bd93c0f Check if default config is invalid before comparing it
Changes made in #31947 cause kube-proxy to ignore `--kubeconfig`
and `--master` flags and use in-cluster configuration, which is
unusable due to the fact that VIP hasn't been created yet.
2016-09-10 09:37:41 +02:00
Clayton Coleman d1d20e5340
Allow namespace to be loaded from in-cluster config
This is a follow on from the previous commit that fixed ClientConfig.
Namespace can also be defaulted from ICC, and this correctly handles
that logic. Also add two debugging lines to ensure that it is easier in
the future to uncover problems here.
2016-09-09 17:38:24 -04:00
Chao Xu cd93032cc7 remove release_1_2 2016-09-08 16:03:07 -07:00
Chao Xu ff9da535d3 generated 1.5 release 2016-09-08 16:03:07 -07:00
Paul Morie 4f45fa90ae Add godoc on using FakeClient with subresources 2016-09-08 10:29:07 -04:00
Kubernetes Submit Queue 7a4d81ea43 Merge pull request #31271 from deads2k/self-sar
Automatic merge from submit-queue

add selfsubjectaccessreview API

Exposes the REST API for self subject access reviews.  This allows a user to see whether or not they can perform a particular action.

@kubernetes/sig-auth
2016-09-08 01:29:48 -07:00
Matt Liggett 108a15db38 Add eviction e2e tests.
Also refactor the test a bit.
2016-09-07 17:38:38 -07:00
Kubernetes Submit Queue 7c27a2686f Merge pull request #31688 from mehdy/master
Automatic merge from submit-queue

updated client document
2016-09-07 16:25:24 -07:00
Kubernetes Submit Queue 184e91bbf6 Merge pull request #32182 from smarterclayton/aggregate_discovery_errors
Automatic merge from submit-queue

Use a structured error rather than an Aggregate error in discovery

Should provide more information for debugging the root cause of
discovery failures.

Exposes the true cause of #32009

@lavalamp @derekwaynecarr
2016-09-07 12:12:58 -07:00
Kubernetes Submit Queue 9f58a867e1 Merge pull request #31522 from krousey/path_validation
Automatic merge from submit-queue

Split path validation into a separate library

This PR splits path segment validation into it's own package. This cuts off one of the restclient's dependency paths to some docker packages, and completely eliminates its dependency on go-restful swagger validation.


cc @kubernetes/sig-api-machinery
2016-09-07 10:14:32 -07:00
Clayton Coleman 88b64a7a82
Use a structured error rather than an Aggregate error in discovery
Should provide more information for debugging the root cause of
discovery failures.
2016-09-07 10:59:03 -04:00
Kubernetes Submit Queue 54db8fa2e3 Merge pull request #31886 from deads2k/move-storage-class
Automatic merge from submit-queue

Move StorageClass to a storage group

We discussed the pros and cons in sig-api-machinery yesterday.  Choosing a particular group name means that clients (including our internal code) require less work and re-swizzling to handle promotions between versions.  Even if you choose a group you end up not liking, the amount of work remains the same as the incubator work case: you move the affected kind, resource, and storage.

This moves the `StorageClass` type to the `storage.k8s.io` group (named for consistency with authentication, authorization, rbac, and imagepolicy).  There are two commits, one for manaul changes and one for generated code.
2016-09-06 23:22:02 -07:00
Kubernetes Submit Queue 9dce773502 Merge pull request #31947 from smarterclayton/check_empty_config
Automatic merge from submit-queue

Check for EmptyConfig errors when trying to use in-cluster config

By removing the default "localhost:8080" behavior several paths in
client config began returning err == ErrEmptyConfig rather than err ==
nil.  The code checking for in cluster config was wrong - the logic
should be:

1. If loading the underlying config returns a non-empty error, fail
2. If the underlying config is not equal to the default config,
   return that config (it has user input)
3. If it is possible to use in-cluster config, do so
4. Otherwise return the default config (and or default EmptyConfig
   error).

Fixes #31910 @thockin @lavalamp @deads2k. We introduced EmptyConfig a very long time ago, but until I removed the "localhost:8080" Kubernetes was not actually exposing it (OpenShift relies on it since we don't set an insecure default). This properly falls through to in-cluster config in the described conditions.



```release-note
Some components like kube-dns and kube-proxy could fail to load the service account token when started within a pod. Properly handle empty configurations to try loading the service account config.
```
2016-09-06 22:02:55 -07:00
Ryan Hitchman 4c7ef6561e Revert "Add e2e tests for eviction subresource." 2016-09-06 16:21:50 -07:00
Clayton Coleman 48b4d6d30c
Check for EmptyConfig errors when trying to use in-cluster config
By removing the default "localhost:8080" behavior several paths in
client config began returning err == ErrEmptyConfig rather than err ==
nil.  The code checking for in cluster config was wrong - the logic
should be:

1. If loading the underlying config returns a non-empty error, fail
2. If the underlying config is not equal to the default config,
   return that config (it's got user input)
3. If it is possible to use in cluster config, do so
4. Otherwise return the default config (and or default EmptyConfig
   error).
2016-09-06 17:46:50 -04:00
Kubernetes Submit Queue 3da5d781fc Merge pull request #31722 from mml/evict.test
Automatic merge from submit-queue

Add e2e tests for eviction subresource.

This branch includes changes pending in both #31638 and #31721.  I will rebase
once those merge.
2016-09-06 14:25:07 -07:00
Matt Liggett c377011138 Add eviction e2e tests.
Also refactor the test a bit.
2016-09-06 11:58:22 -07:00
Wojciech Tyczynski e0779df721 Fix race in DeltaFIFO 2016-09-06 20:48:18 +02:00
deads2k 6320dc6e73 generated code for moving StorageClass 2016-09-06 08:41:17 -04:00
deads2k cd5b6cc491 move StorageClass to its own group 2016-09-06 08:41:17 -04:00
Kubernetes Submit Queue 1c85bbe6cb Merge pull request #31718 from pmorie/fake-client-doc
Automatic merge from submit-queue

Improve doc for the fake client

Improve doc in this type.

cc @derekwaynecarr @ncdc @deads2k
2016-09-05 11:10:23 -07:00
Angus Salkeld 9fcce9e001 Work around go cover bug
This avoids the whole command failing because of errors like the following:
```
# cover k8s.io/kubernetes/pkg/client/restclient
cover: internal error: block 268 overlaps block 270
```
For vendor code, igone
For local code replace the switch with an if statement
2016-09-05 09:59:15 +10:00
Clayton Coleman 5e6f5fee8a
Handle Stream() errors consistently in restclient
We should be following the same rules for Stream() as the normal body
request flow.

Also add slightly more output on a server error - in the future we may
want to clean this up but it's potentially hiding bad responses.
2016-09-04 14:50:04 -04:00
Kubernetes Submit Queue 11765ab92e Merge pull request #31887 from liggitt/certificates-group
Automatic merge from submit-queue

Namespace certificates API group

New API groups should follow best-practices for naming, including using DNS names within the k8s.io namespace

```release-note
The certificates API group has been renamed to certificates.k8s.io
```
2016-09-02 15:08:55 -07:00
Kubernetes Submit Queue 64c2beae09 Merge pull request #31834 from wongma7/pvc-genclient
Automatic merge from submit-queue

Generate versioned client for pvc

I noticed while trying to use client-go that there is no way to get PVC with versioned clientset. I don't know why it is excluded, I cannot find any discussion about this, so I am creating this assuming it is just an oversight...
2016-09-01 15:01:13 -07:00
Jordan Liggitt a869de61bd
Namespace certificates API group 2016-09-01 14:39:06 -04:00
Angus Salkeld e9cad12e5f Add a check in ConfirmUsable() to validate the contextName 2016-09-01 11:35:11 +10:00
Matthew Wong 934fc002bc Generate versioned client for pvc 2016-08-31 18:57:56 -04:00
Kubernetes Submit Queue 1c607b391a Merge pull request #31721 from mml/disrupt.e2e.versioned
Automatic merge from submit-queue

Rewrite disruption e2e test to use versioned client.

This currently includes the changes from #31638.  I will rebase once that is merged.
2016-08-30 15:35:15 -07:00
Matt Liggett a5f1dc44f5 // update-all and staging/.../client-go/copy.sh 2016-08-30 13:35:51 -07:00
Matt Liggett 44b2c862ef Rewrite disruption e2e test to use versioned client. 2016-08-30 12:34:45 -07:00
Paul Morie c9b97c38a8 Improve doc for the fake client 2016-08-30 13:42:43 -04:00
Clayton Coleman 06cbb29e9e
ClientConfig should not default to http://localhost:8080
This changes clientcmd to skip the default cluster, but preserves the
behavior in kubectl. This prevents the possibility of an administrator
misconfiguration in kubelet or other server component from allowing a
third party who can bind to 8080 on that host from potentially
impersonating an API server and gaining root access.
2016-08-30 10:43:24 -04:00
mehdy fb00d77c17 updated document
as far as I dug into codes I figured it out that the config exists in `restclient` package
2016-08-30 12:46:52 +04:30
deads2k 2f642ebc9e generated 2016-08-29 09:51:55 -04:00
deads2k 97529e3687 add selfsubjectaccessreview API 2016-08-29 09:51:54 -04:00
Brendan Burns a79f714b1e Make password prompting hide the string 2016-08-27 21:31:04 -07:00
Kubernetes Submit Queue 961ef2b51d Merge pull request #31470 from caesarxuchao/regenerate-release-1-4
Automatic merge from submit-queue

Fix missing expansion files in clientset release 1.4

<!--  Thanks for sending a pull request!  Here are some tips for you:
1. If this is your first time, read our contributor guidelines https://github.com/kubernetes/kubernetes/blob/master/CONTRIBUTING.md and developer guide https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md
2. If you want *faster* PR reviews, read how: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/faster_reviews.md
3. Follow the instructions for writing a release note: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/pull-requests.md#release-notes
-->

**What this PR does / why we need it**:
Fix missing expansion files in clientset release 1.4;
Update the client-gen tool to automatically update generated_expansion.go;
Update the readme to document the best practice of using client-gen.

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

https://github.com/kubernetes/kubernetes/issues/29698#issuecomment-241315798


**Special notes for your reviewer**:

**Release note**:
<!--  Steps to write your release note:
1. Use the release-note-* labels to set the release note state (if you have access) 
2. Enter your extended release note in the below block; leaving it blank means using the PR title as the release note. If no release note is required, just write `NONE`. 
-->
```release-note
```

cc @lavalamp @krousey @mbohlool
2016-08-27 00:45:52 -07:00
Chao Xu bf578f1bc2 run client-gen 2016-08-26 10:55:22 -07:00
Chao Xu 74a424129f make subjectaccessreview expansion follow the convention 2016-08-26 10:54:51 -07:00
Kris e87edf9bd5 Split path validation into a separate library 2016-08-26 08:05:20 -07:00
Kubernetes Submit Queue 1184800cbb Merge pull request #30730 from janetkuo/prevent-overlapping-deployment
Automatic merge from submit-queue

Handle overlapping deployments gracefully

Fixes #30028
2016-08-25 21:50:56 -07:00
Michael Fraenkel f061f74f56 Use scale subresource
- Use scale subresource for ReplicationController, ReplicaSet and Deployment.
2016-08-25 17:17:12 -04:00
Kubernetes Submit Queue c5e7e5124a Merge pull request #30969 from asalkeld/raw-status-code
Automatic merge from submit-queue

Make sure the StatusCode is taken into account in DoRaw()

**What this PR does / why we need it**:
Currently if there is an error (not found) the error printed out
is to do with the inablity to convert an empty body into the expected json.

This patch will fill in the err correctly.

example of before (with NotFound error):
$ kubectl top node
failed to unmarshall heapster response: json: cannot unmarshal object into Go value of type []v1alpha1.NodeMetrics

Now:
$ kubectl top node
the server could not find the requested resource (get services http:heapster:)

**Which issue this PR fixes** 
related to bug #30818

**Special notes for your reviewer**:
None

**Release note**:
```release-note
NONE
```
2016-08-25 01:01:05 -07:00
Kubernetes Submit Queue 94666b4a4e Merge pull request #31112 from wojtek-t/set_unsorted_list
Automatic merge from submit-queue

Avoid sorting lists when unnecessary

I've seen ThreadSafeMap::List consuming ~30% of whole CPU usage, spending the whole time in sorting (while it is in fact completely unneded).
2016-08-24 10:11:36 -07:00
Kubernetes Submit Queue cfab351621 Merge pull request #31116 from fraenkel/scale_client
Automatic merge from submit-queue

Add ScaleExpansion to client v1.4

**What this PR does / why we need it**:
The generated v1.4 did not carry over the complete ScaleExpansion interface. The unversioned client is using this interface and should be in sync with generated client.

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

NONE
```
2016-08-24 02:09:35 -07:00
Janet Kuo 90557ec56c Handle overlapping deployments gracefully
1. When overlapping deployments are discovered, annotate them
2. Expose those overlapping annotations as warnings in kubectl describe
3. Only respect the earliest updated one (skip syncing all other overlapping deployments)
4. Use indexer instead of store for deployment lister
2016-08-23 14:33:30 -07:00
Angus Salkeld c955de2ba8 Make sure the StatusCode is taken into account in DoRaw()
Currently if there is an error (not found) the error printed out
is to do with the inablity to convert an empty body into the expected json.

This patch will fill in the err correctly.

example of before (with NotFound error):
$ kubectl top node
failed to unmarshall heapster response: json: cannot unmarshal object into Go value of type []v1alpha1.NodeMetrics

Now:
$ kubectl top node
the server could not find the requested resource (get services http:heapster:)
2016-08-23 11:42:42 +10:00
Andy Goldstein 8530ede61f Check init containers in PodContainerRunning
Sometimes when an init container runs and terminates quickly, PodContainerRunning can go into a
state where the pod indicates it's still running, but the container is already terminated. Handle
that condition by returning ErrContainerTerminated when it happens.
2016-08-22 15:55:42 -04:00
Michael Fraenkel d7d1bd592d Add ScaleExpansion to client v1.4 2016-08-22 09:58:28 -04:00
Wojciech Tyczynski 2804055978 Avoid sorting List when unnecessary 2016-08-22 15:07:17 +02:00
Kubernetes Submit Queue 1e5a5a2eac Merge pull request #30976 from wojtek-t/validated_selector
Automatic merge from submit-queue

	Don't validate selector that is already validated

Ref #30875

@timothysc
2016-08-22 03:34:44 -07:00
Kubernetes Submit Queue e29f1e2d11 Merge pull request #30948 from lavalamp/fix
Automatic merge from submit-queue

Do not hold the lock for a long time

Followup to #30839.

I'm not convinced this is a super great idea but I'll throw it out and let others decide.

Ref https://github.com/kubernetes/minikube/issues/368
Ref #30759
2016-08-22 02:50:19 -07:00
Kubernetes Submit Queue 5b5a4145da Merge pull request #30821 from ardnaxelarak/21076_change_isEmpty_to_Empty
Automatic merge from submit-queue

Rename IsEmpty to Empty

addresses #21076
2016-08-22 00:54:28 -07:00
Wojciech Tyczynski e9d5be628a Don't validate selector that is already validated 2016-08-22 09:39:32 +02:00
Kubernetes Submit Queue 0039d75dd0 Merge pull request #30896 from mfojtik/add-get
Automatic merge from submit-queue

Add Get() to cache listers

@kargakis @deads2k  PTAL
2016-08-21 17:31:26 -07:00
Kubernetes Submit Queue b51d5c3cc0 Merge pull request #30638 from krousey/metrics_registration
Automatic merge from submit-queue

Remove implicit Prometheus metrics from client

**What this PR does / why we need it**: This PR starts to cut away at dependencies that the client has.

**Release note**:
<!--  Steps to write your release note:
1. Use the release-note-* labels to set the release note state (if you have access) 
2. Enter your extended release note in the below block; leaving it blank means using the PR title as the release note. If no release note is required, just write `NONE`. 
-->
```release-note
The implicit registration of Prometheus metrics for request count and latency have been removed, and a plug-able interface was added. If you were using our client libraries in your own binaries and want these metrics, add the following to your imports in the main package: "k8s.io/pkg/client/metrics/prometheus". 
```

cc: @kubernetes/sig-api-machinery @kubernetes/sig-instrumentation @fgrzadkowski  @wojtek-t
2016-08-21 16:47:05 -07:00
Kubernetes Submit Queue 5a98379bca Merge pull request #29696 from brendandburns/kubecfg
Automatic merge from submit-queue

Add initial support for TokenFile to to the client config file.

@smarterclayton @deads2k @cjcullen @krousey 

Part of the fix for #28260
2016-08-21 11:18:21 -07:00
Kubernetes Submit Queue 7272cd09e3 Merge pull request #26541 from sttts/sttts-kubectl-exec-rc
Automatic merge from submit-queue

Return container command exit codes in kubectl run/exec

Fixes https://github.com/kubernetes/kubernetes/issues/26424
Based on https://github.com/kubernetes/kubernetes/pull/25273.

TODO:
- [x] add e2e tests
- [x] investigate `kubectl run` exit code for `--restart=Never` (compare issue #24533 and PR #25253)
- [x] document exit codes
2016-08-21 00:44:55 -07:00
Kubernetes Submit Queue c7a82463e7 Merge pull request #30950 from liggitt/support-name-field-selector
Automatic merge from submit-queue

Add support for the standard objectmeta field selectors

certificates API was missing standard field selectors (noticed in 4120179db5 (r75413160))

also silences client-side warnings when using field selectors that don't have a registered client-side transformation (no functional change, since we were already returning the original field/value). if we want to trend toward embedding less conversion logic in our clients, I don't see us fully duplicating field selector conversions client-side to make that warning disappear.
2016-08-20 20:11:00 -07:00
Kubernetes Submit Queue db777bb9a3 Merge pull request #30940 from madhusudancs/fed-issue-30790
Automatic merge from submit-queue

Return the current kubeconfig as the starting config in ClientConfigGetter.

This fixes issue #30790.

cc @kubernetes/sig-cluster-federation
2016-08-20 19:29:31 -07:00
Jordan Liggitt 3e5acd8476
Make client-side fieldSelector stop complaining about identity transforms 2016-08-20 21:34:33 -04:00
Kubernetes Submit Queue e9947d9ad7 Merge pull request #30813 from bprashanth/kubectl_petset
Automatic merge from submit-queue

Basic scaler/reaper for petset

Currently scaling or upgrading a petset is more complicated than it should be. Would be nice if this made code freeze on friday. I'm planning on a follow up change with generation number and e2es post freeze.
2016-08-20 10:51:07 -07:00
bindata-mockuser e792d4117d Add return code support to kubectl-exec and -run 2016-08-20 15:58:47 +02:00
Kubernetes Submit Queue a157e28ef6 Merge pull request #31016 from krousey/tcp_reuse
Automatic merge from submit-queue

Attempt to ensure entire resp body is read

**What this PR does / why we need it**: Enables the re-use of TCP connections when code fails to read the entire body of the response.

**Which issue this PR fixes**: fixes #30975 

**Special notes for your reviewer**:

This is a best effort approach. It only attempts to drain the body of the response if it's less than 1k. It seems like a reasonable barrier at which to give up and just use a new TCP connection.

cc: @wojtek-t @smarterclayton @lavalamp @kubernetes/sig-api-machinery
2016-08-19 15:45:34 -07:00
Kubernetes Submit Queue d40e2296b2 Merge pull request #30630 from silasbw/short-n0
Automatic merge from submit-queue

Add a short `-n` for `kubectl --namespace`

fixes #24078

 `--namespace` is a very common flag for nearly every `kubectl` command we have. We should claim `-n` for it.
2016-08-19 14:34:13 -07:00
Kara Alexandra d12a66a422 Rename IsEmpty to Empty
Signed-off-by: Kara Alexandra <kalexandra@us.ibm.com>
2016-08-19 14:19:19 -07:00
Kris 35c695005f Attempt to ensure entire resp body is read 2016-08-19 11:56:02 -07:00
Kris 8d6ce0dcc6 Remove implicit Prometheus metrics from client 2016-08-19 10:11:45 -07:00
Aliaksandr Pliutau 41ffa9a254 Example of unversioned pkg uses correct Config struct 2016-08-19 10:57:55 +07:00
Daniel Smith edc598a359 Do not hold the lock for a long time 2016-08-18 17:40:33 -07:00
Madhusudan.C.S 2b5d689ab2 Return the current kubeconfig as the starting config in ClientConfigGetter. 2016-08-18 15:51:21 -07:00
Clayton Coleman 12a5eeea17
Introduce GroupVersioner for capturing desired target version
Convert single GV and lists of GVs into an interface that can handle
more complex scenarios (everything internal, nothing supported). Pass
the interface down into conversion.
2016-08-18 14:45:00 -04:00
Michal Fojtik 2ccc9fa859 Add Get() to cache listers 2016-08-18 18:19:50 +02:00
Kubernetes Submit Queue 86340fc123 Merge pull request #30839 from lavalamp/fix
Automatic merge from submit-queue

queueActionLocked requires write lock

Fix https://github.com/kubernetes/minikube/issues/368
Fix part of #30759

Hopefully. On stack dumps I couldn't see who was fighting with this.
2016-08-18 02:43:25 -07:00
Kubernetes Submit Queue e2f39fca86 Merge pull request #30807 from caesarxuchao/change_pod_lister_api
Automatic merge from submit-queue

Continue on #30774: Change podNamespacer API

continue on #30774, credit to @wojtek-t, Ref #30759

I just fixed a test and converted IsActivePod to operate on *Pod.
2016-08-18 02:08:23 -07:00
bprashanth 30f3cb9d26 Scaler and reaper for petset 2016-08-17 17:37:56 -07:00
Daniel Smith 3e69c5a9b8 queueActionLocked requires write lock 2016-08-17 17:34:49 -07:00
Kubernetes Submit Queue 4b5fd43e24 Merge pull request #30250 from krousey/kctl_dynamic
Automatic merge from submit-queue

Change kubectl create to use dynamic client

https://github.com/kubernetes/kubernetes/issues/16764 https://github.com/kubernetes/kubernetes/issues/3955

This is a series of changes to allow kubectl create to use discovery-based REST mapping and dynamic clients.

cc @kubernetes/sig-api-machinery

**Release note**:
<!--  Steps to write your release note:
1. Use the release-note-* labels to set the release note state (if you have access) 
2. Enter your extended release note in the below block; leaving it blank means using the PR title as the release note. If no release note is required, just write `NONE`. 
-->
```release-note
kubectl will no longer do client-side defaulting on create and replace.
```
2016-08-17 14:48:56 -07:00
Wojciech Tyczynski 331083727f Change podNamespacer API 2016-08-17 16:55:01 +02:00
Kubernetes Submit Queue fdd2392035 Merge pull request #30504 from piosz/hpa-ext-client
Automatic merge from submit-queue

Hpa ext client

```release-note
Removed support for HPA in extensions client.
```

fix #21578
2016-08-17 01:35:16 -07:00
Matt Liggett d60ba3c6e2 Implement DisruptionController.
Part of #12611
2016-08-16 15:20:41 -07:00
Silas Boyd-Wickizer 39a9ec3a4f Add a short `-n` for `kubectl`'s `--namespace`
fixes #24078

--namespace is a very common flag for nearly every kubectl command we have.
We should claim -n for it.
2016-08-16 08:32:47 -07:00
Kris 63a512fe47 Add discovery mapper and dynamic typer to kubectl 2016-08-15 22:07:54 -07:00
Kris 3999f071d1 Add generic "List" type for all versions 2016-08-15 22:07:54 -07:00
Brendan Burns 50089f6c81 Initial support for TokenFile in the client config. 2016-08-15 21:59:49 -07:00
Kris e5c2154883 Eliminate redundant dynamic client type
This will allow people to override the default parameter codec and still
pass the resulting client with something that accepts *dynamic.Client.
2016-08-15 14:18:40 -07:00
Kris d9ce524d63 Expose dynamic client's content config 2016-08-15 14:18:40 -07:00
Kubernetes Submit Queue 69419a145a Merge pull request #29802 from jfrazelle/fix-go-vet-errors
Automatic merge from submit-queue

fix go vet errors

<!--
Checklist for submitting a Pull Request

Please remove this comment block before submitting.

1. Please read our [contributor guidelines](https://github.com/kubernetes/kubernetes/blob/master/CONTRIBUTING.md).
2. See our [developer guide](https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md).
3. If you want this PR to automatically close an issue when it is merged,
   add `fixes #<issue number>` or `fixes #<issue number>, fixes #<issue number>`
   to close multiple issues (see: https://github.com/blog/1506-closing-issues-via-pull-requests).
4. Follow the instructions for [labeling and writing a release note for this PR](https://github.com/kubernetes/kubernetes/blob/master/docs/devel/pull-requests.md#release-notes) in the block below.
-->

```release-note
```

This fixes the `go vet` errors brought about by go 1.7 testing re (#28742).

The are all pretty trivial and mostly related to literal composites.

also related to #16086
2016-08-15 13:10:08 -07:00
Kubernetes Submit Queue 612e3c2634 Merge pull request #30222 from hodovska/port-forward-cmd-struct
Automatic merge from submit-queue

kubectl/port-forward: complete/validate/run structure

```kubectl port-forward``` command is converted to a complete/validate/run kubectl command structure specified here: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/kubectl-conventions.md#command-conventions
In this PR is also exposed the ready and stop channel for API consumer.

Fixes #16504
2016-08-12 20:58:53 -07:00
Dominika Hodovska c5babe2396 expose ready/stop channel 2016-08-12 15:45:57 +02:00
Piotr Szczesniak a53cfd28fb Autogenerated changes 2016-08-12 15:13:44 +02:00
Kubernetes Submit Queue d2543c30d8 Merge pull request #30277 from wojtek-t/optimize_controllers
Automatic merge from submit-queue

Avoid computing DeepEqual in controllers all the time

Computing DeepCopy was responsible for ~33% of cpu usage of controller-manager before this PR.

<!--
Checklist for submitting a Pull Request

Please remove this comment block before submitting.

1. Please read our [contributor guidelines](https://github.com/kubernetes/kubernetes/blob/master/CONTRIBUTING.md).
2. See our [developer guide](https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md).
3. If you want this PR to automatically close an issue when it is merged,
   add `fixes #<issue number>` or `fixes #<issue number>, fixes #<issue number>`
   to close multiple issues (see: https://github.com/blog/1506-closing-issues-via-pull-requests).
4. Follow the instructions for [labeling and writing a release note for this PR](https://github.com/kubernetes/kubernetes/blob/master/docs/devel/pull-requests.md#release-notes) in the block below.
-->

```release-note
* Use the release-note-* labels to set the release note state 
* Clear this block to use the PR title as the release note 
-OR-
* Enter your extended release note here (newlines are formatted as bullets)
```

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.kubernetes.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.kubernetes.io/reviews/kubernetes/kubernetes/30277)
<!-- Reviewable:end -->
2016-08-12 03:20:58 -07:00
Daniel Smith f1fd638962 fix register.go files up + add test import 2016-08-11 17:06:54 -07:00
Kubernetes Submit Queue 035ec518af Merge pull request #28387 from caesarxuchao/gc-latency-measure
Automatic merge from submit-queue

[GarbageCollector] measure latency

First commit is #27600.

In e2e tests, I measure the average time an item spend in the eventQueue(~1.5 ms), dirtyQueue(~13ms), and orphanQueue(~37ms). There is no stress test in e2e yet, so the number may not be useful.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.kubernetes.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.kubernetes.io/reviews/kubernetes/kubernetes/28387)
<!-- Reviewable:end -->
2016-08-11 02:33:55 -07:00
Wojciech Tyczynski 1c9e623045 Remove dead variable from reflector 2016-08-11 08:32:37 +02:00
Jess Frazelle 7e9d82129e
fix go vet errors
Signed-off-by: Jess Frazelle <jessfraz@google.com>

fix composites

Signed-off-by: Jess Frazelle <me@jessfraz.com>
2016-08-10 16:45:41 -07:00
Kubernetes Submit Queue 48b7aca2c9 Merge pull request #29672 from lixiaobing10051267/masterLen
Automatic merge from submit-queue

Add handling empty index key that may cause panic issue

if len(indexKeys) == 0, "return indexKeys[0]" will cause unexpected result.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.kubernetes.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.kubernetes.io/reviews/kubernetes/kubernetes/29672)
<!-- Reviewable:end -->
2016-08-10 14:29:45 -07:00
Chao Xu 41572cb22d add metrics to gc 2016-08-10 12:45:06 -07:00
Davanum Srinivas b15219034d Prevent panic in 'kubectl exec' when redirecting stdout
Just add some nil checks to make sure we don't trip over when
we redirect output from exec to a file.

Fixes #30290
2016-08-09 14:52:55 -04:00
Kubernetes Submit Queue f218aa4b10 Merge pull request #30236 from mikedanese/csr-approval
Automatic merge from submit-queue

csr: add approval to the typed client

ref #30163

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.kubernetes.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.kubernetes.io/reviews/kubernetes/kubernetes/30236)
<!-- Reviewable:end -->
2016-08-08 22:54:19 -07:00
Chao Xu 4d2350632c only store typeMeta and objectMeta in the gc store 2016-08-08 17:23:13 -07:00
Mike Danese c131fbaf17 csr: add approval to the typed client 2016-08-08 16:05:05 -07:00
Chao Xu 58b6dee275 install authorization group in 1.4 client 2016-08-06 11:21:41 -07:00
Kubernetes Submit Queue 9083ee971e Merge pull request #29137 from janetkuo/scheduledjob-controller
Automatic merge from submit-queue

Scheduledjob controller

Supersedes #25952; first 7 commits come from #25816

<!--
Checklist for submitting a Pull Request

Please remove this comment block before submitting.

1. Please read our [contributor guidelines](https://github.com/kubernetes/kubernetes/blob/master/CONTRIBUTING.md).
2. See our [developer guide](https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md).
3. If you want this PR to automatically close an issue when it is merged,
   add `fixes #<issue number>` or `fixes #<issue number>, fixes #<issue number>`
   to close multiple issues (see: https://github.com/blog/1506-closing-issues-via-pull-requests).
4. Follow the instructions for [labeling and writing a release note for this PR](https://github.com/kubernetes/kubernetes/blob/master/docs/devel/pull-requests.md#release-notes) in the block below.
-->

```release-note
```
2016-08-05 18:07:48 -07:00
Kubernetes Submit Queue 2537f66f0e Merge pull request #29230 from luxas/goimport
Automatic merge from submit-queue

Run goimport for the whole repo

While removing GOMAXPROC and running goimports, I noticed quite a lot of other files also needed a goimport format. Didn't commit `*.generated.go`, `*.deepcopy.go` or files in `vendor`

This is more for testing if it builds.
The only strange thing here is the gopkg.in/gcfg.v1 => github.com/scalingdata/gcfg replace.
cc @jfrazelle @thockin
2016-08-05 16:22:01 -07:00
Janet Kuo da57c93a8a Fix errors, verification and test failures; add unit test for sj UpdateStatus 2016-08-05 13:35:39 -07:00
Eric Tune 8675e014fb ScheduledJob controller 2016-08-05 13:34:50 -07:00