mirror of
https://github.com/k3s-io/k3s.git
synced 2026-06-09 00:33:35 -04:00
Fix cert startup check events
Ensure that cert checks don't run until after the apiserver is ready to receive events Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
This commit is contained in:
parent
f62f1d6c91
commit
3d4c2cf2cf
1 changed files with 4 additions and 0 deletions
|
|
@ -11,6 +11,7 @@ import (
|
|||
|
||||
daemonconfig "github.com/k3s-io/k3s/pkg/daemons/config"
|
||||
"github.com/k3s-io/k3s/pkg/daemons/control/deps"
|
||||
"github.com/k3s-io/k3s/pkg/daemons/executor"
|
||||
"github.com/k3s-io/k3s/pkg/metrics"
|
||||
"github.com/k3s-io/k3s/pkg/util"
|
||||
"github.com/k3s-io/k3s/pkg/util/services"
|
||||
|
|
@ -84,6 +85,9 @@ func Setup(ctx context.Context, nodeConfig *daemonconfig.Node, dataDir string) e
|
|||
}
|
||||
|
||||
go wait.Until(func() {
|
||||
// don't check and create events until after the apiserver is up, otherwise the events may be lost.
|
||||
<-executor.APIServerReadyChan()
|
||||
|
||||
logrus.Debugf("Running %s certificate expiration check", controllerName)
|
||||
var hasErr bool
|
||||
if err := checkCerts(nodeMap, time.Hour*24*daemonconfig.CertificateRenewDays); err != nil {
|
||||
|
|
|
|||
Loading…
Reference in a new issue