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 ...@@ -3,7 +3,6 @@ package cmds
import ( import (
"context" "context"
"github.com/rancher/k3s/pkg/daemons/config"
"github.com/rancher/k3s/pkg/version" "github.com/rancher/k3s/pkg/version"
"github.com/urfave/cli" "github.com/urfave/cli"
) )
...@@ -60,7 +59,7 @@ type Server struct { ...@@ -60,7 +59,7 @@ type Server struct {
ClusterReset bool ClusterReset bool
ClusterResetRestorePath string ClusterResetRestorePath string
EncryptSecrets bool EncryptSecrets bool
StartupHooks []func(context.Context, config.Control) error StartupHooks []func(context.Context, <-chan struct{}, string) error
EtcdDisableSnapshots bool EtcdDisableSnapshots bool
EtcdSnapshotDir string EtcdSnapshotDir string
EtcdSnapshotCron string EtcdSnapshotCron string
......
...@@ -61,7 +61,7 @@ func StartServer(ctx context.Context, config *Config) error { ...@@ -61,7 +61,7 @@ func StartServer(ctx context.Context, config *Config) error {
} }
for _, hook := range config.StartupHooks { 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") return errors.Wrap(err, "startup hook")
} }
} }
......
...@@ -12,5 +12,5 @@ type Config struct { ...@@ -12,5 +12,5 @@ type Config struct {
ControlConfig config.Control ControlConfig config.Control
Rootless bool Rootless bool
SupervisorPort int 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