Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions pkg/rotator/rotator.go
Original file line number Diff line number Diff line change
Expand Up @@ -339,8 +339,7 @@ func (cr *CertRotator) refreshCertIfNeeded() (bool, error) {
rotatedCA = true
crLog.Info("server certs refreshed")
if cr.RestartOnSecretRefresh {
crLog.Info("Secrets have been updated; exiting so pod can be restarted (This behaviour can be changed with the option RestartOnSecretRefresh)")
os.Exit(0)
crLog.Info("Secrets have been updated; RestartOnSecretRefresh is deprecated and ignored to avoid restart loops")
}
Comment on lines 341 to 343

Copilot AI Apr 9, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RestartOnSecretRefresh is now effectively a no-op but the only signal to callers is a runtime log. Since this is an exported field, consider adding a GoDoc deprecation marker (e.g., a Deprecated: comment on the field or type) so API consumers and linters can detect the deprecation without relying on logs.

Copilot uses AI. Check for mistakes.
return true, nil
Comment on lines 339 to 344

Copilot AI Apr 9, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are existing rotator tests, but none cover the RestartOnSecretRefresh behavior. Adding a unit/integration test that sets RestartOnSecretRefresh: true and triggers a cert refresh would guard against regressions (e.g., reintroducing process termination) and validate the new no-op semantics.

Copilot uses AI. Check for mistakes.
}
Expand All @@ -353,8 +352,7 @@ func (cr *CertRotator) refreshCertIfNeeded() (bool, error) {
}
crLog.Info("server certs refreshed")
if cr.RestartOnSecretRefresh {
crLog.Info("Secrets have been updated; exiting so pod can be restarted (This behaviour can be changed with the option RestartOnSecretRefresh)")
os.Exit(0)
crLog.Info("Secrets have been updated; RestartOnSecretRefresh is deprecated and ignored to avoid restart loops")
}
Comment on lines 341 to 356

Copilot AI Apr 9, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same deprecation log message is duplicated in both refresh paths. Consider extracting the message (const or small helper) to avoid future divergence and make it easier to update/translate consistently.

Copilot uses AI. Check for mistakes.
return true, nil
}
Expand Down
Loading