Sync DisableKubeProxy into control struct

Sync DisableKubeProxy from cfg into control before sending control to clients,
as it may have been modified by a startup hook.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
This commit is contained in:
Brad Davidson
2021-07-28 13:56:59 -07:00
committed by Brad Davidson
parent 09457a57d5
commit 869b98bc4c
3 changed files with 12 additions and 6 deletions

View File

@@ -49,7 +49,7 @@ func ResolveDataDir(dataDir string) (string, error) {
return filepath.Join(dataDir, "server"), err
}
func StartServer(ctx context.Context, config *Config) error {
func StartServer(ctx context.Context, config *Config, cfg *cmds.Server) error {
if err := setupDataDirAndChdir(&config.ControlConfig); err != nil {
return err
}
@@ -65,7 +65,7 @@ func StartServer(ctx context.Context, config *Config) error {
wg := &sync.WaitGroup{}
wg.Add(len(config.StartupHooks))
config.ControlConfig.Runtime.Handler = router(ctx, config)
config.ControlConfig.Runtime.Handler = router(ctx, config, cfg)
shArgs := cmds.StartupHookArgs{
APIServerReady: config.ControlConfig.Runtime.APIServerReady,
KubeConfigAdmin: config.ControlConfig.Runtime.KubeConfigAdmin,