Commit Graph

43 Commits (33ebe1f18b9cf5909931376f656e19e80ac9ac1c)

Author SHA1 Message Date
Mike Danese 3b6a067afc autogenerated 2016-10-21 17:32:32 -07:00
m1093782566 fd47b6d4d1 change petset replicas type from int to int32
Change-Id: I0b8c30083e4a221421de46d9d4dcb21b1f5bb36f
2016-10-08 17:13:20 +08:00
Kubernetes Submit Queue f79a53a734 Merge pull request #31777 from dshulyak/evict_pet
Automatic merge from submit-queue

Delete evicted pet

If pet was evicted by kubelet - it will stuck in this state forever.
By analogy to regular pod we need to re-create pet so that it will
be re-scheduled to another node, so in order to re-create pet
and preserve consitent naming we will delete it in petset controller
and create after that.

fixes: https://github.com/kubernetes/kubernetes/issues/31098
2016-10-04 01:32:02 -07:00
Maciej Kwiek caf2411f88 PetSet replica count status test 2016-09-29 10:07:14 +02:00
Kubernetes Submit Queue 43758c8f17 Merge pull request #32117 from nebril/petset-count
Automatic merge from submit-queue

PetSet returns valid replica count in status

**What this PR does / why we need it**: It prevents the PetSet replica count to be invalid regardless of pods not being created due to 

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

**Special notes for your reviewer**:

**Release note**:
```release-note
```
2016-09-28 02:24:18 -07:00
Maciej Kwiek 0bec588202 PetSet returns valid replica count in status
If the first pod is not healthy and next pods are not yet created, do
not provide the status with incorrect replica count
2016-09-27 10:58:26 +02:00
Kubernetes Submit Queue 6c1c0b9842 Merge pull request #32027 from m1093782566/m109-petset-fix-test-err
Automatic merge from submit-queue

[BUG FIX] Fix bug of UT in Pet Set

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

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

Fix bug of UT in Pet Set.

[1] https://github.com/kubernetes/kubernetes/blob/master/pkg/controller/petset/pet_set_test.go#L74-L75, 

I think` len(pl)` is not equal to `len(fc.pets)`, see [here](https://github.com/kubernetes/kubernetes/blob/master/pkg/controller/petset/fakes.go#L229-L233)

[2] https://github.com/kubernetes/kubernetes/blob/master/pkg/controller/petset/fakes.go#L249

I think should change to 

```
if len(f.pets) <= index {
```

because when `len(f.pets)==index`, then [here](https://github.com/kubernetes/kubernetes/blob/master/pkg/controller/petset/fakes.go#L252-L254) will cause `index out of range` panic!

[3] https://github.com/kubernetes/kubernetes/blob/master/pkg/controller/petset/fakes.go#L271

same reason with [2]

[4] https://github.com/kubernetes/kubernetes/blob/master/pkg/controller/petset/pet_set_test.go#L79

which doesn't make use of the error returned by [setHealthy](https://github.com/kubernetes/kubernetes/blob/master/pkg/controller/petset/fakes.go#L248) and has a risk of letting the error out.

Should we catch the error and use `t.Errorf()` to stop the test?
2016-09-26 21:13:14 -07:00
Dmitry Shulyak c0981963d9 Verify evicted pods managed by petset controller will be recreated
Spawn pet set with single replica and simple pod. They will have
conflicting hostPort definitions, and spawned on the same node.

As the result pet set pod, it will be created after simple pod, will be
in Failed state. Pet set controller will try to re-create it. After
verifying that pet set pod failed and was recreated atleast once, we will
remove pod with conflicting hostPort and wait until pet set pod will be in
running state.

Change-Id: I5903f5881f8606c696bd390df58b06ece33be88a
2016-09-21 12:03:11 +03:00
deads2k b83a317003 switch controller manager to generated clientset 2016-09-20 12:53:47 -04:00
Kubernetes Submit Queue 4a176600fc Merge pull request #32482 from m1093782566/m109-pet-set-fix-update-bug
Automatic merge from submit-queue

[Pet Set] Fix losing pet updated information between update retries

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

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

Address #32481

@bprashanth
2016-09-20 05:16:04 -07:00
d00369826 3de4695057 fix petset update(pet) retries bug
Change-Id: I92e2b653ab78fca72ae41cf87945d90fbbc67f44
2016-09-20 11:35:58 +08:00
Mike Danese a765d59932 move informer and controller to pkg/client/cache
Signed-off-by: Mike Danese <mikedanese@google.com>
2016-09-15 12:50:08 -07:00
Kubernetes Submit Queue 2462f43798 Merge pull request #32030 from m1093782566/m109-clean-get-pet-code
Automatic merge from submit-queue

[Pet Set] Fix logical breaking of apiServerPetClient.Get(*pcb)

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

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

addresses #32031
2016-09-11 22:49:40 -07:00
Kubernetes Submit Queue a69752c81f Merge pull request #31944 from m1093782566/m109-master-fix-found
Automatic merge from submit-queue

[Pet Set] Clean up code

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

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

Clean code of petset, from:

```
func (p *apiServerPetClient) getPVC(pvcName, pvcNamespace string) (*api.PersistentVolumeClaim, bool, error)
```

to:

```
func (p *apiServerPetClient) getPVC(pvcName, pvcNamespace string) (*api.PersistentVolumeClaim, error) 
```

I think the 2nd(bool type) return value of [getPVC](https://github.com/kubernetes/kubernetes/blob/master/pkg/controller/petset/pet.go#L228) is unnecessary, as the caller can be responsible for checking the error type and tell if it exists via the [error type](https://github.com/kubernetes/kubernetes/blob/master/pkg/controller/petset/pet.go#L231-L233).

So, I remove the 2nd return value of `getPVC()`.

The benefit of this change is that we can simplify the code of `getPVC()` while don't increase the caller's code.
2016-09-09 15:00:22 -07:00
m1093782566 13ce13664d always return false if error not nil in Get(pcb)
Change-Id: I37bd4d8948a8a5c0017966958547904595b28119
2016-09-08 10:25:54 +08:00
m1093782566 927569bc5b fix petset ut bug 2016-09-07 00:26:25 +08:00
Kubernetes Submit Queue 562e1747a8 Merge pull request #31698 from m1093782566/m109-pet-set-errs-err
Automatic merge from submit-queue

[Pet Set] Refactor return []error to error

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

**Which issue this PR fixes** 

I propose refactor return value from `[]error` to error [here](https://github.com/kubernetes/kubernetes/blob/master/pkg/controller/petset/pet_set.go#L80), for the purpose of simplify code and format error output.

I think we can use `errors.NewAggregate(errorList)` to aggregate `[]error`.
2016-09-05 22:09:07 -07:00
m1093782566 7dd675ef32 clean up pet set code
Change-Id: I60562bb1aa44436a23cfc5e50d6037adcce417c6
2016-09-03 21:28:46 +08:00
m1093782566 a3a5c0c4c5 refactor return []error to error
Change-Id: Ieb9866a9768026067ae3c9b70c8972677bac6875
2016-09-01 17:09:22 +08:00
Dmitry Shulyak 200f8c5c39 Delete evicted pet
If pet was evicted by kubelet - it will stuck in this state forever.
By analogy to regular pod we need to re-create pet so that it will
be re-scheduled to another node, so in order to re-create pet
and preserve consitent naming we will delete it in petset controller
and create after that.

Change-Id: Ib98bf7f34b3f2ab1582b9de34b5f4c5f84cd5215
2016-08-31 14:41:10 +03:00
deads2k 4317173d3f add names for workqueues to gather controller latency/depth metrics 2016-08-30 09:51:50 -04:00
Anirudh 0e5a49f667 Petset hotlooping issue. 2016-08-24 19:21:47 -07:00
Wojciech Tyczynski 331083727f Change podNamespacer API 2016-08-17 16:55:01 +02:00
Kubernetes Submit Queue d2543c30d8 Merge pull request #30277 from wojtek-t/optimize_controllers
Automatic merge from submit-queue

Avoid computing DeepEqual in controllers all the time

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

<!--
Checklist for submitting a Pull Request

Please remove this comment block before submitting.

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

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

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.kubernetes.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.kubernetes.io/reviews/kubernetes/kubernetes/30277)
<!-- Reviewable:end -->
2016-08-12 03:20:58 -07:00
Kubernetes Submit Queue 8bd71c3de9 Merge pull request #29502 from lixiaobing10051267/masterHostName
Automatic merge from submit-queue

t.Errorf output wrong variables in identity_mapper_test.go

t.Errorf output wrong variables in identity_mapper_test.go

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.kubernetes.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.kubernetes.io/reviews/kubernetes/kubernetes/29502)
<!-- Reviewable:end -->
2016-08-12 00:31:53 -07:00
Wojciech Tyczynski acfd8c787f Avoid computing super-expensive DeepEqual on every pod update 2016-08-11 08:35:36 +02:00
lixiaobing10051267 7d3d6a7f64 t.Errorf output wrong variables in identity_mapper_test.go 2016-08-06 07:48:40 +08:00
Kubernetes Submit Queue 2537f66f0e Merge pull request #29230 from luxas/goimport
Automatic merge from submit-queue

Run goimport for the whole repo

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

This is more for testing if it builds.
The only strange thing here is the gopkg.in/gcfg.v1 => github.com/scalingdata/gcfg replace.
cc @jfrazelle @thockin
2016-08-05 16:22:01 -07:00
Kubernetes Submit Queue c2614aee9a Merge pull request #29500 from lixiaobing10051267/masterFound
Automatic merge from submit-queue

Check all places to break the loop when object found

Check all places to break the loop when object found.
2016-08-03 20:05:15 -07:00
Lucas Käldström c88a07ce1a Run goimports 2016-08-02 15:12:39 +03:00
Michal Rostecki 59ca5986dd Print/log pointers of structs with %#v instead of %+v
There are many places in k8s where %+v is used to format a pointer
to struct, which isn't working as expected.

Fixes #26591
2016-08-01 22:27:56 +02:00
lixiaobing10051267 be8d081539 Check all places to break the loop when object found 2016-07-23 13:49:04 +08:00
k8s-merge-robot 835ee70c45 Merge pull request #28909 from foxish/foxish-issue-28785
Automatic merge from submit-queue

Create event only if creation of PVC failed.

Fixes #28785.
We should report an event only if the petset can't find a PVC and can't create it either.

[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/.github/PULL_REQUEST_TEMPLATE.md?pixel)]()
2016-07-22 02:39:06 -07:00
Chao Xu 11a341de67 let RC manager utilize the GC 2016-07-14 19:59:31 -07:00
Anirudh 467333cc40 Create event only if creation of PVC failed. 2016-07-14 11:53:42 -07:00
joe2far 5ead89b5bb Fixed several typos 2016-07-13 15:06:24 +01:00
David McMahon ef0c9f0c5b Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
Clayton Coleman 5e4308f91d
Update use of Quantity in other classes 2016-05-19 08:41:43 -04:00
k8s-merge-robot 15919f336f Merge pull request #25284 from bprashanth/service_unready
Automatic merge from submit-queue

Add a service annotation that allows endpoints for unready pods

See https://github.com/kubernetes/kubernetes/issues/25283 for context 
@smarterclayton @thockin yes?

<!-- Reviewable:start -->
---
This change is [<img src="http://reviewable.k8s.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](http://reviewable.k8s.io/reviews/kubernetes/kubernetes/25284)
<!-- Reviewable:end -->
2016-05-12 12:05:27 -07:00
saadali b83af3d481 Change "speter.net/go/exp/math/dec/inf" dependency
to "https://gopkg.in/inf.v0"
2016-05-11 17:01:28 -07:00
Prashanth Balasubramanian 377957a173 PetSet doesn't scale if it finds unready pets 2016-05-10 13:03:28 -07:00
mqliang c10f43a2e5 implement AddIndexers for SharedIndexInformer 2016-05-06 21:23:18 +08:00
Prashanth Balasubramanian 6bc3052551 PetSet alpha controller 2016-05-04 18:39:17 -07:00