mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-13 13:55:41 +00:00
Notify startup to grab a hold of handler and authenticator
This commit is contained in:
parent
65a3ccec71
commit
c7b20dbaeb
@ -35,6 +35,7 @@ import (
|
||||
utilnet "k8s.io/apimachinery/pkg/util/net"
|
||||
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"
|
||||
@ -142,6 +143,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(opts options.CompletedOptions, stopCh <-chan struct{}) error {
|
||||
// To help debugging, immediately log version
|
||||
@ -191,6 +199,12 @@ func CreateServerChain(config CompletedConfig) (*aggregatorapiserver.APIAggregat
|
||||
return nil, err
|
||||
}
|
||||
|
||||
StartupConfig <- startupConfig{
|
||||
Handler: aggregatorServer.GenericAPIServer.Handler,
|
||||
Authenticator: config.ControlPlane.GenericConfig.Authentication.Authenticator,
|
||||
}
|
||||
close(StartupConfig)
|
||||
|
||||
return aggregatorServer, nil
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user