Commit Graph

2834 Commits (6b2f3c81e28373a8906bb821e8866c43779cd784)

Author SHA1 Message Date
Kubernetes Submit Queue f75f49e7a0 Merge pull request #49915 from caesarxuchao/controller-ignore-initialize-timeout
Automatic merge from submit-queue (batch tested with PRs 49855, 49915)

Let controllers ignore initialization timeout when creating pods

Partially address https://github.com/kubernetes/kubernetes/issues/48893#issuecomment-318540129.

This only updates the controllers that create pods with `GenerateName`.

The controllers ignore the timeout error when creating the pods, depending on how the initialization progress:
* If the initialization is successful in less than 5 mins, the controller will observe the creation via the informer. All is good.
* If the initialization fails, server will delete the pod, but the controller won't receive any event. The controller will not create new pod until the Creation expectation expires in 5 min.
* If the initialization takes too long (> 5 mins), the Creation expectation expires and the controller will create extra pods.

I'll send follow-up PRs to fix the latter two cases, e.g., by refactoring the sharedInformer.
2017-08-05 19:07:53 -07:00
Malepati Bala Siva Sai Akhil 83603f0358 Fix typo in comment
Fix typo in comment in garbagecollector
2017-08-05 22:47:48 +05:30
Kubernetes Submit Queue 0b9aa05633 Merge pull request #48141 from ankon/patch-2
Automatic merge from submit-queue

Fix typo

**What this PR does / why we need it**: Fix trivial typo in comment.
2017-08-05 06:12:57 -07:00
Kubernetes Submit Queue ec424949c9 Merge pull request #49860 from zhangxiaoyu-zidif/fix-error-print-for-cronjob-utils-test
Automatic merge from submit-queue (batch tested with PRs 47416, 47408, 49697, 49860, 50162)

fix error message for cronjob

**What this PR does / why we need it**:
fix error message for cronjob
expected an error would be better than unexpected lack of error.
ref: https://github.com/kubernetes/kubernetes/blob/master/cmd/genutils/genutils_test.go#L33

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-08-05 03:22:59 -07:00
Kubernetes Submit Queue 704cc7f9f6 Merge pull request #50070 from dixudx/remove_013_to_avoid_bad_words
Automatic merge from submit-queue (batch tested with PRs 46685, 49863, 50098, 50070, 50096)

Remove 0,1,3 from rand.String to avoid 'bad words'

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

Remove 0,1,3 from the runes to prevent accidental bad words profanity

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

**Special notes for your reviewer**:
/cc @mml  @jamesawebb1  @spiffxp 

**Release note**:

```release-note
Remove 0,1,3 from rand.String, to avoid 'bad words'
```
2017-08-04 00:20:57 -07:00
Kubernetes Submit Queue 063fc6a73a Merge pull request #43586 from rpothier/cidr_set_ipv6
Automatic merge from submit-queue (batch tested with PRs 50103, 49677, 49449, 43586, 48969)

Adding IPv6 to cidr_set and cidr_set_test

**What this PR does / why we need it**:
This allows IPv6 in cidr_set

Currently cidr_set only supports IPv4. This adds IPv6 compatibility and adds
IPv6 unit tests.

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

**Special notes for your reviewer**:
The IPv6 code here makes some assumptions.
The subnets should be at least /64. (maximum 64 bits of prefix)
The subnet mask size cannot be greater than 30 more than the cluster mask size.

**Release note**:

```release-note
```
2017-08-03 16:43:39 -07:00
Kubernetes Submit Queue 40d66b8e05 Merge pull request #49677 from dims/send-missing-uid-field-during-webhook-authorize
Automatic merge from submit-queue (batch tested with PRs 50103, 49677, 49449, 43586, 48969)

Add missing UID in SubjectAccessReviewSpec

**What this PR does / why we need it**:
WebhookAuthorizer's Authorize should send *all* the information
present in the user.Info data structure. We are not sending the
UID currently.


**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
The SubjectAccessReview API in the authorization.k8s.io API group now allows providing the user uid.
```
2017-08-03 16:43:34 -07:00
Chao Xu 97e07e5b52 Let controllers ignore initialization timeout error when creating a pod. 2017-08-03 15:28:08 -07:00
Robert Pothier 5e96523913 Adding IPv6 to cidr_set and cidr_set_test 2017-08-03 13:06:49 -04:00
Di Xu 9ed4395d3c Remove 0,1,3 from rand.String, to avoid 'bad words' 2017-08-03 15:52:33 +08:00
Klaus Ma c8ecd92269 Moved node condition check into Predicats. 2017-08-03 15:39:11 +08:00
Kubernetes Submit Queue cba21511bd Merge pull request #49980 from caesarxuchao/gc-minor
Automatic merge from submit-queue (batch tested with PRs 49237, 49656, 49980, 49841, 49899)

GC shouldn't send empty patch

The scope of the `if` statement was wrong, causing GC to sometimes send empty patch.

Found this bug while investigating https://github.com/kubernetes/kubernetes/issues/49966.
2017-08-02 19:11:13 -07:00
Kubernetes Submit Queue 84e0326eb1 Merge pull request #49782 from supereagle/update-generated-deepcopy
Automatic merge from submit-queue (batch tested with PRs 50029, 48517, 49739, 49866, 49782)

Update generated deepcopy code

**What this PR does / why we need it**:
In generated deepcopy code, the method names in comments do not match the real method names.

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

**Special notes for your reviewer**:
/assign @sttts @caesarxuchao 


**Release note**:
```release-note
NONE
```
2017-08-02 12:46:57 -07:00
Davanum Srinivas 9a761b16c1 Add missing UID in SubjectAccessReviewSpec
WebhookAuthorizer's Authorize should send *all* the information
present in the user.Info data structure. We are not sending the
UID currently.
2017-08-02 10:49:02 -04:00
dhilipkumars a1ba598130 Have a uniform format for filenames across controllers 2017-08-02 09:50:05 +05:30
Kubernetes Submit Queue 455d85a984 Merge pull request #49870 from k82cn/nc_rename_zone_tainer
Automatic merge from submit-queue (batch tested with PRs 49870, 49416, 49872, 49892, 49908)

Renamed zoneNotReadyOrUnreachableTainer to zoneNoExecuteTainer.

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

**Release note**:

```release-note
None
```
2017-08-01 19:52:57 -07:00
Kubernetes Submit Queue 23bb765498 Merge pull request #49491 from eparis/make-plus-append-is-bad
Automatic merge from submit-queue (batch tested with PRs 49898, 49897, 49919, 48860, 49491)

Fix usage a make(struct, len()) followed by append()

A couple of places in the code we allocate with make() but then use
append(), instead of copy() or direct assignment. This results in a
slice with len() zero elements at the front followed by the expected
data. The correct form for such usage is `make(struct, 0, len())`.

I found these by running:
```
$ git grep -EI -A7 'make\([^,]*, len\(' | grep 'append(' -B7 | grep -v vendor
```
And then manually looking through the results. I'm sure something better
could exist.

**Release note**:
```release-note
NONE
```
2017-08-01 17:57:20 -07:00
Kenneth Owens 5941f7b69f Merge pull request #49016 from jsafrane/pv-controller-no-resync
PV controller: resync informers manually
merging to unblock the submit queue
2017-08-01 16:39:40 -07:00
Chao Xu 3060e925f5 GC shouldn't send empty patch 2017-08-01 13:06:36 -07:00
Kubernetes Submit Queue 665db3b245 Merge pull request #49821 from MrHohn/routecontroller-error-event
Automatic merge from submit-queue (batch tested with PRs 46519, 49794, 49720, 49692, 49821)

[route_controller] Emit event when failed to create route

**What this PR does / why we need it**:
When route controller failed to create route for nodes, pod's networking is likely broken. We surface this situation through node condition (https://github.com/kubernetes/kubernetes/blob/v1.7.2/pkg/controller/route/routecontroller.go#L197-L231), but this might not be easily tracked when user have a large cluster with many nodes. Surface the error through event might make things more obvious.

**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**:
cc @bowei 

**Release note**:

```release-note
NONE
```
2017-08-01 03:04:49 -07:00
Kubernetes Submit Queue 897ad3585a Merge pull request #49794 from gnufied/log-pod-skip-event-with-higher-priority
Automatic merge from submit-queue (batch tested with PRs 46519, 49794, 49720, 49692, 49821)

Log attach detach controller skipping pods at higher priority

This will help us in tracking down problems related to pods
not getting added to desired state of world because of events
arriving out of order or some other problem related to that.

cc @kubernetes/sig-storage-pr-reviews
2017-08-01 03:04:41 -07:00
Eric Paris 5e22e149c5 Fix usage a make(struct, len()) followed by append()
A couple of places in the code we allocate with make() but then use
append(), instead of copy() or direct assignment. This results in a
slice with len() zero elements at the front followed by the expected
data. The correct form for such usage is `make(struct, 0, len())`.

I found these by running:
```
$ git grep -EI -A7 'make\([^,]*, len\(' | grep 'append(' -B7 | grep -v vendor
```
And then manually looking through the results. I'm sure something better
could exist.
2017-07-31 14:43:29 -04:00
supereagle a1c880ece3 update generated deepcopy code 2017-07-31 22:33:00 +08:00
Klaus Ma e89e01d063 Renamed doTaintingPass to doNoExecuteTaintingPass. 2017-07-31 19:47:57 +08:00
Klaus Ma 678947d431 Renamed zoneNotReadyOrUnreachableTainer to zoneNoExecuteTainer. 2017-07-31 19:39:34 +08:00
zhangxiaoyu-zidif 9ada6b37c5 fix error message for cronjob 2017-07-31 14:42:04 +08:00
Zihong Zheng 28d2e67ff7 Emit event when failed to create route 2017-07-28 15:39:47 -07:00
Hemant Kumar f4e792ed42 Log attach detach controller skipping pods at higher priority
This will help us in tracking down problems related to pods
not getting added to desired state of world because of events
arriving out of order or some other problem related to that.
2017-07-28 13:23:28 -04:00
Dan Mace d08dfb92c7 Enable garbage collection of custom resources
Enhance the garbage collector to periodically refresh the resources it
monitors (via discovery) to enable custom resource definition GC.

This implementation caches Unstructured structs for any kinds not
covered by a shared informer. The existing meta-only codec only supports
compiled types; an improved codec which supports arbitrary types could
be introduced to optimize caching to store only metadata for all
non-informer types.
2017-07-28 10:00:10 -04:00
Kubernetes Submit Queue 07d7ac78a3 Merge pull request #49619 from jianglingxia/jlx72616
Automatic merge from submit-queue (batch tested with PRs 49619, 49598, 47267, 49597, 49638)

replicaset fix typo

**What this PR does / why we need it**:
reopen #47821
**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**:
@NickrenREN 
**Release note**:

```release-note
   NONE
```
2017-07-28 05:08:01 -07:00
Kubernetes Submit Queue 803cb9303b Merge pull request #49495 from deads2k/controller-12-toleration
Automatic merge from submit-queue (batch tested with PRs 49665, 49689, 49495, 49146, 48934)

make it possible to allow discovery errors for controllers

Update the discovery client to return partial discovery information *and* an error.  Since we can aggregate API servers, discovery of some resources can fail independently.  Callers of this function who want to tolerate the errors can, existing callers will still get an error and fail in normal blocks.

@kubernetes/sig-api-machinery-misc @sttts
2017-07-27 21:45:34 -07:00
deads2k b7286f3188 make it possible to allow discovery errors for controllers 2017-07-26 16:09:30 -04:00
Kubernetes Submit Queue 89525c62fd Merge pull request #49516 from caesarxuchao/parallel-patch
Automatic merge from submit-queue (batch tested with PRs 48360, 48469, 49576, 49516, 49558)

Let garbage collector send orphaning patches in parallel

Garbage collector sends orphaning patches in parallel now.
2017-07-26 13:02:43 -07:00
FengyunPan e4cb9a0824 Fix registered ownerName in prometheus
TokensController and ServiceAccountsController use same name to
register metric ownerName in prometheus.
2017-07-26 21:25:52 +08:00
jianglingxia 2eab9cfb68 replicaset fix typo 2017-07-26 17:00:28 +08:00
Kubernetes Submit Queue 9350afd772 Merge pull request #48976 from supereagle/cleanup-api-package
Automatic merge from submit-queue (batch tested with PRs 48976, 49474, 40050, 49426, 49430)

Remove duplicated import and wrong alias name of api package

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

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

**Special notes for your reviewer**:
/assign @caesarxuchao

**Release note**:
```release-note
NONE
```
2017-07-25 12:14:38 -07:00
Kubernetes Submit Queue 393b1228c9 Merge pull request #45431 from DirectXMan12/feature/fake-dynamic-client
Automatic merge from submit-queue (batch tested with PRs 48224, 45431, 45946, 48775, 49396)

[client-go] Fake Dynamic Client

This commit converts `"k8s.io/client-go/dynamic".Client` to an interface, and implements fake versions of both `ClientPool` and `Client`.  This allows components which make uses of these clients to be tested in the same way that clientset-based components can be tested, using the standard `testing.Fake` machinery.

**Release note**:
```release-note
NONE
```
2017-07-25 11:06:49 -07:00
Kubernetes Submit Queue 9c3d0e8a96 Merge pull request #48224 from deads2k/controller-11-reflectormetrics
Automatic merge from submit-queue (batch tested with PRs 48224, 45431, 45946, 48775, 49396)

add reflector metrics

This adds metrics (optionally prometheus) to reflectors so that you can see when one reflector is behaving poorly and just how poorly its doing.

@eparis 

```release-note
Adds metrics for checking reflector health.
```
2017-07-25 11:06:47 -07:00
deads2k 151d39682e add reflector metrics 2017-07-25 09:01:37 -04:00
Kubernetes Submit Queue 144a4c2b74 Merge pull request #49358 from jianglingxia/jlx72113
Automatic merge from submit-queue

[trival] fix typo

**What this PR does / why we need it**:
some file word spell error that amend correct
**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
2017-07-24 21:26:54 -07:00
supereagle adc0eef43e remove duplicated import and wrong alias name of api package 2017-07-25 10:04:25 +08:00
Chao Xu 5e7d7c00a2 let garbage collector send orphaning patches in parallel 2017-07-24 13:56:39 -07:00
Anthony Yeh 283211c1cf
StatefulSet: Remove `pod.alpha.kubernetes.io/initialized` annotation. 2017-07-24 10:18:47 -07:00
Kubernetes Submit Queue 1bcb381169 Merge pull request #49355 from dhilipkumars/UTDeployment
Automatic merge from submit-queue

deployment: SetNewReplicaSetAnnotations() should compare revisions as numbers than strings

**What this PR does / why we need it**: 
1) SetNewReplicaSetAnnotations() when deployment revision annotation is copied over to RS, it performs a string comparison instead of int comparison, due to this any revision beyond 9 might not get copied.
2) Slightly improves the coverage by adding UT for Annotation related functions
3) Upgrade the test suite to use go-langs sub-test, which is very useful while investigating UT related failures.

```
--- FAIL: TestAnnotationUtils (0.00s)
    --- FAIL: TestAnnotationUtils/SetNewReplicaSetAnnotations (0.00s)
        deployment_util_test.go:1283: Revision Expected=10 Obtained=9
        deployment_util_test.go:1283: Revision Expected=11 Obtained=9
        deployment_util_test.go:1283: Revision Expected=12 Obtained=9
        deployment_util_test.go:1283: Revision Expected=13 Obtained=9
        deployment_util_test.go:1283: Revision Expected=14 Obtained=9
        deployment_util_test.go:1283: Revision Expected=15 Obtained=9
        deployment_util_test.go:1283: Revision Expected=16 Obtained=9
        deployment_util_test.go:1283: Revision Expected=17 Obtained=9
        deployment_util_test.go:1283: Revision Expected=18 Obtained=9
        deployment_util_test.go:1283: Revision Expected=19 Obtained=9
        deployment_util_test.go:1283: Revision Expected=20 Obtained=9
    --- PASS: TestAnnotationUtils/SetReplicasAnnotations (0.00s)
    --- PASS: TestAnnotationUtils/IsSaturated (0.00s)
```

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

**Special notes for your reviewer**:

**Release note**: None

```release-note
```
cc: @kargakis
2017-07-22 10:56:55 -07:00
Kubernetes Submit Queue c1c7193b4d Merge pull request #46514 from ravisantoshgudimetla/scheduler_taints_refactor
Automatic merge from submit-queue (batch tested with PRs 49420, 49296, 49299, 49371, 46514)

Refactoring taint functions to reduce sprawl

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

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

**Special notes for your reviewer**:
@gmarek @timothysc @k82cn @jayunit100 - I moved some fn's to helpers and some to utils. LMK, if you are ok with this change.

**Release note**:

```release-note
NONE
```
2017-07-21 22:23:24 -07:00
Solly Ross f78d61e7c2 [client-go] Add dynamic.Interface
This adds an interface form of dynamic.Client and
dynamic.ResourceClient, making those two follow the general client
conventions: `Interface` is an interface, and `Client` is the concrete
implementation.  `ClientPool` retains it's interface status.

This allows us to create a fake implemenation of dyanmic.Interface,
dynamic.ResourceInterface, and dynamic.ClientPool for testing.
2017-07-21 14:24:06 -04:00
Kubernetes Submit Queue 29cc1aab05 Merge pull request #49285 from mfojtik/fix-statefull-mutation
Automatic merge from submit-queue (batch tested with PRs 49328, 49285, 49307, 49127, 49163)

fix mutation in statefulset sync

Original issue: https://github.com/openshift/origin/issues/15324

Seems like something inside `UpdateStatefulSet` mutates the StatefulSet. We might need to dig deeper to find the exact location where the non-copy mutation happens.
2017-07-21 03:00:16 -07:00
jianglingxia 88828cc777 [trival] fix typo 2017-07-21 16:38:08 +08:00
dhilipkumars 4967bb7342 Review Comments 2017-07-21 13:42:13 +05:30
dhilipkumars 10af4fa9db Add UT and upgrade this test suite with go sub-test 2017-07-21 10:43:48 +05:30