From e1a3c8a148a624aa888b4612de3d1e5374576f0d Mon Sep 17 00:00:00 2001 From: Daniel Imberman Date: Thu, 23 Jan 2020 09:36:37 -0800 Subject: [PATCH] remove manually adding sslmode to connection string --- pkg/scalers/postgres_scaler.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pkg/scalers/postgres_scaler.go b/pkg/scalers/postgres_scaler.go index 65c840a69de..c9dc1dd1bdb 100644 --- a/pkg/scalers/postgres_scaler.go +++ b/pkg/scalers/postgres_scaler.go @@ -63,12 +63,12 @@ func parsePostgresMetadata(resolvedEnv, metadata, authParams map[string]string) } if val, ok := authParams["connStr"]; ok { - meta.connStr = val + "?sslmode=disable" + meta.connStr = val } else if val, ok := metadata["connStr"]; ok { hostSetting := val if val, ok := resolvedEnv[hostSetting]; ok { - meta.connStr = val + "?sslmode=disable" + meta.connStr = val } } else { meta.connStr = "" @@ -161,13 +161,11 @@ func (s *postGRESScaler) IsActive(ctx context.Context) (bool, error) { func (s *postGRESScaler) getActiveNumber() (int, error) { var id int - postgresLog.Info(fmt.Sprintf("Inspecting with query: %s", s.metadata.query)) err := s.connection.QueryRow(s.metadata.query).Scan(&id) if err != nil { postgresLog.Error(err, fmt.Sprintf("could not query PG: %s", err)) return 0, fmt.Errorf("could not query PG: %s", err) } - postgresLog.Info(fmt.Sprintf("Num expected: %d", id)) return id, nil }