Skip to content

Commit c4eb455

Browse files
authored
fix: Add seconds unit to CSQL_PROXY_MAX_SIGTERM_DELAY value. (#611)
The sigterm delay duration needs to include the unit seconds (for example: `30s` instead of `30`). This will allow the value to be parsed as a golang duration. Fixes #610
1 parent 617810e commit c4eb455

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

internal/workload/podspec_updates.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,7 @@ func (s *updateState) applyContainerSpec(p *cloudsqlapi.AuthProxyWorkload, c *co
743743
}
744744
if p.Spec.AuthProxyContainer.MaxSigtermDelay != nil &&
745745
*p.Spec.AuthProxyContainer.MaxSigtermDelay != 0 {
746-
s.addProxyContainerEnvVar(p, "CSQL_PROXY_MAX_SIGTERM_DELAY", fmt.Sprintf("%d", *p.Spec.AuthProxyContainer.MaxSigtermDelay))
746+
s.addProxyContainerEnvVar(p, "CSQL_PROXY_MAX_SIGTERM_DELAY", fmt.Sprintf("%ds", *p.Spec.AuthProxyContainer.MaxSigtermDelay))
747747
}
748748

749749
return

internal/workload/podspec_updates_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,7 @@ func TestProxyCLIArgs(t *testing.T) {
696696
"CSQL_PROXY_PROMETHEUS": "true",
697697
"CSQL_PROXY_QUOTA_PROJECT": "qp",
698698
"CSQL_PROXY_MAX_CONNECTIONS": "10",
699-
"CSQL_PROXY_MAX_SIGTERM_DELAY": "20",
699+
"CSQL_PROXY_MAX_SIGTERM_DELAY": "20s",
700700
"CSQL_PROXY_IMPERSONATE_SERVICE_ACCOUNT": "[email protected],[email protected]",
701701
"CSQL_PROXY_QUIET": "true",
702702
"CSQL_PROXY_STRUCTURED_LOGS": "true",

0 commit comments

Comments
 (0)