Skip to content

Commit

Permalink
Trim whitespace for password #patch (flyteorg#56)
Browse files Browse the repository at this point in the history
* Trim whitespace for password

When deploying Flyte on our EKS cluster, we encountered a problem
because we had a whitespace character, by trimming space, we should
avoid that problem. Also it doesn't trim space if it is percent-encoded.

Signed-off-by: stephen batifol <[email protected]>

* Add comment about percent-encoding

Signed-off-by: stephen batifol <[email protected]>
  • Loading branch information
stephen37 authored Nov 3, 2021
1 parent b89587c commit 90c45ee
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion 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"

dbconfig "github.com/flyteorg/datacatalog/pkg/repositories/config"
"github.com/flyteorg/datacatalog/pkg/runtime/configs"
Expand Down Expand Up @@ -38,7 +39,9 @@ func (p *ApplicationConfigurationProvider) GetDbConfig() dbconfig.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 dbconfig.DbConfig{
Expand Down

0 comments on commit 90c45ee

Please sign in to comment.