mirror of
https://git.vectorsigma.ru/public/k3s.git
synced 2026-08-05 14:30:00 +00:00
This reverts commit 8a81349b2f.
This commit is contained in:
@@ -2,7 +2,6 @@ package cmds
|
||||
|
||||
import (
|
||||
"context"
|
||||
"sync"
|
||||
|
||||
"github.com/rancher/k3s/pkg/version"
|
||||
"github.com/urfave/cli"
|
||||
@@ -63,8 +62,7 @@ type Server struct {
|
||||
ClusterReset bool
|
||||
ClusterResetRestorePath string
|
||||
EncryptSecrets bool
|
||||
SystemDefaultRegistry string
|
||||
StartupHooks []func(context.Context, *sync.WaitGroup, <-chan struct{}, string) error
|
||||
StartupHooks []func(context.Context, <-chan struct{}, string) error
|
||||
EtcdSnapshotName string
|
||||
EtcdDisableSnapshots bool
|
||||
EtcdSnapshotDir string
|
||||
|
||||
@@ -11,7 +11,6 @@ import (
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
@@ -69,10 +68,8 @@ func StartServer(ctx context.Context, config *Config) error {
|
||||
return errors.Wrap(err, "starting tls server")
|
||||
}
|
||||
|
||||
config.StartupHooksWg = &sync.WaitGroup{}
|
||||
config.StartupHooksWg.Add(len(config.StartupHooks))
|
||||
for _, hook := range config.StartupHooks {
|
||||
if err := hook(ctx, config.StartupHooksWg, config.ControlConfig.Runtime.APIServerReady, config.ControlConfig.Runtime.KubeConfigAdmin); err != nil {
|
||||
if err := hook(ctx, config.ControlConfig.Runtime.APIServerReady, config.ControlConfig.Runtime.KubeConfigAdmin); err != nil {
|
||||
return errors.Wrap(err, "startup hook")
|
||||
}
|
||||
}
|
||||
@@ -130,7 +127,6 @@ func runControllers(ctx context.Context, config *Config) error {
|
||||
return err
|
||||
}
|
||||
|
||||
config.StartupHooksWg.Wait()
|
||||
if err := stageFiles(ctx, sc, controlConfig); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@ package server
|
||||
|
||||
import (
|
||||
"context"
|
||||
"sync"
|
||||
|
||||
"github.com/rancher/k3s/pkg/daemons/config"
|
||||
)
|
||||
@@ -13,8 +12,7 @@ type Config struct {
|
||||
ControlConfig config.Control
|
||||
Rootless bool
|
||||
SupervisorPort int
|
||||
StartupHooks []func(context.Context, *sync.WaitGroup, <-chan struct{}, string) error
|
||||
StartupHooksWg *sync.WaitGroup
|
||||
StartupHooks []func(context.Context, <-chan struct{}, string) error
|
||||
LeaderControllers CustomControllers
|
||||
Controllers CustomControllers
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user