Skip to content

Commit

Permalink
fix: Add seconds unit to CSQL_PROXY_MAX_SIGTERM_DELAY value. (#611)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mlallaouret authored Jul 24, 2024
1 parent 617810e commit c4eb455
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/workload/podspec_updates.go
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,7 @@ func (s *updateState) applyContainerSpec(p *cloudsqlapi.AuthProxyWorkload, c *co
}
if p.Spec.AuthProxyContainer.MaxSigtermDelay != nil &&
*p.Spec.AuthProxyContainer.MaxSigtermDelay != 0 {
s.addProxyContainerEnvVar(p, "CSQL_PROXY_MAX_SIGTERM_DELAY", fmt.Sprintf("%d", *p.Spec.AuthProxyContainer.MaxSigtermDelay))
s.addProxyContainerEnvVar(p, "CSQL_PROXY_MAX_SIGTERM_DELAY", fmt.Sprintf("%ds", *p.Spec.AuthProxyContainer.MaxSigtermDelay))
}

return
Expand Down
2 changes: 1 addition & 1 deletion internal/workload/podspec_updates_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@ func TestProxyCLIArgs(t *testing.T) {
"CSQL_PROXY_PROMETHEUS": "true",
"CSQL_PROXY_QUOTA_PROJECT": "qp",
"CSQL_PROXY_MAX_CONNECTIONS": "10",
"CSQL_PROXY_MAX_SIGTERM_DELAY": "20",
"CSQL_PROXY_MAX_SIGTERM_DELAY": "20s",
"CSQL_PROXY_IMPERSONATE_SERVICE_ACCOUNT": "[email protected],[email protected]",
"CSQL_PROXY_QUIET": "true",
"CSQL_PROXY_STRUCTURED_LOGS": "true",
Expand Down

0 comments on commit c4eb455

Please sign in to comment.