Skip to content
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

clientv3: translate WithPrefix() into WithFromKey() for empty key #7752

Merged

Conversation

heyitsanthony
Copy link
Contributor

Users seem to expect the client to do this.

Copy link
Contributor

@gyuho gyuho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@@ -381,6 +381,36 @@ func TestKVRange(t *testing.T) {
{Key: []byte("fop"), Value: nil, CreateRevision: 9, ModRevision: 9, Version: 1},
},
},
// fetch entire keyspace using WithFromKey
{
"\x00", "",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if the key is "" with the opt WithFromKey(), what's the expected behavior?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'll fail because no key is defined. No one complains about Get(ctx, "", WithFromKey())

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

got it.

@codecov-io
Copy link

Codecov Report

❗ No coverage uploaded for pull request base (master@6ad9d16). Click here to learn what that means.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #7752   +/-   ##
=========================================
  Coverage          ?   75.71%           
=========================================
  Files             ?      331           
  Lines             ?    26011           
  Branches          ?        0           
=========================================
  Hits              ?    19693           
  Misses            ?     4894           
  Partials          ?     1424
Impacted Files Coverage Δ
clientv3/op.go 67.89% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6ad9d16...f92c11e. Read the comment docs.

@fanminshi
Copy link
Member

lgtm

1 similar comment
@xiang90
Copy link
Contributor

xiang90 commented Apr 18, 2017

lgtm

@heyitsanthony heyitsanthony merged commit 8fdf8f7 into etcd-io:master Apr 18, 2017
@heyitsanthony heyitsanthony deleted the clientv3-fetch-keyspace-pfx branch April 18, 2017 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

5 participants