Skip to content

Commit

Permalink
backport of commit 425b1e3 (#23885)
Browse files Browse the repository at this point in the history
Co-authored-by: Josh Black <[email protected]>
  • Loading branch information
1 parent 274436c commit 9307573
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions changelog/23872.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:improvement
storage/etcd: etcd should only return keys when calling List()
```
4 changes: 2 additions & 2 deletions physical/etcd/etcd3.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"sync"
"time"

metrics "github.com/armon/go-metrics"
"github.com/armon/go-metrics"
log "github.com/hashicorp/go-hclog"
"github.com/hashicorp/go-secure-stdlib/parseutil"
"github.com/hashicorp/go-secure-stdlib/strutil"
Expand Down Expand Up @@ -238,7 +238,7 @@ func (c *EtcdBackend) List(ctx context.Context, prefix string) ([]string, error)
ctx, cancel := context.WithTimeout(context.Background(), c.requestTimeout)
defer cancel()
prefix = path.Join(c.path, prefix) + "/"
resp, err := c.etcd.Get(ctx, prefix, clientv3.WithPrefix())
resp, err := c.etcd.Get(ctx, prefix, clientv3.WithPrefix(), clientv3.WithKeysOnly())
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion physical/etcd/etcd3_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func TestEtcd3Backend(t *testing.T) {
"username": "root",
"password": "insecure",

// Syncing adverticed client urls should be disabled since docker port mapping confuses the client.
// Syncing advertised client urls should be disabled since docker port mapping confuses the client.
"sync": "false",
}

Expand Down

0 comments on commit 9307573

Please sign in to comment.