Commit Graph

296 Commits (00aae980e889e8a5731ad4639154b6524ee8749a)

Author SHA1 Message Date
Michal Fojtik 2ccc9fa859 Add Get() to cache listers 2016-08-18 18:19:50 +02:00
Kubernetes Submit Queue 86340fc123 Merge pull request #30839 from lavalamp/fix
Automatic merge from submit-queue

queueActionLocked requires write lock

Fix https://github.com/kubernetes/minikube/issues/368
Fix part of #30759

Hopefully. On stack dumps I couldn't see who was fighting with this.
2016-08-18 02:43:25 -07:00
Daniel Smith 3e69c5a9b8 queueActionLocked requires write lock 2016-08-17 17:34:49 -07:00
Wojciech Tyczynski 331083727f Change podNamespacer API 2016-08-17 16:55:01 +02:00
Matt Liggett d60ba3c6e2 Implement DisruptionController.
Part of #12611
2016-08-16 15:20:41 -07:00
Kubernetes Submit Queue 69419a145a Merge pull request #29802 from jfrazelle/fix-go-vet-errors
Automatic merge from submit-queue

fix go vet errors

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

This fixes the `go vet` errors brought about by go 1.7 testing re (#28742).

The are all pretty trivial and mostly related to literal composites.

also related to #16086
2016-08-15 13:10:08 -07:00
Wojciech Tyczynski 1c9e623045 Remove dead variable from reflector 2016-08-11 08:32:37 +02:00
Jess Frazelle 7e9d82129e
fix go vet errors
Signed-off-by: Jess Frazelle <jessfraz@google.com>

fix composites

Signed-off-by: Jess Frazelle <me@jessfraz.com>
2016-08-10 16:45:41 -07:00
Kubernetes Submit Queue 48b7aca2c9 Merge pull request #29672 from lixiaobing10051267/masterLen
Automatic merge from submit-queue

Add handling empty index key that may cause panic issue

if len(indexKeys) == 0, "return indexKeys[0]" will cause unexpected result.

<!-- 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/29672)
<!-- Reviewable:end -->
2016-08-10 14:29:45 -07:00
Harry Zhang cb14b35bde Refactor util clock into it's own pkg 2016-07-28 02:29:04 -04:00
lixiaobing10051267 a9d631665e Add handling empty index key that may cause panic issue 2016-07-27 21:44:22 +08:00
Dominika Hodovska 037d116add Factory for SharedIndexInformers 2016-07-21 14:04:48 +02:00
George Tankersley 803c7ac299 certificates: implement certificates controller 2016-07-19 11:25:38 -07:00
Davanum Srinivas 2b0ed014b7 Use Go canonical import paths
Add canonical imports only in existing doc.go files.
https://golang.org/doc/go1.4#canonicalimports

Fixes #29014
2016-07-16 13:48:21 -04:00
joe2far 5ead89b5bb Fixed several typos 2016-07-13 15:06:24 +01:00
k8s-merge-robot 98030ded05 Merge pull request #28781 from wojtek-t/optimize_priorities_2
Automatic merge from submit-queue

Change storeToNodeConditionLister to return []*api.Node instead of api.NodeList for performance



Currently copies that are made while copying/creating api.NodeList are significant part of scheduler profile, and a bunch of them are made in places, that are not-parallelizable.
Ref #28590
2016-07-12 06:18:15 -07:00
Wojciech Tyczynski d14fe0f269 Change storeToNodeConditionLister to return []*api.Node instead of api.NodeList for performance 2016-07-11 21:02:33 +02:00
Clayton Coleman 2132ecc28d
Allow a FIFO client to requeue under lock
The Pop method should allow a caller to requeue an item while under the
fifo lock, to avoid races on deletes.
2016-07-10 17:32:21 -04:00
k8s-merge-robot 383d45f185 Merge pull request #28596 from wojtek-t/scheduler_optimizations
Automatic merge from submit-queue

Some scheduler optimizations

Ref #28590

This PR doesn't do anything fancy - it is just reducing amount of memory allocations in scheduler, which in turn significantly speeds up scheduler.
2016-07-08 02:34:06 -07:00
Wojciech Tyczynski 7219802ac7 Pass pointer to node in NodCondition 2016-07-07 14:10:17 +02:00
lixiaobing10051267 9915e89107 The notes are in reverse order 2016-07-07 14:45:16 +08:00
David McMahon ef0c9f0c5b Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
k8s-merge-robot 59b88d7ab6 Merge pull request #26925 from ZTE-PaaS/249043822-patch-1
Automatic merge from submit-queue

optimize deleteFromIndices method of thread_safe_store

As all methods of thread_safe_store are threadsafe, so i think, in deleteFromIndices method, if the index is nil, need not run the for structure below
2016-06-25 12:57:50 -07:00
Jan Safranek c9a60e2d2c Rephrase 'pv not found in cache' warnings.
When kubelet starts a pod that refers to non-existing PV, PVC or Node, it
should clearly show that the requested element does not exist.

Previous "PersistentVolumeClaim 'default/ceph-claim-wm' is not in cache"
looks like random kubelet hiccup, while "PersistentVolumeClaim
'default/ceph-claim-wm' not found" suggests that the object may not exist at
all and it might be an user error.

Fixes #27523
2016-06-21 14:56:11 +02:00
Wojciech Tyczynski ccd42e9236 Fix bugs in DeltaFIFO 2016-06-15 15:08:21 +02:00
Wojciech Tyczynski 5d702a32c1 Fix race in informer 2016-06-14 16:40:12 +02:00
Ke Zhang 5dbf21aa13 optimize deleteFromIndices method in thread_safe_store.go 2016-06-14 09:21:44 +08:00
Alex Mohr edda837142 Merge pull request #25599 from caesarxuchao/orphaning-finalizer
Add orphaning finalizer logic to GC
2016-05-26 13:19:19 -07:00
Matt Liggett 1fee311282 Refactor *Namespacer.List().
Refactor storePodsNamespacer.List() and
storeReplicationContollersNamespacer.List().  They are the same
function, just with different signatures.

This fixes a bug where, when we fell back on a brute force approach, we
were still returning an error.

Also change to explicit return without named return values.
2016-05-25 17:18:28 -07:00
Chao Xu 1665546d2d add finalizer logics to the API server and the garbage collector; handling DeleteOptions.OrphanDependents in the API server 2016-05-24 13:07:28 -07:00
Wojciech Tyczynski 051fca3c79 Fix govet error in reflect_resync test 2016-05-23 12:50:46 +02:00
Wojciech Tyczynski 71726a8ad0 Fix reflector test 2016-05-23 12:07:11 +02:00
Piotr Szczesniak d92c151fec Merge pull request #26013 from xiang90/fix_test
cache: fix flaky resync test
2016-05-23 09:23:26 +02:00
Xiang Li abbbd7c2f2 cache: reflector should never stop watching
A recent change tries to separate resync and relist. The motivation
was to avoid triggering relist when a resync is required.

However, the change is not effective since it stops the watcher. As hongchao
mentioned in the original comment, today's storage interface will not deliever
any progress notification to the watch chan. So any watcher that does not receive
events for the last few seconds will not be able to catch up from the previous
index after a hard close since the index of the last received event is out of
the cache window inside etcd2.

This pull request tries to fix this issue by not stoping watcher when a resync is
required.
2016-05-22 18:04:20 -07:00
Xiang Li f31ec95f05 cache: fix flaky resync test 2016-05-22 10:57:00 -07:00
Robert Rati e388c137bb Separate sync and list functionality in the reflector. #23394 2016-05-19 07:41:24 -04:00
Daniel Smith 6dc1437015 Merge pull request #25671 from deads2k/fix-add-indexer
make addIndexers safe for sharedInformer
2016-05-18 14:48:43 -07:00
deads2k 4a39cc9dd3 make addIndexers safe for sharedInformer 2016-05-16 10:15:05 -04:00
Chao Xu c73406bcfe the garbage collector controller 2016-05-15 16:04:19 -07:00
k8s-merge-robot 5988080396 Merge pull request #23795 from mqliang/rc-ns-index
Automatic merge from submit-queue

add namespace index for cache

@wojtek-t 

Implement in this approach make the change of lister.go small, but we should replace all `NewInformer()` to `NewIndexInformer()`, even when someone not want to filter by namespace(eg. gc_controller and scheduler). Any suggestion?
2016-05-08 12:09:01 -07:00
Robert Bailey 1df0dfdaa8 Merge pull request #25122 from nowprovision/reflector-loop-missing-errorhandler-fix
Handle possible error in client reflector run loops
2016-05-06 14:06:35 -07:00
Robert Bailey 64e1240180 Merge pull request #25141 from jsafrane/devel/fix-store-race
Make threadSafeMap.ListIndexFuncValues thread safe.
2016-05-06 13:50:36 -07:00
mqliang c10f43a2e5 implement AddIndexers for SharedIndexInformer 2016-05-06 21:23:18 +08:00
mqliang 9011207f18 add namespace index to rc and pod 2016-05-06 17:12:36 +08:00
Prashanth Balasubramanian 6bc3052551 PetSet alpha controller 2016-05-04 18:39:17 -07:00
Jan Safranek 42d940735b Make threadSafeMap.ListIndexFuncValues thread safe.
Surprisingly, this method does not lock and I get data race reports
in my persistent volume unit tests (which use this map).
2016-05-04 18:18:00 +02:00
Matt Freeman 89e5e81bea Handle possible error in client reflector run loops 2016-05-04 05:01:54 +00:00
k8s-merge-robot d0b887e4e0 Merge pull request #24595 from zhouhaibing089/httpserverclose
Automatic merge from submit-queue

Uncomment the code that caused by #19254

Fix https://github.com/kubernetes/kubernetes/issues/24546.

@lavalamp
2016-04-28 01:41:16 -07:00
zhouhaibing089 bf1a3f99c0 Uncomment the code that cause by #19254 2016-04-25 23:21:31 +08:00
Maciej Szulik a3b4447305 Move internal types of job from pkg/apis/extensions to pkg/apis/batch 2016-04-25 11:03:54 +02:00
Vincent Behar efe7775578 fix typo 2016-04-04 14:40:01 +02:00
Clayton Coleman 206308ea14 Provide better log output and name for reflectors
Reflectors started from goroutines are broken because Go doesn't allow
runtime.Callers to see the spawning goroutine. Do a best effort parse of
the call stack for now.

Add logging so that we can easily see which reflectors processes launch,
and measure in logs the frequency of sync intervals.
2016-03-24 17:37:31 -04:00
Joshua Piccari f5f83b076a Improve go report card by fixing typos in comments 2016-03-04 18:30:59 -08:00
Kris e664ef922f Move restclient to its own package 2016-02-29 12:05:13 -08:00
Prashanth Balasubramanian 45eb835833 Lock across item expiration in the ttl store. 2016-02-24 14:06:18 -08:00
Janet Kuo cf2bbc0d6d Fix a bug when getting deployments for RS 2016-02-19 11:42:17 -08:00
laushinka 7ef585be22 Spelling fixes inspired by github.com/client9/misspell 2016-02-18 06:58:05 +07:00
Madhusudan.C.S 525d7a7732 Fix the label selector to selector conversion error string.
The message as it is framed right now does not make any sense for the
end users of our system. It might even lead to confusion. So this is
attempt to make the error message less confusing.
2016-02-10 09:43:30 -08:00
Madhusudan.C.S ed7ad6dcf3 Make deployments work. 2016-02-08 21:27:49 -08:00
Madhusudan.C.S 518f08aa7c Move Deployments to ReplicaSets and switch the Deployment selector to the new LabelSelector.
Update the Deployments' API types, defaulting code, conversions, helpers
and validation to use ReplicaSets instead of ReplicationControllers and
LabelSelector instead of map[string]string for selectors.

Also update the Deployment controller, registry, kubectl subcommands,
client listers package and e2e tests to use ReplicaSets and
LabelSelector for Deployments.
2016-02-08 21:27:38 -08:00
Jan Chaloupka 4389b3f0d6 Rewritte util.* -> wait.* wherever reasonable 2016-02-07 12:02:20 +01:00
Daniel Smith 9b68e8ec2b Merge pull request #20269 from mqliang/sync-delta-fifo
add a HasSynced() for DeltaFIFO and FIFO, method, which is very helpful for Informer
2016-02-05 15:51:50 -08:00
Eric Tune 6133cb1f21 Move extensions.LabelSelector to unversioned.
Move type LabelSelector and type LabelSelectorRequirement from pkg/apis/extensions
This avoids an import loop when Job (and later DaemonSet, Deployment, ReplicaSet)
are moved out of extensions to new api groups.

Also Move LabelSelectorAsSelector utility from pkg/apis/extensions/ to pkg/api/unversioned/
Also its test.
Also LabelSelectorOp* constants.
Also the pkg/apis/extensions/validation functions ValidateLabelSelectorRequirement and
ValidateLabelSelector move to pkg/api/unversioned

The related type in pkg/apis/extensions/v1beta1/ is staying there.  I might move
it in another PR if neccessary.
2016-02-04 13:46:34 -08:00
mqliang 8e615df000 fix the HasSynced() bug for Informer 2016-02-03 11:40:11 +08:00
Jeff Lowdermilk caa9433234 Merge pull request #20433 from lavalamp/fix-bad-rv
Add timeout, fix potential startup hang
2016-02-02 17:27:23 -08:00
Daniel Smith 4a7d70aef1 extend fake clock 2016-02-01 15:36:15 -08:00
harry 1032067ff9 Replace runtime reference by pkg 2016-02-01 21:06:44 +08:00
k8s-merge-robot 4ed43968e0 Merge pull request #19581 from janetkuo/deployment-version
Auto commit by PR queue bot
2016-01-30 13:34:59 -08:00
Janet Kuo 42f712467e Use ListOptions when listing RCs in deployment 2016-01-30 12:04:35 -08:00
Clayton Coleman 8692d260f8 Use Parameter codec in request.VersionedParams() 2016-01-30 14:14:20 -05:00
k8s-merge-robot 783d1d00d7 Merge pull request #20139 from janetkuo/rcList-namespace
Auto commit by PR queue bot
2016-01-30 09:42:35 -08:00
Madhusudan.C.S c25a0ce00d Implement ReplicaSets client. 2016-01-28 22:36:22 -08:00
Clayton Coleman 38c7eded99 Prepare for content-type negotiation
Combine the fields that will be used for content transformation
(content-type, codec, and group version) into a single struct in client,
and then pass that struct into the rest client and request. Set the
content-type when sending requests to the server, and accept the content
type as primary.

Will form the foundation for content-negotiation via the client.
2016-01-26 17:44:30 -05:00
Janet Kuo 14f4f1b065 Make listing deployment rcStore namespaced 2016-01-25 19:13:17 -08:00
k8s-merge-robot 4010c214e4 Merge pull request #19752 from hongchaodeng/listandwatch
Auto commit by PR queue bot
2016-01-15 23:01:37 -08:00
Hongchao Deng 9a10e95f6e docs: Reflector ListAndWatch 2016-01-15 18:19:19 -08:00
harry 98222b4d8b Replace to tag
Use a testing pkg to replace testing util codes
2016-01-15 15:07:21 +08:00
He Simei 7dacd3fe61 use param indices 2016-01-13 19:23:58 +08:00
David Oppenheimer 8ac484793d Comment out calls to httptest.Server.Close() to work around
https://github.com/golang/go/issues/12262 . See #19254 for
more details. This change should be reverted when we upgrade
to Go 1.6.
2016-01-11 23:02:11 -08:00
Justin Santa Barbara f9a6ac077e Ubernetes Lite: Volumes can dictate zone scheduling
For AWS EBS, a volume can only be attached to a node in the same AZ.
The scheduler must therefore detect if a volume is being attached to a
pod, and ensure that the pod is scheduled on a node in the same AZ as
the volume.

So that the scheduler need not query the cloud provider every time, and
to support decoupled operation (e.g. bare metal) we tag the volume with
our placement labels.  This is done automatically by means of an
admission controller on AWS when a PersistentVolume is created backed by
an EBS volume.

Support for tagging GCE PVs will follow.

Pods that specify a volume directly (i.e. without using a
PersistentVolumeClaim) will not currently be scheduled correctly (i.e.
they will be scheduled without zone-awareness).
2015-12-31 12:27:01 -05:00
Janet Kuo 32d153093e Fix deployment tests failures; change ResyncPeriod 2015-12-17 19:29:54 -08:00
Sam Ghods b838d8ce18 Add informers to deployment controller 2015-12-17 19:29:54 -08:00
Clayton Coleman 8f203a28f1 Change runtime.Object signature 2015-12-15 13:36:25 -05:00
k8s-merge-robot 06df5c97e7 Merge pull request #18499 from wojtek-t/fix_reflector_race
Auto commit by PR queue bot
2015-12-15 01:19:06 -08:00
Wojciech Tyczynski 960808bf08 Switch to versioned ListOptions in client. 2015-12-14 14:26:09 +01:00
Wojciech Tyczynski 6a7e8861c2 Fix data-race in reflector test in Go 1.5.1 2015-12-14 09:47:45 +01:00
Wojciech Tyczynski 0cefb43707 Enable listing from memory 2015-12-09 16:24:14 +01:00
Wojciech Tyczynski a915b8b29a Merge pull request #18080 from wojtek-t/list_options_in_listwatch
Pass ListOptions to List in ListWatch.
2015-12-09 14:27:51 +01:00
deads2k 2ee3dfe415 update testapi to eliminate redundant fields 2015-12-07 15:54:26 -05:00
Wojciech Tyczynski b0fcb5adef Pass ListOptions to List in ListWatch. 2015-12-07 11:53:53 +01:00
k8s-merge-robot db11f1b6c6 Merge pull request #17133 from derekwaynecarr/quota_controller_improvements
Auto commit by PR queue bot
2015-12-06 12:24:00 -08:00
Salvatore Dario Minonne 80575c3093 renaming PodSelector to LabelSelector 2015-12-04 09:49:08 +01:00
derekwaynecarr 55d4f70f8e Resource quota observes deletes faster 2015-12-03 17:35:05 -05:00
Wojciech Tyczynski cdded4f011 Use VersionedParams in "extensions" client. 2015-12-01 10:18:55 +01:00
jiangyaoguo f4c5d00b0c Implement a cachedNodeInfo in predicates 2015-11-27 21:49:14 +08:00
Wojciech Tyczynski b6ef62af24 Use unversioned.ListOptions in clients. 2015-11-24 16:52:09 +01:00
k8s-merge-robot 4fd6b6df06 Merge pull request #17316 from deads2k/gv-ClientForVersion
Auto commit by PR queue bot
2015-11-24 06:24:28 -08:00
deads2k a87d927588 update client.Config to use GroupVersion 2015-11-21 08:29:26 -05:00
feihujiang ad79fa6e84 Move list functions from runtime to meta package 2015-11-20 09:20:55 +08:00
Abhi Shah 3b014c71dd Merge pull request #17274 from mqliang/podController
fix errror message
2015-11-18 14:17:31 -08:00