-
Notifications
You must be signed in to change notification settings - Fork 881
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Providing KVObject option to skip persisting object in kvstore #554
Conversation
@@ -79,6 +79,33 @@ func testLocalBackend(t *testing.T, provider, url string, storeConfig *store.Con | |||
} | |||
} | |||
|
|||
func testNoPersist(t *testing.T, provider, url string, storeConfig *store.Config) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function definition should be func TestNoPersist(t *testing.T)
?
Also add a check before watching endpoints? https://github.com/docker/libnetwork/blob/master/controller.go#L297 |
@chenchun good point. will do that. |
Signed-off-by: Madhu Venugopal <madhu@docker.com>
@chenchun took care of the comment by adding the check in |
LGTM |
@@ -61,6 +61,8 @@ type KV interface { | |||
Exists() bool | |||
// DataScope indicates the storage scope of the KV object | |||
DataScope() DataScope | |||
// Skip provides a way for a KV Object to avoid persisting it in the KV Store | |||
Skip() bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we name it SkipPersist
to be clear? Right now we don't know what we are skipping on?
Edit: on looking at the complete diff may be Skip
makes sense since you are skipping to put the object on the kv store altogether. But IMO this decision could be made outside of the datastore. If you are skipping data store you just don't invoke data store ops in the caller site rather than forcing every object to provide a Skip
method
LGTM |
Providing KVObject option to skip persisting object in kvstore
Signed-off-by: Madhu Venugopal madhu@docker.com