Skip to content

Commit

Permalink
feat: use correct designation for postgres jdbc url: jdbc:postgresql
Browse files Browse the repository at this point in the history
  • Loading branch information
Muni10 committed Dec 22, 2024
1 parent 477bbb3 commit 6bcfac2
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pkg/resourcecreator/google/sql/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const (
googleSQLPostgresHost = "127.0.0.1"
googleSQLPostgresPort = "5432"
googleSQLPostgresURL = "postgres://%s:%s@%s:%s/%s"
googleSQLPostgresJDBCURL = "jdbc:postgres://%s:%s/%s?user=%s&password=%s"
googleSQLPostgresJDBCURL = "jdbc:postgresql://%s:%s/%s?user=%s&password=%s"
)

type GoogleSqlUser struct {
Expand Down
6 changes: 3 additions & 3 deletions pkg/resourcecreator/google/sql/user_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func TestGoogleSQLUserEnvVars(t *testing.T) {
"NAIS_DATABASE_FOO_BAR_USERNAME": "foo",
"NAIS_DATABASE_FOO_BAR_PASSWORD": "password",
"NAIS_DATABASE_FOO_BAR_URL": "postgres://foo:password@127.0.0.1:5432/bar",
"NAIS_DATABASE_FOO_BAR_JDBC_URL": "jdbc:postgres://127.0.0.1:5432/bar?user=foo&password=password",
"NAIS_DATABASE_FOO_BAR_JDBC_URL": "jdbc:postgresql://127.0.0.1:5432/bar?user=foo&password=password",
},
},
{
Expand All @@ -51,7 +51,7 @@ func TestGoogleSQLUserEnvVars(t *testing.T) {
want: map[string]string{
"YOLO_PASSWORD": "password",
"YOLO_URL": "postgres://foo:password@127.0.0.1:5432/bar",
"YOLO_JDBC_URL": "jdbc:postgres://127.0.0.1:5432/bar?user=foo&password=password",
"YOLO_JDBC_URL": "jdbc:postgresql://127.0.0.1:5432/bar?user=foo&password=password",
"YOLO_USERNAME": "foo",
"YOLO_HOST": "127.0.0.1",
"YOLO_PORT": "5432",
Expand All @@ -69,7 +69,7 @@ func TestGoogleSQLUserEnvVars(t *testing.T) {
want: map[string]string{
"YOLO_USER_TWO_PASSWORD": "password",
"YOLO_USER_TWO_URL": "postgres://user-two:password@127.0.0.1:5432/bar",
"YOLO_USER_TWO_JDBC_URL": "jdbc:postgres://127.0.0.1:5432/bar?user=user-two&password=password",
"YOLO_USER_TWO_JDBC_URL": "jdbc:postgresql://127.0.0.1:5432/bar?user=user-two&password=password",
"YOLO_USER_TWO_USERNAME": "user-two",
"YOLO_USER_TWO_HOST": "127.0.0.1",
"YOLO_USER_TWO_PORT": "5432",
Expand Down
2 changes: 1 addition & 1 deletion pkg/resourcecreator/testdata/gcp_database.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ tests:
NAIS_DATABASE_MYAPPLICATION_MYDB_PASSWORD: ".{43}"
NAIS_DATABASE_MYAPPLICATION_MYDB_PORT: "5432"
NAIS_DATABASE_MYAPPLICATION_MYDB_URL: postgres://myapplication:.{43}@127.0.0.1:5432/mydb
NAIS_DATABASE_MYAPPLICATION_MYDB_JDBC_URL: jdbc:postgres://127.0.0.1:5432/mydb\?user=myapplication&password=.{43}
NAIS_DATABASE_MYAPPLICATION_MYDB_JDBC_URL: jdbc:postgresql://127.0.0.1:5432/mydb\?user=myapplication&password=.{43}
NAIS_DATABASE_MYAPPLICATION_MYDB_USERNAME: myapplication
type: Opaque
- apiVersion: sql.cnrm.cloud.google.com/v1beta1
Expand Down
2 changes: 1 addition & 1 deletion pkg/resourcecreator/testdata/gcp_database_custom_env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ tests:
PWNED_PASSWORD: ".{43}"
PWNED_PORT: "5432"
PWNED_URL: postgres://myapplication:.{43}@127.0.0.1:5432/mydb
PWNED_JDBC_URL: jdbc:postgres://127.0.0.1:5432/mydb\?user=myapplication&password=.{43}
PWNED_JDBC_URL: jdbc:postgresql://127.0.0.1:5432/mydb\?user=myapplication&password=.{43}
PWNED_USERNAME: myapplication
type: Opaque
- apiVersion: sql.cnrm.cloud.google.com/v1beta1
Expand Down

0 comments on commit 6bcfac2

Please sign in to comment.