Skip to content

Commit

Permalink
apply ci suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
defbin authored and Dmytro Zghoba committed Mar 8, 2023
1 parent ad089e6 commit 856ca36
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
8 changes: 2 additions & 6 deletions e2e-tests/pkg/tests/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,7 @@ type Credentials struct {
}

func ExtractCredentionals(s string) *Credentials {
if strings.HasPrefix(s, "mongodb://") {
s = s[len("mongodb://"):]
}

auth, _, _ := strings.Cut(s, "@")
auth, _, _ := strings.Cut(strings.TrimPrefix(s, "mongodb://"), "@")
usr, pwd, _ := strings.Cut(auth, ":")
if usr == "" {
return nil
Expand Down Expand Up @@ -366,7 +362,7 @@ func getConfigChunkHashes(ctx context.Context, m *mongo.Client, selection map[st
} else {
id = cur.Current.Lookup("ns").StringValue()
}
hashes[id].(hash.Hash).Write(cur.Current)
hashes[id].Write(cur.Current)
counts[id][cur.Current.Lookup("shard").StringValue()]++
}
if err := cur.Err(); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pbm/sel/sel.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func (s uuidChunkMap) BuildFilter() bson.D {
uuids := make([]primitive.Binary, 0, len(s))
for ns := range s {
data, _ := hex.DecodeString(ns)
uuids = append(uuids, primitive.Binary{0x4, data})
uuids = append(uuids, primitive.Binary{Subtype: 0x4, Data: data})
}

return bson.D{{"uuid", bson.M{"$in": uuids}}}
Expand Down

0 comments on commit 856ca36

Please sign in to comment.