mirror of https://github.com/k3s-io/k3s
remove k8s daemon config from setup hook in favor of specific fields from the config (#2206)
Signed-off-by: Brian Downs <brian.downs@gmail.com>pull/2209/head
parent
289ba8df6a
commit
4c3ec907ab
|
@ -3,7 +3,6 @@ package cmds
|
|||
import (
|
||||
"context"
|
||||
|
||||
"github.com/rancher/k3s/pkg/daemons/config"
|
||||
"github.com/rancher/k3s/pkg/version"
|
||||
"github.com/urfave/cli"
|
||||
)
|
||||
|
@ -60,7 +59,7 @@ type Server struct {
|
|||
ClusterReset bool
|
||||
ClusterResetRestorePath string
|
||||
EncryptSecrets bool
|
||||
StartupHooks []func(context.Context, config.Control) error
|
||||
StartupHooks []func(context.Context, <-chan struct{}, string) error
|
||||
EtcdDisableSnapshots bool
|
||||
EtcdSnapshotDir string
|
||||
EtcdSnapshotCron string
|
||||
|
|
|
@ -61,7 +61,7 @@ func StartServer(ctx context.Context, config *Config) error {
|
|||
}
|
||||
|
||||
for _, hook := range config.StartupHooks {
|
||||
if err := hook(ctx, config.ControlConfig); err != nil {
|
||||
if err := hook(ctx, config.ControlConfig.Runtime.APIServerReady, config.ControlConfig.Runtime.KubeConfigAdmin); err != nil {
|
||||
return errors.Wrap(err, "startup hook")
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,5 +12,5 @@ type Config struct {
|
|||
ControlConfig config.Control
|
||||
Rootless bool
|
||||
SupervisorPort int
|
||||
StartupHooks []func(context.Context, config.Control) error
|
||||
StartupHooks []func(context.Context, <-chan struct{}, string) error
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue