Skip to content

Commit c50e354

Browse files
Handling string in value from config map
Signed-off-by: smartaquarius10 <[email protected]>
1 parent df42130 commit c50e354

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pkg/scalers/connectionpool/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func loadConfig() {
3434
return
3535
}
3636

37-
var parsed map[string]int32
37+
var parsed map[string]string
3838
if err := yaml.Unmarshal(data, &parsed); err != nil {
3939
logger.Error(err, "Invalid pool config format", "path", configPath)
4040
return

pkg/scalers/postgresql_scaler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ func getConnection(ctx context.Context, meta *postgreSQLMetadata, podIdentity ke
180180
}
181181
maxConns, err := strconv.ParseInt(connectionpool.LookupConfigValue("postgres", fmt.Sprintf("%s.%s", meta.Host, meta.DBName)), 10, 32)
182182
if err != nil {
183-
logger.Info("Invalid value in configmap; using default of max connections", "Server", meta.Host, "dbName", meta.DBName)
183+
logger.Info("Invalid value in configmap; set default max connection pool", "Server", meta.Host, "dbName", meta.DBName)
184184
maxConns = 0
185185
}
186186
logger.Info("Requesting PostgreSQL connection pool", "poolKey", poolKey, "maxConns", maxConns)

0 commit comments

Comments
 (0)