mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-19 09:52:49 +00:00
Notify startup to grab a hold of handler and authenticator
Fix to the completed options config Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
This commit is contained in:
parent
f85ab51843
commit
4a8d567ced
@ -22,6 +22,7 @@ package app
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"os"
|
||||
|
||||
@ -30,6 +31,7 @@ import (
|
||||
utilerrors "k8s.io/apimachinery/pkg/util/errors"
|
||||
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
|
||||
"k8s.io/apiserver/pkg/admission"
|
||||
"k8s.io/apiserver/pkg/authentication/authenticator"
|
||||
genericapifilters "k8s.io/apiserver/pkg/endpoints/filters"
|
||||
genericapiserver "k8s.io/apiserver/pkg/server"
|
||||
"k8s.io/apiserver/pkg/server/egressselector"
|
||||
@ -140,6 +142,13 @@ cluster's shared state through which all other components interact.`,
|
||||
return cmd
|
||||
}
|
||||
|
||||
type startupConfig struct {
|
||||
Handler http.Handler
|
||||
Authenticator authenticator.Request
|
||||
}
|
||||
|
||||
var StartupConfig = make(chan startupConfig, 1)
|
||||
|
||||
// Run runs the specified APIServer. This should never exit.
|
||||
func Run(ctx context.Context, opts options.CompletedOptions, stopCh <-chan struct{}) error {
|
||||
// To help debugging, immediately log version
|
||||
@ -189,6 +198,12 @@ func CreateServerChain(config CompletedConfig) (*aggregatorapiserver.APIAggregat
|
||||
return nil, err
|
||||
}
|
||||
|
||||
StartupConfig <- startupConfig{
|
||||
Handler: aggregatorServer.GenericAPIServer.Handler,
|
||||
Authenticator: config.KubeAPIs.ControlPlane.Generic.Authentication.Authenticator,
|
||||
}
|
||||
close(StartupConfig)
|
||||
|
||||
return aggregatorServer, nil
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user