Unverified Commit 4c3ec907 authored by Brian Downs's avatar Brian Downs Committed by GitHub

remove k8s daemon config from setup hook in favor of specific fields from the config (#2206)

parent 289ba8df
......@@ -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
}
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