You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After rotating certificates with dapr mtls renew-certificate -k --restart, all control-plane services — including statefulsets/dapr-scheduler-server (part of the control plane since runtime 1.14) — are restarted, and any restart failure is reported with a non-zero exit code.
Actual Behavior
Three defects in cmd/renew_certificate.go (checked at 96dd71a):
The restart's error is silently discarded.restartControlPlaneService() returns an error, but the call site drops it, and the if err != nil beneath tests a stale variable that is provably nil at that point (a non-nil value would already have exited via logErrorAndExit a few lines up). A failed control-plane restart therefore still prints "Certificate rotation is successful!" and exits 0 (cmd/renew_certificate.go#L126-L141).
Namespace lookup failure is ignored. If kubernetes.GetDaprNamespace() fails, the failure is printed (to stdout) and execution continues, producing kubectl rollout restart -n "" (cmd/renew_certificate.go#L179-L182).
Combined effect: in exactly the scenario this flag exists for — production certificate rotation — every failure mode is swallowed and the operator walks away believing the control plane picked up the new certificates.
Steps to Reproduce the Problem
dapr init -k on a cluster with runtime >= 1.14 (scheduler present).
Observe that statefulsets/dapr-scheduler-server is never restarted, and that any kubectl failure during the restart step still yields the success message and exit code 0.
I have a fix ready and will open a PR right after filing this.
Release Note
RELEASE NOTE: FIXdapr mtls renew-certificate --restart now restarts the scheduler statefulset and fails with a non-zero exit code when any control-plane restart fails.
Expected Behavior
After rotating certificates with
dapr mtls renew-certificate -k --restart, all control-plane services — includingstatefulsets/dapr-scheduler-server(part of the control plane since runtime 1.14) — are restarted, and any restart failure is reported with a non-zero exit code.Actual Behavior
Three defects in
cmd/renew_certificate.go(checked at96dd71a):restartControlPlaneService()returns an error, but the call site drops it, and theif err != nilbeneath tests a stale variable that is provably nil at that point (a non-nil value would already have exited vialogErrorAndExita few lines up). A failed control-plane restart therefore still prints "Certificate rotation is successful!" and exits 0 (cmd/renew_certificate.go#L126-L141).statefulsets/dapr-scheduler-server(cmd/renew_certificate.go#L172-L178). This was reported from the field in dapr mtls renew-certificate -k --valid-until <days> --restart did not restart statefulsets/dapr-scheduler-server #1574, which was closed by the stale bot without a fix.kubernetes.GetDaprNamespace()fails, the failure is printed (to stdout) and execution continues, producingkubectl rollout restart -n ""(cmd/renew_certificate.go#L179-L182).Combined effect: in exactly the scenario this flag exists for — production certificate rotation — every failure mode is swallowed and the operator walks away believing the control plane picked up the new certificates.
Steps to Reproduce the Problem
dapr init -kon a cluster with runtime >= 1.14 (scheduler present).dapr mtls renew-certificate -k --valid-until 365 --restartstatefulsets/dapr-scheduler-serveris never restarted, and that anykubectlfailure during the restart step still yields the success message and exit code 0.I have a fix ready and will open a PR right after filing this.
Release Note
RELEASE NOTE: FIX
dapr mtls renew-certificate --restartnow restarts the scheduler statefulset and fails with a non-zero exit code when any control-plane restart fails.