Unverified Commit 7f1f3076 authored by Julien Mancuso's avatar Julien Mancuso Committed by GitHub
Browse files

fix: fix operator race condition (#6929)


Signed-off-by: default avatarJulien Mancuso <jmancuso@nvidia.com>
parent 876c9761
......@@ -131,8 +131,13 @@ func (cm *CertManager) setupAutoProvisioning(ctx context.Context, mgr ctrl.Manag
fmt.Sprintf("%s.%s", cm.cfg.ServiceName, cm.namespace),
fmt.Sprintf("%s.%s.svc.cluster.local", cm.cfg.ServiceName, cm.namespace),
},
EnableReadinessCheck: true,
RestartOnSecretRefresh: true,
EnableReadinessCheck: true,
// RestartOnSecretRefresh is intentionally false (default). The rotator's
// ensureCertsMounted goroutine polls CertDir until the kubelet projects
// the updated secret, then closes IsReady. The webhook server is only
// started after IsReady fires, so the files are guaranteed to exist.
// Setting this to true would call os.Exit immediately after writing the
// secret, racing the kubelet volume projection on restart.
}
return cm.provisioner.AddRotator(mgr, rotator)
}
......
......@@ -185,8 +185,7 @@ func TestCertManager_AutoModeConfiguresRotator(t *testing.T) {
fmt.Sprintf("%s.%s", testServiceName, testNamespace),
fmt.Sprintf("%s.%s.svc.cluster.local", testServiceName, testNamespace),
},
EnableReadinessCheck: true,
RestartOnSecretRefresh: true,
EnableReadinessCheck: true,
}
if !reflect.DeepEqual(prov.capturedArgs, expected) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment