Commit Graph

4419 Commits (2eb1083b9bcfbd118118f361169b327913d0d128)

Author SHA1 Message Date
David Eads 60afd0ba81 fix dynamic client listing bug 2018-07-17 08:39:57 -04:00
Mikhail Mazurskiy 5cab7f9a57
Handle errors 2018-07-17 20:47:14 +10:00
Kubernetes Submit Queue 849603d5b5
Merge pull request #66263 from hzxuzhonghu/patch-misc
Automatic merge from submit-queue (batch tested with PRs 66212, 66256, 66263, 66193). 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 useless codec param from strategicPatchObject

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

`codec` param is not used, and was introduced in 2016.

**Release note**:

```release-note
NONE
```
2018-07-17 03:33:13 -07:00
Kubernetes Submit Queue bfba154715
Merge pull request #66256 from sigma/patch-2
Automatic merge from submit-queue (batch tested with PRs 66212, 66256, 66263, 66193). 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: fix error message spelling in rest config

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

Fixing spelling because it offends the eye.

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

**Special notes for your reviewer**:

**Release note**:
```release-note
NONE
```
2018-07-17 03:33:07 -07:00
xuzhonghu 43baa697aa remove useless codec param from strategicPatchObject 2018-07-17 11:33:53 +08:00
Yann Hodique f0ca5c1376
client-go: fix error message spelling in rest config 2018-07-16 16:00:03 -07:00
Yann Hodique f77060aa8d
client-go: update documentation for remotecommand.StreamOptions
The ability to explicitly define the supported protocols was removed in commit 12c7874c0d
Adjust documentation accordingly.
2018-07-16 14:43:54 -07:00
Jake Sanders f35e3d07c9 Escape illegal characters in remote extra keys
Signed-off-by: Jake Sanders <jsand@google.com>
2018-07-16 11:44:27 -07:00
Kubernetes Submit Queue b9bd7f2ffb
Merge pull request #66210 from foxyriver/delete-unused-var
Automatic merge from submit-queue (batch tested with PRs 66158, 66041, 66210). 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>.

splitRE is defined, but is never be referenced

**Which issue(s) this PR fixes** 

splitRE is defined, but is never be referenced

```release-note
NONE
```
2018-07-16 09:14:10 -07:00
Kubernetes Submit Queue 43b801d499
Merge pull request #66041 from liggitt/manual-registries
Automatic merge from submit-queue (batch tested with PRs 66158, 66041, 66210). 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 manually written typed registries

These were only used in a handful of places, and were not consistently available for all types.

They add a lot of call sites for PRs like https://github.com/kubernetes/kubernetes/pull/65105 and are not generally useful (very few callers have the ability to construct the underlying store).

This PR switches the scale subresources to use the underlying store directly (like the status subresources already were), and removes the manually written Registry impls.

/sig api-machinery
/kind cleanup
/assign @deads2k

/hold
will hold for https://github.com/kubernetes/kubernetes/pull/65105 and rebase after that

```release-note
NONE
```
2018-07-16 09:14:06 -07:00
Kubernetes Submit Queue 4239729fc1
Merge pull request #66028 from sttts/sttts-crd-array-columns
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>.

apiextensions-apiserver: add test for non-base type columns

Non-basic types can be converted to strings in CRD table columns. This PR adds a test.
2018-07-16 00:00:57 -07:00
Kubernetes Submit Queue 04f5200295
Merge pull request #66054 from nikhita/apiserver-readme-update-2018
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>.

apiserver/README: update to 2018 for compatibility

/shrug
/assign sttts 

**Release note**:

```release-note
NONE
```
2018-07-14 01:45:53 -07:00
foxyriver dabcec0e38 splitRE is never be referenced 2018-07-14 15:56:16 +08:00
Kubernetes Submit Queue 614e3adda0
Merge pull request #65737 from roycaihw/api-linter
Automatic merge from submit-queue (batch tested with PRs 64181, 65737). 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>.

API linter framework and namesMatch API rule

**What this PR does / why we need it**:
Bump kube-openapi dependency to use the [API linter framework](https://github.com/kubernetes/kube-openapi/pull/83) in k/k OpenAPI spec generation procedure. 

Currently one API rule is enforced: 
"Go field names must be CamelCase. JSON field names must be camelCase. Other than capitalization of the initial letter, the two should almost always match. No underscores nor dashes in either."

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

**Special notes for your reviewer**:
Most code change in this PR was generated (~1700 lines). Please see commits for detail.

**Release note**:

```release-note
NONE
```

/sig api-machinery
/cc @pwittrock @mbohlool
2018-07-13 18:00:00 -07:00
Kubernetes Submit Queue 60ca804515
Merge pull request #65832 from sttts/sttts-apiserver-reusable-loopback-logic
Automatic merge from submit-queue (batch tested with PRs 65832, 66160, 66145). 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>.

apiserver: make loopback logic in SecureServingOptions reusable

For reuse in other components this PR separates the loopback logic from the GenericApiServer config.
2018-07-13 13:22:04 -07:00
Jordan Liggitt 652e2dc025
generated 2018-07-13 11:41:09 -04:00
Jordan Liggitt 617078d220
Remove hand-written typed registries 2018-07-13 11:40:52 -04:00
Jordan Liggitt 3cb771a866
Use storage directly for scale subresources 2018-07-13 11:40:52 -04:00
Dr. Stefan Schimanski 7090cd3c5f apiextensions-apiserver: add test for non-base type columns 2018-07-13 13:17:20 +02:00
Dr. Stefan Schimanski dc0a736d1e apiserver: make loopback logic in SecureServingOptions reusable 2018-07-13 13:04:57 +02:00
Dr. Stefan Schimanski 0dda53526a apiextensions-apiserver: use self-signed cert fixtures in testserver 2018-07-13 09:49:54 +02:00
Dr. Stefan Schimanski c1c564fd4d apiserver: add SecureServingOptions.ExternalAddress
Before this the advertised IP (which shows up in the server cert) in case of
listening to loopback was the first host interface IP. This makes self-signed
certs non-constant, such that we cannot use fixtures.
2018-07-13 09:49:54 +02:00
Dr. Stefan Schimanski 7deccb5b7a apiserver: use fixtures for self-signed certs in test server 2018-07-13 09:49:54 +02:00
Kubernetes Submit Queue fe8846196d
Merge pull request #65105 from apelisse/dry-run
Automatic merge from submit-queue (batch tested with PRs 65105, 62948). 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>.

dry-run: Create Options with dryRun for POST/PUT/PATCH

**What this PR does / why we need it**:
Create new options for Create and Update (through POST/PUT/PATCH).

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-07-12 13:53:05 -07:00
Antoine Pelisse 4bfd5ec41f dry-run: Run generate commands for new Options types 2018-07-12 07:31:45 -07:00
Antoine Pelisse 03b1e14101 dry-run: Create new options for Update/Create and pass it along 2018-07-12 07:18:37 -07:00
Nikhita Raghunath 40985c3abb
apiserver/README: update to 2018 for compatibility 2018-07-12 18:33:33 +05:30
Kubernetes Submit Queue 337dfe0a9c
Merge pull request #65594 from liggitt/node-csr-addresses-2
Automatic merge from submit-queue (batch tested with PRs 65052, 65594). 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>.

Derive kubelet serving certificate CSR template from node status addresses

xref https://github.com/kubernetes/features/issues/267
fixes #55633

Builds on https://github.com/kubernetes/kubernetes/pull/65587

* Makes the cloud provider authoritative when recording node status addresses
* Makes the node status addresses authoritative for the kube-apiserver determining how to speak to a kubelet (stops paying attention to the hostname label when determining how to reach a kubelet, which was only done to support kubelets < 1.5)
* Updates kubelet certificate rotation to be driven from node status
  * Avoids needing to compute node addresses a second time, and differently, in order to request serving certificates.
  * Allows the kubelet to react to changes in its status addresses by updating its serving certificate
  * Allows the kubelet to be driven by external cloud providers recording node addresses on the node status

test procedure:
```sh
# setup
export FEATURE_GATES=RotateKubeletServerCertificate=true
export KUBELET_FLAGS="--rotate-server-certificates=true --cloud-provider=external"

# cleanup from previous runs
sudo rm -fr /var/lib/kubelet/pki/

# startup
hack/local-up-cluster.sh

# wait for a node to register, verify it didn't set addresses
kubectl get nodes 
kubectl get node/127.0.0.1 -o jsonpath={.status.addresses}

# verify the kubelet server isn't available, and that it didn't populate a serving certificate
curl --cacert _output/certs/server-ca.crt -v https://localhost:10250/pods
ls -la /var/lib/kubelet/pki

# set an address on the node
curl -X PATCH http://localhost:8080/api/v1/nodes/127.0.0.1/status \
  -H "Content-Type: application/merge-patch+json" \
  --data '{"status":{"addresses":[{"type":"Hostname","address":"localhost"}]}}'

# verify a csr was submitted with the right SAN, and approve it
kubectl describe csr
kubectl certificate approve csr-...

# verify the kubelet connection uses a cert that is properly signed and valid for the specified hostname, but NOT the IP
curl --cacert _output/certs/server-ca.crt -v https://localhost:10250/pods
curl --cacert _output/certs/server-ca.crt -v https://127.0.0.1:10250/pods
ls -la /var/lib/kubelet/pki

# set an hostname and IP address on the node
curl -X PATCH http://localhost:8080/api/v1/nodes/127.0.0.1/status \
  -H "Content-Type: application/merge-patch+json" \
  --data '{"status":{"addresses":[{"type":"Hostname","address":"localhost"},{"type":"InternalIP","address":"127.0.0.1"}]}}'

# verify a csr was submitted with the right SAN, and approve it
kubectl describe csr
kubectl certificate approve csr-...

# verify the kubelet connection uses a cert that is properly signed and valid for the specified hostname AND IP
curl --cacert _output/certs/server-ca.crt -v https://localhost:10250/pods
curl --cacert _output/certs/server-ca.crt -v https://127.0.0.1:10250/pods
ls -la /var/lib/kubelet/pki
```

```release-note
* kubelets that specify `--cloud-provider` now only report addresses in Node status as determined by the cloud provider
* kubelet serving certificate rotation now reacts to changes in reported node addresses, and will request certificates for addresses set by an external cloud provider
```
2018-07-11 22:25:07 -07:00
Haowei Cai b4b84e023b Add Accepted to delete response path 2018-07-11 14:56:22 -07:00
Kubernetes Submit Queue 0972ce1acc
Merge pull request #65649 from rsc/fix-printf
Automatic merge from submit-queue (batch tested with PRs 66076, 65792, 65649). 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>.

kubernetes: fix printf format errors

These are all flagged by Go 1.11's
more accurate printf checking in go vet,
which runs as part of go test.

```release-note
NONE
```
2018-07-11 14:09:08 -07:00
Kubernetes Submit Queue 5170348431
Merge pull request #65792 from mbohlool/cleanup_c1
Automatic merge from submit-queue (batch tested with PRs 66076, 65792, 65649). 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 DefaultingSerializer as it is not being used

Keeping unused code around is confusing at least. The Serializer is not used as far as I can tell. If any external project is using it, they should just copy it in their code.
2018-07-11 14:09:04 -07:00
Kubernetes Submit Queue 3a3d6564b6
Merge pull request #66047 from krunaljain/bugfix/csi_default_fs_type
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>.

Fixing comments in types.go to describe the changes for CSI driver default FS type override fix

This PR fixes the comment in types.go which was made in the commit 5dfe7b5758 
In the above commit,  the change that fixed the override of default FSType for CSI driver was made. However the comments in types.go were made for   GCEPersistentDiskVolumeSource and RBDVolumeSource respectively. This commit fixes that comment to reflect the changes for CSI driver

```release-note
none
```
2018-07-10 18:45:32 -07:00
Haowei Cai 3cd919c9fb generated 2018-07-10 17:53:09 -07:00
Kubernetes Submit Queue ff9a66bd17
Merge pull request #66008 from smarterclayton/serving_test
Automatic merge from submit-queue (batch tested with PRs 66038, 65992, 66008). 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>.

Convert TestServerRunWithSNI to subtests to isolate flake

This test is flaking - make it easier to pin down where and why by
converting to subtests and making cleanup logic simpler. Also turn an
ignored listen error into a "fatal".

Make the test run in parallel to speed up individual runs and hopefully
flush out issues.

Noticed and reported in OpenShift, https://github.com/openshift/origin/issues/20220

@deads2k / @sttts
2018-07-10 17:02:07 -07:00
Krunal Jain bab7781a71 Adding generated files 2018-07-10 15:52:23 -07:00
Krunal Jain 14c7ce92b3 Fixing comments in types.go 2018-07-10 15:39:16 -07:00
Russ Cox 2bd91dda64 kubernetes: fix printf format errors
These are all flagged by Go 1.11's
more accurate printf checking in go vet,
which runs as part of go test.

Lubomir I. Ivanov <neolit123@gmail.com>
applied ammend for:
  pkg/cloudprovider/provivers/vsphere/nodemanager.go
2018-07-11 00:10:15 +03:00
Kubernetes Submit Queue 4b4408c339
Merge pull request #66033 from liggitt/x509-cleanup
Automatic merge from submit-queue (batch tested with PRs 65931, 65705, 66033). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Remove unused x509 code

We don't intend to use/support these user extraction methods

```release-note
NONE
```
2018-07-10 14:09:12 -07:00
Clayton Coleman 09463975c3
Convert TestServerRunWithSNI to subtests to isolate flake
This test is flaking - make it easier to pin down where and why by
converting to subtests and making cleanup logic easier. Also turn an
ignored listen error into a "fatal".

Make the test run in parallel to speed up individual runs and hopefully
flush out issues.
2018-07-10 16:07:33 -04:00
Jordan Liggitt db9d3c2d10
Derive kubelet serving certificate CSR template from node status addresses 2018-07-10 14:33:48 -04:00
Jordan Liggitt 82f603c327
Remove unused x509 code 2018-07-10 13:22:24 -04:00
Kubernetes Submit Queue 3b269e182d
Merge pull request #65499 from krunaljain/bugfix/csi_default_fs_type
Automatic merge from submit-queue (batch tested with PRs 55023, 65499). 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>.

Bugfix/csi default fs type

This PR address the issue mentioned in the following ticket https://github.com/kubernetes/kubernetes/issues/65122 
The FSType string will now not be defaulted to ext4. Removes defaulting of CSI file system type to ext4. CSI plugins that depended on this default need to be updated as the fsType would remain an empty string if not provided and would not default to ext4. CSI spec allows for an empty fstype string. This is intended for non-block plugins like nfs and gluster where filesystems are not separately created on the volume. But currently the default file system is overridden to ext4  which makes the above case redundant. This commit prevents such an overridding. 


```release-note  
ACTION REQUIRED: Removes defaulting of CSI file system type to ext4. All the production drivers listed under https://kubernetes-csi.github.io/docs/Drivers.html were tested and work as expected after this change. If you are using a driver not in that list, please test the drivers on an updated test cluster first. ```
2018-07-10 10:18:08 -07:00
yue9944882 ccb1ec7a36 fixes operation for "create on update"
remove create-on-update logic for quota controller

review: add more error check

remove unused args

revert changes in patch.go

use hasUID to judge if it's a create-on-update
2018-07-10 17:22:09 +08:00
Kubernetes Submit Queue 4d609cea7f
Merge pull request #65780 from liggitt/AddFieldLabelConversionFuncGVK
Automatic merge from submit-queue (batch tested with PRs 65830, 65780, 65961). 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>.

change field selector conversion registration to be strongly typed

the signature of these methods is misleading... they require a group-version-kind

```release-note
NONE
```
2018-07-09 09:35:06 -07:00
Kubernetes Submit Queue f6bbf1f6f8
Merge pull request #65830 from sttts/sttts-apiserver-readwrite-port
Automatic merge from submit-queue (batch tested with PRs 65830, 65780, 65961). 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>.

apiserver: get rid of ReadWritePort in config

Executing removal TODO by making the read write port logic explicit, and not hidden deep in the secure serving code.

Preparation for https://github.com/kubernetes/kubernetes/pull/65832
2018-07-09 09:35:02 -07:00
Kubernetes Submit Queue 0e7376d9cb
Merge pull request #64664 from atlassian/error-handling-generated-client
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>.

Handle errors in generated client scheme

**What this PR does / why we need it**:
Adds missing error handling for schema construction code in generated clientsets.

**Which issue(s) this PR fixes**
Together with #64654 fixes #51457.

**Release note**:

```release-note
NONE
```
/kind bug
/sig api-machinery
2018-07-09 07:40:05 -07:00
Dr. Stefan Schimanski 6bb3aba23d kube-apiserver: fix tests which don't use tls yet 2018-07-09 15:01:18 +02:00
Dr. Stefan Schimanski e15ac9eb72 kube-apiserver: disallow --secure-port 0 2018-07-09 14:03:08 +02:00
Dr. Stefan Schimanski e32f380fa5 apiserver: get rid of ReadWritePort in config 2018-07-09 14:03:08 +02:00
Kubernetes Submit Queue 40806a2660
Merge pull request #65823 from loburm/fix_truncate
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 truncating and batch backends integration.

Truncating backend was not starting batch thread that is responsible for reading events from the channel.

Fixes https://github.com/kubernetes/kubernetes/pull/65819

```release-note
None
```
2018-07-09 04:28:58 -07:00
Marian Lobur 20fb0b5eb1 Fix truncating and buffering backends integration. 2018-07-09 10:25:41 +02:00
David Eads 79d04f6709 generated 2018-07-06 14:08:14 -04:00
David Eads 340802b079 name runtime.Schemes so we can see which one fails 2018-07-06 14:08:14 -04:00
David Eads d3731fe098 move CRD server unstructured typer to point of use 2018-07-06 14:08:14 -04:00
Kubernetes Submit Queue c7d4931dad
Merge pull request #65710 from sttts/sttts-unified-apiserver-testserver
Automatic merge from submit-queue (batch tested with PRs 64911, 65710). 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>.

apiextensions-apiserver: add pkg/cmd/server/testing pkg for integration tests

In analogy to kube-apiserver, this implements a uniform apiextensions-apiserver for integration tests which can be started using customized flags.
2018-07-05 11:39:03 -07:00
Kubernetes Submit Queue abf59aa8c4
Merge pull request #65834 from sttts/sttts-apiserver-no-secure-port-panic
Automatic merge from submit-queue (batch tested with PRs 65822, 65834, 65859, 65631). 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>.

apiserver: don't create self-signed certs with disabled secure serving
2018-07-05 10:16:06 -07:00
Kubernetes Submit Queue 403e22d10f
Merge pull request #65811 from nikhita/client-go-discovery-godoc
Automatic merge from submit-queue (batch tested with PRs 65805, 65811, 65833, 65488, 65857). 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/discovery: fix godoc package comment

Fixes https://github.com/kubernetes/client-go/issues/436

/sig api-machinery
/kind cleanup
/shrug

/assign sttts 

**Release note**:

```release-note
NONE
```
2018-07-05 08:51:12 -07:00
Kubernetes Submit Queue 7597e952d1
Merge pull request #65805 from CaoShuFeng/retry
Automatic merge from submit-queue (batch tested with PRs 65805, 65811, 65833, 65488, 65857). 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 string

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

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-07-05 08:51:09 -07:00
Dr. Stefan Schimanski 42f1e81488 apiextensions-apiserver: add pkg/cmd/server/testing pkg for integration bootstrapping
In analogy to kube-apiserver.
2018-07-05 17:34:16 +02:00
Dr. Stefan Schimanski 798535164a apiserver: don't create self-signed certs with disabled secure serving 2018-07-05 09:27:42 +02:00
Cao Shufeng 199a6eba88 fix print format string 2018-07-05 09:44:50 +08:00
Kubernetes Submit Queue 97a4da713b
Merge pull request #65752 from hzxuzhonghu/req-ua
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>.

make use of request.UserAgent()

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

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

**Special notes for your reviewer**:
/assign @sttts
**Release note**:

```release-note
NONE
```
2018-07-04 13:36:42 -07:00
Kubernetes Submit Queue 692f9bb7b1
Merge pull request #65531 from qjiang77/fix_typos
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 typos for TestBackoffHighWaterMark

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

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

**Special notes for your reviewer**:

**Release note**:

```release-note

```
2018-07-04 07:33:37 -07:00
Nikhita Raghunath 5539fefd08
client-go/discovery: fix godoc package comment 2018-07-04 16:39:07 +05:30
Jordan Liggitt b7b4b84afe
Add healthz check to ensure logging is not blocked 2018-07-03 22:27:23 -04:00
Mehdy Bohlool d0e1118929 Remove DefaultingSerializer as it is not being used 2018-07-03 16:37:31 -07:00
Kubernetes Submit Queue 0e6d3f2abe
Merge pull request #65150 from jennybuckley/create-on-update-authorizer
Automatic merge from submit-queue (batch tested with PRs 65677, 65711, 65150, 65726). 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 additional authorization check for create-on-update

**What this PR does / why we need it**:
Currently it is possible for a user who is only authorized to update objects to send a PUT request for an object that doesn't currently exist, and if that resource allows create on update, it will all them to create the object. This PR fixes that bug and adds a test case which fails on master, but succeeds when the additional authorization check is done.

/sig api-machinery
/kind bug
/cc @liggitt @lavalamp 

**Release note**:
```release-note
LimitRange and Endpoints resources can be created via an update API call if the object does not already exist. When this occurs, an authorization check is now made to ensure the user making the API call is authorized to create the object. In previous releases, only an update authorization check was performed.
```
2018-07-03 16:35:11 -07:00
Kubernetes Submit Queue 6311a1e56f
Merge pull request #65538 from apelisse/add-mengqi-approver-strategicpatch
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 Mengqi to the list of approvers for strategicpatch

cc @mengqiy 
/assign @pwittrock 

Replaces #65535

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

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-07-03 14:47:27 -07:00
Jordan Liggitt f51ba20cdd
change field selector conversion registration to be strongly typed 2018-07-03 15:47:20 -04:00
jennybuckley cc5c17e554 Add additional authorization check for create-on-update 2018-07-03 11:20:16 -07:00
Kubernetes Submit Queue da64942ec2
Merge pull request #65357 from nikhita/crd-subresources-root-schema
Automatic merge from submit-queue (batch tested with PRs 65357, 65568). 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>.

Allow more fields at root of CRD schema if status is enabled

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

Currently, we allow only `properties`, `required` and `description` at the root of the CRD schema when the status subresource is enabled.

We can also include some other fields, even though sometimes they might not make sense (but they don't harm).

The main idea is that when validation schema for status is extracted as `properties["status"]`, validation for status is not lost.

**Release note**:

```release-note
More fields are allowed at the root of the CRD validation schema when the status subresource is enabled.
```
2018-07-03 03:24:00 -07:00
Mikhail Mazurskiy 0c737adf06
Run update-bazel 2018-07-03 19:28:51 +10:00
Mikhail Mazurskiy b9a94a8df4
Run code gen 2018-07-03 19:28:26 +10:00
Mikhail Mazurskiy 5cb6db95b5
Handle errors in generated client scheme 2018-07-03 19:11:48 +10:00
Kubernetes Submit Queue 036434583f
Merge pull request #65729 from cfork/comments
Automatic merge from submit-queue (batch tested with PRs 64599, 65729). 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>.

apimachinery: cleanup code and comments

fix golint issues

/kind cleanup

```release-note
NONE
```
2018-07-03 02:00:08 -07:00
Kubernetes Submit Queue 70e6fd2953
Merge pull request #64599 from hzxuzhonghu/fix-import
Automatic merge from submit-queue (batch tested with PRs 64599, 65729). 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 go import

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

Fix go import introduced by #63777.

cc @lavalamp 

/assign @sttts 

**Release note**:

```release-note
NONE
```
2018-07-03 02:00:04 -07:00
xuzhonghu 82003bd9ac use request.UserAgent() 2018-07-03 16:56:15 +08:00
Kubernetes Submit Queue b770083da5
Merge pull request #65040 from CaoShuFeng/and_if
Automatic merge from submit-queue (batch tested with PRs 65040, 65731). 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>.

[trivial] fix option help message.

s/andif/and if/



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

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-07-02 23:24:02 -07:00
Kubernetes Submit Queue fc081b5941
Merge pull request #65667 from hzxuzhonghu/patch-3
Automatic merge from submit-queue (batch tested with PRs 65648, 65700, 64976, 65692, 65667). 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>.

leader election: fix dead loop bug

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

bug fix: leader election calling apiserver without time interval. It is a dead loop.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-07-02 19:46:23 -07:00
Kubernetes Submit Queue 7dcac9d2a5
Merge pull request #65648 from sttts/sttts-k8s-metrics-codegen
Automatic merge from submit-queue (batch tested with PRs 65648, 65700, 64976, 65692, 65667). 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>.

k8s.io/metrics: normalize and fix codegen script

~~Builds on https://github.com/kubernetes/kubernetes/pull/65645. Will rebase when that one merges.~~ merged
2018-07-02 19:46:09 -07:00
Kubernetes Submit Queue 74b764224a
Merge pull request #63522 from atlassian/remove-json-int
Automatic merge from submit-queue (batch tested with PRs 65094, 65533, 63522, 65694, 65702). 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 int support from json patches

**What this PR does / why we need it**:
JSON only contains `int64` and `float64` types for numbers so `int` is not needed.

**Special notes for your reviewer**:
This is a follow up for https://github.com/kubernetes/kubernetes/pull/62981.

**Release note**:
```release-note
NONE
```
/sig api-machinery
/kind cleanup
/cc liggitt sttts
2018-07-02 18:19:12 -07:00
Kubernetes Submit Queue 47020f3318
Merge pull request #65094 from hzxuzhonghu/le-client-timeout
Automatic merge from submit-queue (batch tested with PRs 65094, 65533, 63522, 65694, 65702). 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>.

set leader election client and renew timeout

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

set leader-election client timeout

set timeout for tryAcquireOrRenew

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-07-02 18:19:05 -07:00
Cong Ding 2082c71abe apimachinery: runtime: cleanup comments 2018-07-02 17:30:19 -07:00
Cong Ding 10698f8774 apimachinery: cleanup if...else statement
if block ends with a return statement, so drop this else and outdent its block
2018-07-02 17:29:56 -07:00
Cong Ding 3cd867fa6b apimachinery: runtime: cleanup code
1. variable type can be inferred from right-hand side
2. receiver names should be consistent with previous receiver names
2018-07-02 17:29:30 -07:00
Kubernetes Submit Queue dcf296a97a
Merge pull request #65154 from jennybuckley/add-update-options-3
Automatic merge from submit-queue (batch tested with PRs 65299, 65524, 65154, 65329, 65536). 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>.

Allow override of AllowCreateOnUpdate with new argument to Update

**What this PR does / why we need it**:
Changes the Update function signature to include a new bool which tells storage to override what the UpdateStrategy returns for AllowCreateOnUpdate. This is not exposed to the user, the handler is the one that sets this override value. Eventually the patch handler will set this to true, in order to provide more consistent apply behavior, without changing the existing PUT behavior.

Redo of https://github.com/kubernetes/kubernetes/pull/65075 but on master to reduce number of conflicts when we merge feature-serverside-apply with master.

/sig api-machinery
/cc @apelisse @lavalamp 

**Release note**:
```release-note
NONE
```
No release note because this is just an internal change
2018-07-02 11:06:15 -07:00
Kubernetes Submit Queue 7786bd8c9a
Merge pull request #64654 from atlassian/missing-error-handling
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 missing error handling in schema-related code

**What this PR does / why we need it**:
Adds missing error handling to a few places.

**Which issue(s) this PR fixes**
Updates #51457. Still more work to do to fix the issue - client generation code needs to be updated (addressed in https://github.com/kubernetes/kubernetes/pull/64664).

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

/kind bug
/sig api-machinery
2018-07-02 07:14:34 -07:00
Kubernetes Submit Queue 1570d3851c
Merge pull request #64741 from wgliang/master.etcd-prometheus-metics
Automatic merge from submit-queue (batch tested with PRs 64741, 65484). 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 etcdv3 client prometheus metics

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

Provide a way to enable etcdv3 client prometheus metics

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

**Special notes for your reviewer**:

**Release note**:

```release-note
Enable etcdv3 client prometheus metics
```
2018-07-02 03:54:59 -07:00
Dr. Stefan Schimanski f6c3e5e823 Update generated files 2018-07-02 10:44:18 +02:00
Dr. Stefan Schimanski 87efe61bbf bump(github.com/kubernetes/gengo): ecfcee3e19c8f1ac0e50e9b9c307626f343ce15f 2018-07-02 10:44:18 +02:00
Dr. Stefan Schimanski 57036f90aa k8s.io/metrics: normalize client dir 2018-07-02 10:44:18 +02:00
Dr. Stefan Schimanski c080d2d009 k8s.io/metrics: use standard code-gen scripts 2018-07-02 10:44:18 +02:00
xuzhonghu 7a2c579409 bug fix: dead loop leaderelection 2018-07-02 15:49:39 +08:00
Zhonghu Xu 1c5a0218ed
simplify httplog.LogOf 2018-07-02 11:47:42 +08:00
Kubernetes Submit Queue a9be647e65
Merge pull request #65645 from sttts/sttts-gengo-import-aliases
Automatic merge from submit-queue (batch tested with PRs 65582, 65480, 65310, 65644, 65645). 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>.

Bump gengo to remove _ from generated import aliases

Pickup https://github.com/kubernetes/gengo/pull/113 and https://github.com/kubernetes/gengo/pull/111.

Avoid tons of golint exceptions for https://github.com/kubernetes/kubernetes/pull/64664.
2018-06-29 20:14:19 -07:00
xuzhonghu 90b287c12d leaderelection: set timeout for tryAcquireOrRenew 2018-06-30 10:38:53 +08:00
Kubernetes Submit Queue 16dbb95c51
Merge pull request #65390 from cfork/test
Automatic merge from submit-queue (batch tested with PRs 65518, 65624, 65380, 65390, 65586). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

cleanup: remove deadcode

/kind cleanup

remove deadcode
remove unnecessary conversion

```release-note
NONE
```
2018-06-29 18:30:16 -07:00
Kubernetes Submit Queue 3e8faa22b0
Merge pull request #65518 from hzxuzhonghu/api-verbs
Automatic merge from submit-queue (batch tested with PRs 65518, 65624, 65380, 65390, 65586). 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>.

transform ConnectMethods to kube verbs

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

/api/v1 does not list any verb for "pods/attach" and "pods/exec", this pr transform the ConnectMethods to kube verbs.

Fixes #65421

**Special notes for your reviewer**:

before this: 
```
   {
      "name": "nodes/proxy",
      "verbs": []
    },
    {
      "name": "pods/attach",
      "verbs": []
    },
    {
      "name": "pods/exec",
      "verbs": []
    },
    {
      "name": "pods/portforward",
      "verbs": []
    },
    {
      "name": "pods/proxy",
      "verbs": []
    },
    {
      "name": "services/proxy",
      "verbs": []
    },
```

after this:
```
    {
      "name": "nodes/proxy",
      "verbs": [
        "create",
        "delete",
        "get",
        "patch",
        "update"
      ]
    },
    {
      "name": "pods/attach",
      "verbs": [
        "create",
        "get"
      ]
    },
    {
      "name": "pods/exec",
      "verbs": [
        "create",
        "get"
      ]
    },
    {
      "name": "pods/portforward",
      "verbs": [
        "create",
        "get"
      ]
    },
    {
      "name": "pods/proxy",
      "verbs": [
        "create",
        "delete",
        "get",
        "patch",
        "update"
      ]
    },
    {
      "name": "services/proxy",
      "verbs": [
        "create",
        "delete",
        "get",
        "patch",
        "update"
      ]
    },
```
/assign @liggitt 

**Release note**:

```release-note
NONE
```
2018-06-29 18:30:06 -07:00
Kubernetes Submit Queue 4f465fac5b
Merge pull request #65634 from wojtek-t/fix_code_content_type
Automatic merge from submit-queue (batch tested with PRs 65319, 64513, 65474, 65601, 65634). 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 apiserver metrics
2018-06-29 12:15:19 -07:00
Kubernetes Submit Queue 7b46e884ae
Merge pull request #64513 from fisherxu/useSameRv
Automatic merge from submit-queue (batch tested with PRs 65319, 64513, 65474, 65601, 65634). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Use same rvParse in watchcache and move cacheStorage in separate dir

**What this PR does / why we need it**:
Use same rvParse in watchcache and move cacheStorage in separate dir.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-06-29 12:15:09 -07:00