etcd: client: str: We do not want the prefix match

This was a likely copy+pasta error, since we match precise strings here.
If we had two similarly prefixed strings, we'd have an error.
This commit is contained in:
James Shubin
2025-05-24 21:03:59 -04:00
parent 876834ff29
commit d2403d2f0c

View File

@@ -62,7 +62,7 @@ func WatchStr(ctx context.Context, client interfaces.Client, key string) (chan e
func GetStr(ctx context.Context, client interfaces.Client, key string) (string, error) { func GetStr(ctx context.Context, client interfaces.Client, key string) (string, error) {
// new key structure is $NS/strings/$key = $data // new key structure is $NS/strings/$key = $data
path := fmt.Sprintf("%s/strings/%s", ns, key) path := fmt.Sprintf("%s/strings/%s", ns, key)
keyMap, err := client.Get(ctx, path, etcd.WithPrefix()) keyMap, err := client.Get(ctx, path)
if err != nil { if err != nil {
return "", errwrap.Wrapf(err, "could not get strings in: %s", key) return "", errwrap.Wrapf(err, "could not get strings in: %s", key)
} }