Commit Graph

262 Commits (63602348a46dae777038be34470c0d7d025420fe)

Author SHA1 Message Date
Harry Zhang cb14b35bde Refactor util clock into it's own pkg 2016-07-28 02:29:04 -04:00
Hongchao Deng 60d165a830 storage error: precondition failure should return invalid object error 2016-07-24 20:21:42 -07:00
Wojciech Tyczynski 33e612e101 Revert "cacher.go: embed storage.Interface into cacher" 2016-07-22 07:28:45 +02:00
k8s-merge-robot 42a1deeff3 Merge pull request #26861 from xiang90/embed
Automatic merge from submit-queue

cacher.go: embed storage.Interface into cacher

Continuous effort to simplify cacher implementation.
2016-07-21 09:50:19 -07:00
Xiang Li 44c0a1190c cacher.go: embed storage.Interface into cacher 2016-07-16 23:25:48 -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
Hongchao Deng 54025ce8b3 etcd3/store: Add test for compact conflict 2016-07-15 10:24:50 -07:00
Hongchao Deng 186b4858b4 better handle etcd compaction in multi-apiserver 2016-07-15 10:24:49 -07:00
Jordan Liggitt 4fcd999c25
Fix watch cache filtering 2016-07-14 13:13:17 -04:00
joe2far 5ead89b5bb Fixed several typos 2016-07-13 15:06:24 +01:00
Wojciech Tyczynski 1d9bc58328 Extend Filter interface with Trigger() and use it for pods and nodes 2016-07-13 08:45:18 +02:00
Wojciech Tyczynski 7f7ef0879f Change filter to interface in storage.Interface 2016-07-13 08:44:22 +02:00
Jordan Liggitt e43e58c787
Allow specifying base location for test etcd data 2016-07-08 16:24:41 -04:00
Xiang Li aa472ff734 cacher: replace usable lock with conditional variable 2016-07-04 08:57:59 -07:00
David McMahon ef0c9f0c5b Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
k8s-merge-robot 00b5b548d6 Merge pull request #26854 from xiang90/cacher
Automatic merge from submit-queue

cacher.go: remove NewCacher func

NewCacher is a wrapper of NewCacherFromConfig. NewCacher understands
how to create a key func from scopeStrategy. However, it is not the
responsibility of cacher. So we should remove this function, and
construct the config in its caller, which should understand scopeStrategy.
2016-06-25 11:10:06 -07:00
k8s-merge-robot b71e499c92 Merge pull request #26502 from gyuho/remove_name_field
Automatic merge from submit-queue

pkg/storage/etcd3: remove name field in test

Current test gets the name with its test table index,
so there seems to be no reason to have name field in test table.
2016-06-25 07:09:36 -07:00
k8s-merge-robot e65965fca6 Merge pull request #26855 from xiang90/cacher_rm
Automatic merge from submit-queue

cacher: remove unnecessary initialzation
2016-06-24 13:56:47 -07:00
Wojciech Tyczynski 394db3b407 Fix traces 2016-06-06 10:49:46 +02:00
Xiang Li c530a5810a cacher: remove unnecessary initialzation 2016-06-04 22:49:45 -07:00
Xiang Li e2aab093aa cacher.go: remove NewCacher func
NewCacher is a wrapper of NewCacherFromConfig. NewCacher understands
how to create a key func from scopeStrategy. However, it is not the
responsibility of cacher. So we should remove this function, and
construct the config in its caller, which should understand scopeStrategy.
2016-06-04 22:46:58 -07:00
Gyu-Ho Lee b8740c2c67 pkg/storage/etcd3: remove name field in test
Current test gets the name with its test table index,
so there seems to be no reason to have name field in test table.
2016-05-29 02:17:35 -07:00
k8s-merge-robot ae28564526 Merge pull request #26386 from janetkuo/etcd-test-flake
Automatic merge from submit-queue

Increase etcd test server up timeout and disallow returning nil server 

Fixes #25047

[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/.github/PULL_REQUEST_TEMPLATE.md?pixel)]()
2016-05-27 05:49:51 -07:00
k8s-merge-robot 8bfaec4b59 Merge pull request #26334 from fejta/own
Automatic merge from submit-queue

Create pkg/storage/OWNERS

Fixes #26118
2016-05-26 16:10:03 -07:00
Janet Kuo 672cd64035 Disallow returning nil server in NewEtcdTestClientServer 2016-05-26 14:37:12 -07:00
Janet Kuo 3cc2311c54 Increase etcd test server up timeout to wait.ForeverTestTimeout 2016-05-26 14:35:57 -07: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
Erick Fejta f4d07ddf7d Create pkg/storage/OWNERS 2016-05-25 21:13:10 -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
deads2k 02c0181f26 reduce conflict retries 2016-05-23 13:09:37 -04:00
Hongchao Deng ae6166f97d etcd3/compactor: fix logging endpoints 2016-05-20 14:35:42 -07:00
Wojciech Tyczynski 9784dff94e Merge pull request #25871 from smarterclayton/retry_on_error
Fix the Retry-After code path to work for clients, and send correct bodies
2016-05-19 16:18:18 +02:00
k8s-merge-robot 044d55ed7d Merge pull request #24142 from rrati/controller-sync-interval-23394
Automatic merge from submit-queue

Separated resync and relist functionality in reflector #23394

controller-manager #23394
2016-05-19 07:10:00 -07:00
k8s-merge-robot d89d45a861 Merge pull request #25266 from smarterclayton/common_storage
Automatic merge from submit-queue

kube-apiserver options should be decoupled from impls

A few months ago we refactored options to keep it independent of the
implementations, so that it could be used in CLI tools to validate
config or to generate config, without pulling in the full dependency
tree of the master.  This change restores that by separating
server_run_options.go back to its own package.

Also, options structs should never contain non-serializable types, which
storagebackend.Config was doing with runtime.Codec. Split the codec out.

Fix a typo on the name of the etcd2.go storage backend.

Finally, move DefaultStorageMediaType to server_run_options.

@nikhiljindal as per my comment in #24454, @liggitt because you and I
discussed this last time
2016-05-19 06:13:38 -07:00
Clayton Coleman e5fbf86157
Allow StatusErrors to be modified after creation 2016-05-19 09:08:53 -04:00
Robert Rati e388c137bb Separate sync and list functionality in the reflector. #23394 2016-05-19 07:41:24 -04:00
Clayton Coleman 633683c08d
kube-apiserver options should be decoupled from impls
A few months ago we refactored options to keep it independent of the
implementations, so that it could be used in CLI tools to validate
config or to generate config, without pulling in the full dependency
tree of the master.  This change restores that by separating
server_run_options.go back to its own package.

Also, options structs should never contain non-serializable types, which
storagebackend.Config was doing with runtime.Codec. Split the codec out.

Fix a typo on the name of the etcd2.go storage backend.

Finally, move DefaultStorageMediaType to server_run_options.
2016-05-18 10:39:21 -04:00
Tim Hockin 152c86ab06 Make name validators return string slices 2016-05-18 00:48:01 -07:00
Wojciech Tyczynski 7452bc3f5b Tune traces thresholds in etcdHelper 2016-05-16 11:10:31 +02:00
k8s-merge-robot be104a8271 Merge pull request #25415 from hongchaodeng/e2
Automatic merge from submit-queue

etcd_watcher: make Deleted Event.Object's version consistent

### What's the problem?

In [sendDelete()](995f022808/pkg/storage/etcd/etcd_watcher.go (L437-L442)), Deleted Event.Object's resource version will be set to the latest resource version. This is actually an assumption made by cacher that all later events should have objects with larger verions; See [here](995f022808/pkg/storage/cacher.go (L579-L581)).

In sendModify(), it could also return Deleted event. However, the resource version is still the old version, which is inconsistent behavior with sendDelete().

### What's this PR?
This PR sets the version of oldObj in sendModify() to be the latest version.
Provided unit test for it.
2016-05-14 20:46:20 -07:00
Matt Liggett 2bc46d5085 It's 2016, yo. 2016-05-13 12:41:40 -07:00
Hongchao Deng 5337bc220a etcd_watcher: test for ensuring delete event have latest index 2016-05-12 11:01:26 -07:00
Hongchao Deng fcf63a6c4b etcd_watcher: make Deleted Event.Object's version consistent 2016-05-12 11:01:26 -07:00
k8s-merge-robot aa8fddb7d9 Merge pull request #25369 from liggitt/cached-watch
Automatic merge from submit-queue

Return 'too old' errors from watch cache via watch stream

Fixes #25151

This PR updates the API server to produce the same results when a watch is attempted with a resourceVersion that is too old, regardless of whether the etcd watch cache is enabled. The expected result is a `200` http status, with a single watch event of type `ERROR`. Previously, the watch cache would deliver a `410` http response.

This is the uncached watch impl:
```
// Implements storage.Interface.
func (h *etcdHelper) WatchList(ctx context.Context, key string, resourceVersion string, filter storage.FilterFunc) (watch.Interface, error) {
	if ctx == nil {
		glog.Errorf("Context is nil")
	}
	watchRV, err := storage.ParseWatchResourceVersion(resourceVersion)
	if err != nil {
		return nil, err
	}
	key = h.prefixEtcdKey(key)
	w := newEtcdWatcher(true, h.quorum, exceptKey(key), filter, h.codec, h.versioner, nil, h)
	go w.etcdWatch(ctx, h.etcdKeysAPI, key, watchRV)
	return w, nil
}
```

once the resourceVersion parses, there is no path that returns a direct error, so all errors would have to be returned as an `ERROR` event via the ResultChan().
2016-05-10 18:15:15 -07:00
Hongchao Deng cd3f7f41c1 etcd3/watcher: refactor test 2016-05-10 12:37:31 -07:00
Hongchao Deng da7e9783e8 etcd3/watcher: Event.Object should have the same rev as etcd delete
instead of previous object's revision.
2016-05-10 10:53:53 -07:00
Jordan Liggitt f80b59ba87 Return 'too old' errors from watch cache via watch stream 2016-05-10 10:59:53 -04:00
Hongchao Deng 97f4647dc3 etcd3/watcher: fix goroutine leak if ctx is canceled
In reflector.go, it could probably call Stop() without retrieving all results
from ResultChan().
A potential leak is that when an error has happened, it could block on resultChan,
and then cancelling context in Stop() wouldn't unblock it.
This fixes the problem by making it also select ctx.Done and cancel context
afterwards if error happened.
2016-05-09 09:06:11 -07:00
Robert Bailey 24c69f0b14 Merge pull request #25211 from lavalamp/leak
Never leak the etcd watcher's translate goroutine
2016-05-06 15:03:21 -07:00
Daniel Smith 995f022808 Never leak the etcd watcher's translate goroutine 2016-05-05 11:19:12 -07:00