Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSL enabled database connection for workflow repository (#1712) #1756

Merged
merged 2 commits into from
Dec 4, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions workflow/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ type PostgreSQLConfig struct {
TableName string `json:"tableName"`
UsernameSecret apiv1.SecretKeySelector `json:"userNameSecret"`
PasswordSecret apiv1.SecretKeySelector `json:"passwordSecret"`
SSL bool `json:"ssl,omitempty"`
}

type MySQLConfig struct {
Expand Down
8 changes: 8 additions & 0 deletions workflow/persist/sqldb/sqldb.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,14 @@ func CreatePostGresDBSession(kubectlConfig kubernetes.Interface, namespace strin
Host: postgresConfig.Host + ":" + postgresConfig.Port,
Database: postgresConfig.Database,
}

if postgresConfig.SSL {
var options := map[string]string{
"sslmode": "true"
}
settings.Options = options
}
AntoineDao marked this conversation as resolved.
Show resolved Hide resolved

session, err := postgresql.Open(settings)

if err != nil {
Expand Down