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
Brian Downs 2020-09-04 09:30:36 -07:00 committed by GitHub
parent 289ba8df6a
commit 4c3ec907ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 4 deletions

View File

@ -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 {
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

View File

@ -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")
} }
} }

View File

@ -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
} }