Commit Graph

4306 Commits (1c012f1c4966dfe6124192abafeba892ae9510a0)

Author SHA1 Message Date
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
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
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
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
Dr. Stefan Schimanski f8de7cea40 Update generated files 2018-06-29 20:36:17 +02:00
Dr. Stefan Schimanski 4e44170d72 bump(github.com/kubernetes/gengo): 5b57d243f2ca39dbbda758ee07b76b4d519f6dc7 2018-06-29 20:30:36 +02:00
jennybuckley c60fe4fb76 Propagate forceAllowCreate as false to all subresources 2018-06-29 11:28:19 -07:00
Kubernetes Submit Queue cf14f027c5
Merge pull request #65609 from CaoShuFeng/sample-controller
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 sample-controller README

The guide in doc causes an error
```
$ go run *.go -kubeconfig=$HOME/.kube/config
go run: cannot run *_test.go files (controller_test.go)
```



**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-06-29 07:22:27 -07:00
wojtekt 3d9552cc38 Fix apiserver metrics 2018-06-29 14:15:53 +02:00
Cao Shufeng 9bb3bf2e78 fix sample-controller README
The guide in doc causes an error
```
$ go run *.go -kubeconfig=$HOME/.kube/config
go run: cannot run *_test.go files (controller_test.go)
```
2018-06-29 11:45:19 +08:00
jennybuckley d10e08fc89 Allow override AllowCreateOnUpdate with new argument to Update 2018-06-28 14:24:51 -07:00
Hemant Kumar 063eee7a39 Fix comments about default mount propagation
Fix generated docs as well
2018-06-28 17:04:41 -04:00
Lubomir I. Ivanov ac5f5b4099 apiserver: do not print feature gates for glog v=0
Demand verbosity level > 0 for glog Infof() calls when
setting feature gates in pkg/util/feature_gate.go.
2018-06-28 17:10:51 +03:00