Skip to content

Commit

Permalink
Trim whitespace for password #patch (flyteorg#281)
Browse files Browse the repository at this point in the history
Same as flyteorg/datacatalog#56

Signed-off-by: stephen batifol <[email protected]>
  • Loading branch information
stephen37 authored Nov 5, 2021
1 parent 86afca1 commit a768414
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion flyteadmin/pkg/runtime/application_config_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"io/ioutil"
"os"
"strings"

"github.com/flyteorg/flyteadmin/pkg/common"
"github.com/flyteorg/flyteadmin/pkg/runtime/interfaces"
Expand Down Expand Up @@ -97,7 +98,9 @@ func (p *ApplicationConfigurationProvider) GetDbConfig() interfaces.DbConfig {
logger.Fatalf(context.Background(), "failed to read database password from path [%s] with err: %v",
dbConfigSection.PasswordPath, err)
}
password = string(passwordVal)
// Passwords can contain special characters as long as they are percent encoded
// https://www.postgresql.org/docs/current/libpq-connect.html
password = strings.TrimSpace(string(passwordVal))
}
return interfaces.DbConfig{
Host: dbConfigSection.Host,
Expand Down

0 comments on commit a768414

Please sign in to comment.