Skip to content

Commit 1ff9bef

Browse files
authored
PMM-10265: fallback to original DSN if it is non-URI (#516)
* fallback to original DSN if it is non-URI * fix test * revert
1 parent 53a526b commit 1ff9bef

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

exporter/dsn_fix/dsn_fix.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ package dsn_fix
1919
import (
2020
"net/url"
2121

22-
"github.com/pkg/errors"
2322
"go.mongodb.org/mongo-driver/mongo/options"
2423
)
2524

@@ -31,7 +30,8 @@ func ClientOptionsForDSN(dsn string) (*options.ClientOptions, error) {
3130
// if username or password is set, need to replace it with correctly parsed credentials.
3231
parsedDsn, err := url.Parse(dsn)
3332
if err != nil {
34-
return nil, errors.Wrap(err, "cannot parse DSN")
33+
// for non-URI, do nothing (PMM-10265)
34+
return clientOptions, nil
3535
}
3636
username := parsedDsn.User.Username()
3737
password, _ := parsedDsn.User.Password()

0 commit comments

Comments
 (0)