Commit Graph

956 Commits

Author SHA1 Message Date
Dr. Stefan Schimanski
0cfc379ff8 apimachinery: mechanical removal of ObjectCopier plumbing
Kubernetes-commit: 509df603b18d356777176953e5d160b6f3d0bba9
2017-10-06 13:30:12 +02:00
John Kelly
ddf6c35ca5 client-go: use retry util in CRUD example
This updates the create-update-delete-deployment example with the following:
Make use of client-go retry util in Update() steps instead of simple for loops.
Using RetryOnConflict is generally better practice as it won't become stuck in a retry loop and uses exponential backoff to prevent exhausting the apiserver.
Instead of changing annotations to demonstrate Updates/Rollbacks, change the container image as it is less confusing for readers and a better real-world example.
Improve comments and README to reflect above changes.

Signed-off-by: John Kelly <jekohk@gmail.com>

Kubernetes-commit: 94f5bcf6f77d5b35074dfab47b5de37096d8ee00
2017-10-05 19:07:57 -04:00
Clayton Coleman
f7a735a8c2 Have the certificate manager decide if the server is healthy
Prevent a Kubelet from shutting down when the server isn't responding to
us but we cannot get a new certificate. This allows a cluster to coast
if the master is unresponsive or a node is partitioned and their client
cert expires.

Kubernetes-commit: b3a11aa635022761637090f4fc8d5cb57f3f0010
2017-10-05 18:57:53 -04:00
Clayton Coleman
8c1471aeda cache.ListWatchUntil should return err.ErrWaitTimeout
Clients shouldn't have to know about watch.ErrWatchClosed, which is
typically a server side decision to close and always means "Timeout" in
this conetxt.

Kubernetes-commit: cbecf177274e6f6924d6ca756eccf0a55e2933c0
2017-10-05 18:51:57 -04:00
Solly Ross
4e3b79aa59 [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).

Kubernetes-commit: eac2049fc9a151a7cbd6652e039506376574e0a9
2017-10-04 18:42:54 -04:00
John Kelly
4e80b27156 client-go: Update CRUD example
This updates the create-update-delete-deployment example with the following:
Add rollback step to demonstrate rolling back deployments with client-go.
Modify the for-loops used in both Update steps to Get() the latest version
of the Deployment from the server before attempting Update().
This is necessary because the object returned by Create() does
not have the new resourceVersion, causing the initial Update() to always fail
due to conflicting resource versions. Putting the Get() at the top of the
loop seems to fix this bug.
Make -kubeconfig flag optional if config is in default location, using the
same method found in the out-of-cluster example.

Patch is motivated by effort to improve client-go examples.

Signed-off-by: John Kelly <jekohk@gmail.com>

Kubernetes-commit: ce73088a718c30d8a3577f5d0521584b9c201e69
2017-10-04 18:01:49 -04:00
Clayton Coleman
bb96050dfb Collapse duplicate code into pkg/util/csr
There is no reason to duplicate this code into two places.

Kubernetes-commit: c3bea24ab6242b084e7d09073c8906c778611243
2017-10-01 16:10:51 -04:00
Mikhail Mazurskiy
f660c1f78a Panic on failure to calculate index key
Kubernetes-commit: 65369a68a1f6ff01d8d108ccd8424f92013ae876
2017-09-30 14:52:15 +10:00
Janet Kuo
6dbd395521 Autogen
Kubernetes-commit: fd48a4a8959c272099aa3818ad94f25f39cfe43e
2017-09-29 14:43:47 -07:00
Antoine Pelisse
5e3eb38791 kubectl: Remove swagger 1.2 entirely.
Kubernetes-commit: d1ce36371e637f159256f1f43e3590926ff906d5
2017-09-28 15:58:53 -07:00
Kubernetes Publisher
e1ccf9f319 Merge pull request #53177 from alrs/fix-client-go-record-swallowed-errors
Automatic merge from submit-queue (batch tested with PRs 49249, 53203, 53209, 53208, 53177). 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>.

vendor/k8s.io/client-go/tools/record: Fix two swallowed errors in tests

**What this PR does / why we need it**: Fixes two dropped errors in client-go.

```release-note NONE
```

Kubernetes-commit: f369c1af596ecd8b5b54916a0cbbface8f422121
2017-09-28 14:02:23 -07:00
Kubernetes Publisher
643c2cc9a6 Merge pull request #53001 from ericchiang/oidc-refresh-token-error-message
Automatic merge from submit-queue (batch tested with PRs 51759, 53001, 52806). 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>..

oidc client auth: better error when refresh response is missing id_token

/kind cleanup
@kubernetes/sig-auth-pr-reviews

Updates https://github.com/kubernetes/kubernetes/issues/36847

```release-notes
NONE
```

Kubernetes-commit: 08a465bd7d16a28dfd5ccedfdb95fabcb5380135
2017-10-16 06:28:21 +00:00
Kubernetes Publisher
350fc9ed99 Merge pull request #51759 from wackxu/addtestcase
Automatic merge from submit-queue (batch tested with PRs 51759, 53001, 52806). 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 verify case in index_test.go

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

There only verify the length of the result in the index_test and we should  also verify the content of the result.

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

Kubernetes-commit: c3b443b41c56de0ea012726a581b917e1665416d
2017-10-16 06:28:21 +00:00
Kubernetes Publisher
fab36f2095 Merge pull request #52835 from FengyunPan/Versionless-Endpoint
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 gophercloud to Handle New Identity Endpoints

Currently openstack cloud provider just support keystone v2.0 and v3
The latest Identity Service is publishing an ID of v3.8, we should
update gophercloud to recognize v3.8 as a valid version id.

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

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

Kubernetes-commit: 4f2d7b93da2464a3147e0a7e71d896dd2bade9ad
2017-10-16 06:28:20 +00:00
Kubernetes Publisher
b6540d4794 Merge pull request #52873 from ixdy/bazel-cleanup
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>..

bazel: build/test almost everything

**What this PR does / why we need it**: Miscellaneous cleanups and bug fixes. The main motivating idea here was to make `bazel build //...` and `bazel test //...` mostly work. (There's a few reasons these still don't work, but we're a lot closer.)

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```

/assign @BenTheElder @mikedanese @spxtr

Kubernetes-commit: 7c9e614cbb507b094d82301c5ea4d26f075eed82
2017-10-16 06:27:52 +00:00
Kubernetes Publisher
282f9313c2 Merge pull request #52443 from spxtr/racercar
Automatic merge from submit-queue (batch tested with PRs 52485, 52443, 52597, 52450, 51971). 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>..

Enable go race detection for bazel tests.

Testing if setting `features = ["-race"]` fixes the breaks in #50792.

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

Kubernetes-commit: e371f8ab1dd5f0e8d7703ff76e7e2499c5f4aef8
2017-10-16 06:27:52 +00:00
Kubernetes Publisher
7dbd7b4f83 Merge pull request #51542 from sttts/sttts-deepcopy-client-go
Automatic merge from submit-queue (batch tested with PRs 51929, 52015, 51906, 52069, 51542). 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>..

client-go: simplify deepcopy calls

Kubernetes-commit: a3cc5dc3841b9f3f55f04e017fba8269ae6b7141
2017-10-16 06:27:51 +00:00
Kubernetes Publisher
7be903ab67 Merge pull request #52778 from zouyee/mis
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 comment code mistake

**What this PR does / why we need it**:
update comment code mistake

Kubernetes-commit: 798e5805d7ede74492097dec62d94d2b1fa67363
2017-10-16 06:27:51 +00:00
Dr. Stefan Schimanski
e58a2c7896 Update generated files
Kubernetes-commit: 60a0eb260cc0c780b3dd2ff9e092db0519f6a6cf
2017-09-28 13:56:56 +02:00
Lars Lehtonen
f6d2dca1b0 vendor/k8s.io/client-go/tools/record: Fix two swallowed errors in tests
Kubernetes-commit: b64a0a8f5aad2403a55fb3ec035c35702b0b9ab9
2017-09-27 19:43:11 -07:00
Mikhail Mazurskiy
00c624b92c Ring buffer for notifications
Results from BenchmarkListener:
Current code:
1000000	      1540 ns/op	     109 B/op	       1 allocs/op

New:
1000000	      1139 ns/op	      16 B/op	       1 allocs/op

Kubernetes-commit: 1940f5a5d2acce377ab16b5561f3d9002fb2a319
2017-09-26 21:58:48 +10:00
Eric Chiang
0b1f8b0d85 oidc client auth: better error when refresh response is missing id_token
Kubernetes-commit: a8914b73a12583c29bdee333528a55a5b3e5db1f
2017-09-25 09:57:16 -07:00
Clayton Coleman
f49c543e2a Enable API chunking and promote to beta for 1.9
All list watchers default to using chunking.

Kubernetes-commit: 113889e72da573946f3389b628251647c2a858b9
2017-09-23 15:21:54 -04:00
Kubernetes Publisher
82aa063804 Merge pull request #52710 from sttts/sttts-less-aggressive-staging-godep-mangling
Automatic merge from submit-queue (batch tested with PRs 52843, 52710, 52821, 52844). 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-staging-godeps: only mangle staging repos in staging Godeps.json

- this re-adds non-staging k8s.io/* repos to the staging Godeps.jsons
- x-outs instead of removing of staging dependencies in order to get a
  precise trigger for a complete godep restore+save run in the publisher
  bot.

The first breaks k8s.io/kube-aggregator's staging export.

The second potentially leads to inconsistent godeps in our exported staging repos.

Kubernetes-commit: 3ba46ee9fab32ccaeeee4af4a80375e6e1d71ace
2017-09-22 11:22:43 +00:00
Kubernetes Publisher
8ffd241e20 Update staging godeps
Kubernetes-commit: 678eeb54da07fb33e3860bc670e6b101a966a47d
2017-09-22 11:22:08 +00:00
Jeff Grafton
8741eb9107 Use buildozer to delete licenses() rules
Kubernetes-commit: 02fb4200dcdf8636eac5953d04b2c4af912f443b
2017-09-21 14:54:29 -07:00
Jeff Grafton
54288be59c Use buildozer to remove deprecated automanaged tags
Kubernetes-commit: 532bd482dfbe25c6fc970d2175f7e02fec2fc8c0
2017-09-21 14:53:56 -07:00
FengyunPan
9678eb0473 Update gophercloud to Handle New Identity Endpoints
Currently openstack cloud provider just support keystone v2.0 and v3
The latest Identity Service is publishing an ID of v3.8, we should
update gophercloud to recognize v3.8 as a valid version id.

Kubernetes-commit: f98326b7f9364f6a5c3e336af1279833713e73c9
2017-09-21 18:58:13 +08:00
zouyee
1d75f4f0f1 update comment code mistake
Kubernetes-commit: 58687b891fc8ae2fd226ffd67f8e1c2e06db1a1b
2017-09-20 17:50:17 +08:00
Nikhita Raghunath
9138498d7b bump(github.com/go-openapi/spec): 7abd5745472fff5eb3685386d5fb8bf38683154d
Kubernetes-commit: 9968c18a6cf11e3c4461e1d6bc9ab4de5625c202
2017-09-19 11:25:48 +05:30
Kubernetes Publisher
48c8058911 Merge pull request #50476 from caesarxuchao/plumb-proxy
Automatic merge from submit-queue (batch tested with PRs 51824, 50476, 52451, 52009, 52237)

Plumbing the proxy dialer to the webhook admission plugin

* Fixing https://github.com/kubernetes/kubernetes/issues/49987. Plumb the `Dial` function to the `transport.Config`
* Fixing https://github.com/kubernetes/kubernetes/issues/52366. Let the webhook admission plugin sets the `TLSConfg.ServerName`.

I tested it in my gke setup. I don't have time to implement an e2e test before 1.8 release. I think it's ok to add the test later, because *i)* the change only affects the alpha webhook admission feature, and *ii)* the webhook feature is unusable without the fix. That said, it's up to my reviewer to decide.

Filed https://github.com/kubernetes/kubernetes/issues/52368 for the missing e2e test.

( The second commit is https://github.com/kubernetes/kubernetes/pull/52372, which is just a cleanup of client configuration in e2e tests. It removed a function that marshalled the client config to json and then unmarshalled it. It is a prerequisite of this PR, because this PR added the `Dial` function to the config which is not json marshallable.)

```release-note
Fixed the webhook admission plugin so that it works even if the apiserver and the nodes are in two networks (e.g., in GKE).
Fixed the webhook admission plugin so that webhook author could use the DNS name of the service as the CommonName when generating the server cert for the webhook.

Action required:
Anyone who generated server cert for admission webhooks need to regenerate the cert. Previously, when generating server cert for the admission webhook, the CN value doesn't matter. Now you must set it to the DNS name of the webhook service, i.e., `<service.Name>.<service.Namespace>.svc`.
```

Kubernetes-commit: 7181dd49460787871b602a47ab2ad05babacb820
2017-09-15 01:08:01 -07:00
Kubernetes Publisher
0fd8a31bad Merge pull request #50012 from deads2k/cli-17-discovery
Automatic merge from submit-queue

use specified discovery information if possible

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

This uses the available discovery information if available, but it seems we never updated "normal" resources to show the singular name, so its often not available.  I've left this code compatible.

@enisoc @ash2k
@kubernetes/sig-api-machinery-misc

```release-note
custom resources that use unconventional pluralization now work properly with kubectl and garbage collection
```

Kubernetes-commit: e190f391129260527c119fe319216212c916ae5d
2017-09-22 11:22:07 +00:00
Kubernetes Publisher
bae75f0568 fix the webhook unit test; the server cert needs to have a valid CN;
fix a fuzzer;

Kubernetes-commit: 856a1db57a05e19ea6261e38211d2ab1bf864dd1
2017-09-22 11:22:07 +00:00
Kubernetes Publisher
06d5d62599 Merge pull request #52227 from liggitt/non-preferred-version-priority
Automatic merge from submit-queue (batch tested with PRs 52227, 52120)

Fix discovery restmapper finding resources in non-preferred versions

Fixes: #52219

Also reverts behavioral changes to tests that version-qualified cronjobs to work around this issue.

The discovery rest mapper was only populating the priority rest mapper's search list with preferred groupversions.

That meant that if a resource existed in multiple non-preferred versions, AND did not exist in the preferred version (like cronjob, which only exists in v1beta2.batch and v2alpha1.batch, but not v1.batch), the priority restmapper would not find it in its group/version priority list, and would return an error.

```release-note
Fixed an issue looking up cronjobs when they existed in more than one API version
```

Kubernetes-commit: 77e660ed15e927e4e901f42bb3f6790775f8107d
2017-09-22 11:22:07 +00:00
Kubernetes Publisher
cecfce38a7 use specified discovery information if possible
Kubernetes-commit: 1c8a9e406054e4163b8c81176f14478272ebf767
2017-09-22 11:22:07 +00:00
Kubernetes Publisher
baf97d23c3 plumb the proxyTransport to the webhook admission plugin;
set the ServerName in the config for webhook admission plugin.

Kubernetes-commit: 186a0684d582272aa2fbfec390aea5fbb88a8bc6
2017-09-22 11:22:07 +00:00
Kubernetes Publisher
7a2d69e09e Fix discovery restmapper finding resources in non-preferred versions
Kubernetes-commit: a6316fb3a525a6a88ca74cfa76c2892455fcf832
2017-09-22 11:22:06 +00:00
Antoine Pelisse
90239c1304 client-go: Truncate body based on Verbosity level
Kubernetes-commit: b4304f8e79f8227fc7841ecc7cb80b94cbbd493d
2017-09-14 17:09:07 -07:00
Joe Finney
88ea2eef1a Enable go race detection for bazel tests.
There are a couple tests that need to run without race detection
enabled. See issue 39649 for details.

Kubernetes-commit: d4676b67539419aced720772b13f556de8065fc1
2017-09-13 13:41:58 -07:00
gmarek
a51b7225e6 Add new Events API group
Kubernetes-commit: 69e2a9cb48fd49cf1449042984ea9c25edc0598c
2017-09-13 16:46:26 +02:00
Kubernetes Publisher
c6f8cf2c47 sync: update godeps 2017-09-09 21:30:45 +00:00
Kubernetes Publisher
fa6f560e89 Merge pull request #51876 from smarterclayton/disable_client_paging
Automatic merge from submit-queue (batch tested with PRs 48552, 51876)

Disable default paging in list watches

For 1.8 this will be off by default. In 1.9 it will be on by default.
Add tests and rename some fields to use the `chunking` terminology.

Note that the pager may be used for other things besides chunking.

Follow on to #48921, we left the field on to get some exercise in the normal code paths, but needs to be disabled for 1.8.

@liggitt let's merge on wednesday.

Kubernetes-commit: eda3db550bd72499d735938a1911f9f7e88870f8
2017-09-09 21:30:07 +00:00
Clayton Coleman
f549520368 Disable default paging in list watches
For 1.8 this will be off by default. In 1.9 it will be on by default.
Add tests and rename some fields to use the `chunking` terminology.

Note that the pager may be used for other things besides chunking.

Kubernetes-commit: 8b571bb63bd8a9a6a37db6046a6ab35d3b047bf4
2017-09-09 21:30:07 +00:00
Kubernetes Publisher
4e283c96d6 Merge pull request #50708 from DirectXMan12/versions/autoscaling-v2beta1
Automatic merge from submit-queue (batch tested with PRs 51956, 50708)

Move autoscaling/v2 from alpha1 to beta1

This graduates autoscaling/v2alpha1 to autoscaling/v2beta1.  The move is more-or-less just a straightforward rename.

Part of kubernetes/features#117

```release-note
v2 of the autoscaling API group, including improvements to the HorizontalPodAutoscaler, has moved from alpha1 to beta1.
```

Kubernetes-commit: 3168bd4b123629d7d33ee976437175d8cde5f0cc
2017-09-09 21:30:06 +00:00
Solly Ross
561701ed84 Move Autoscaling v2{alpha1 --> beta1}
This commit renames autoscaling/v2alpha1 to autoscaling/v2beta1.
Only the API-related code is moved in this commit.

Kubernetes-commit: b0af4024753bd0eac43a57282b3f6414488db299
2017-09-09 21:30:06 +00:00
Kubernetes Publisher
bf0966b346 Merge pull request #51795 from dims/bug-fix-51755
Automatic merge from submit-queue (batch tested with PRs 51984, 51351, 51873, 51795, 51634)

Bug Fix - Adding an allowed address pair wipes port security groups

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

Fix for cloud routes enabled instances will have their security groups
removed when the allowed address pair is added to the instance's port.

Upstream bug report is in:
https://github.com/gophercloud/gophercloud/issues/509

Upstream bug fix is in:
https://github.com/gophercloud/gophercloud/pull/510

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

Fixes #51755

**Special notes for your reviewer**:

Just an fix in vendored code. minimal changes needed in OpenStack cloud provider

**Release note**:

```release-note
NONE
```

Kubernetes-commit: 9a8cb435b77085fa7d518c4428a02eae316b1003
2017-09-06 13:50:12 +00:00
Kubernetes Publisher
aa671fcc5b Merge pull request #51751 from dashpole/update_cadvisor_godep
Automatic merge from submit-queue (batch tested with PRs 51186, 50350, 51751, 51645, 51837)

Update Cadvisor Dependency

Fixes: https://github.com/kubernetes/kubernetes/issues/51832
This is the worst dependency update ever...
The root of the problem is the [name change of Sirupsen -> sirupsen](https://github.com/sirupsen/logrus/issues/570#issuecomment-313933276).  This means that in order to update cadvisor, which venders the lowercase, we need to update all dependencies to use the lower-cased version.  With that being said, this PR updates the following packages:

`github.com/docker/docker`
- `github.com/docker/distribution`
  - `github.com/opencontainers/go-digest`
  - `github.com/opencontainers/image-spec`
  - `github.com/opencontainers/runtime-spec`
  - `github.com/opencontainers/selinux`
  - `github.com/opencontainers/runc`
    - `github.com/mrunalp/fileutils`
  - `golang.org/x/crypto`
    - `golang.org/x/sys`
- `github.com/docker/go-connections`
- `github.com/docker/go-units`
- `github.com/docker/libnetwork`
- `github.com/docker/libtrust`
- `github.com/sirupsen/logrus`
- `github.com/vishvananda/netlink`

`github.com/google/cadvisor`
- `github.com/euank/go-kmsg-parser`

`github.com/json-iterator/go`

Fixed https://github.com/kubernetes/kubernetes/issues/51832

```release-note
Fix journalctl leak on kubelet restart
Fix container memory rss
Add hugepages monitoring support
Fix incorrect CPU usage metrics with 4.7 kernel
Add tmpfs monitoring support
```

Kubernetes-commit: 99aa992ce845fe947a406ac4d3f99d2208f0416b
2017-09-06 13:49:43 +00:00
Davanum Srinivas
d26bea504f Bug Fix - Adding an allowed address pair wipes port security groups
Fix for cloud routes enabled instances will have their security groups
removed when the allowed address pair is added to the instance's port.

Upstream bug report is in:
https://github.com/gophercloud/gophercloud/issues/509

Upstream bug fix is in:
https://github.com/gophercloud/gophercloud/pull/510

Kubernetes-commit: 74a3d89ad4ff1508a16bacb0c333a1f795c31470
2017-09-06 13:49:43 +00:00
Kubernetes Publisher
4bea3a5096 sync: reset Godeps/Godeps.json 2017-09-06 13:49:43 +00:00
David Ashpole
8e9c6b2322 update cadvisor, docker, and runc godeps
Kubernetes-commit: e5a6a79fd75372fcc7fa32ccf8d80ed9e0335b17
2017-09-06 13:49:15 +00:00