Skip to content

Commit 971f6fd

Browse files
authored
fix: convert timeout fields to string (#3582)
fix: timeout must be typed as string
1 parent 29b9dac commit 971f6fd

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

internal/postgresConfig/update/update.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"bytes"
55
"context"
66
"encoding/json"
7+
"fmt"
78
"strconv"
89
"strings"
910

@@ -53,6 +54,12 @@ func Run(ctx context.Context, projectRef string, values []string, replaceOverrid
5354
if noRestart {
5455
finalOverrides["restart_database"] = false
5556
}
57+
// statement_timeout and wal_sender_timeout must be typed as string
58+
for k, v := range finalOverrides {
59+
if _, ok := v.(string); strings.HasSuffix(k, "_timeout") && !ok {
60+
finalOverrides[k] = fmt.Sprintf("%v", v)
61+
}
62+
}
5663
bts, err := json.Marshal(finalOverrides)
5764
if err != nil {
5865
return errors.Errorf("failed to serialize config overrides: %w", err)

0 commit comments

Comments
 (0)