mirror of
https://github.com/grafana/grafana.git
synced 2024-11-21 16:38:03 -06:00
K8s: replace a noop certKey content func with actual if available (#84524)
This commit is contained in:
parent
fad6dc4db1
commit
dd7d4e2656
@ -30,6 +30,7 @@ import (
|
||||
utilnet "k8s.io/apimachinery/pkg/util/net"
|
||||
"k8s.io/apimachinery/pkg/util/sets"
|
||||
genericapiserver "k8s.io/apiserver/pkg/server"
|
||||
"k8s.io/apiserver/pkg/server/dynamiccertificates"
|
||||
"k8s.io/apiserver/pkg/server/healthz"
|
||||
"k8s.io/client-go/informers"
|
||||
"k8s.io/client-go/kubernetes/fake"
|
||||
@ -245,12 +246,25 @@ func CreateAggregatorServer(config *Config, delegateAPIServer genericapiserver.D
|
||||
return nil, err
|
||||
}
|
||||
|
||||
proxyCurrentCertKeyContentFunc := func() ([]byte, []byte) {
|
||||
return nil, nil
|
||||
}
|
||||
if len(config.KubeAggregatorConfig.ExtraConfig.ProxyClientCertFile) > 0 && len(config.KubeAggregatorConfig.ExtraConfig.ProxyClientKeyFile) > 0 {
|
||||
aggregatorProxyCerts, err := dynamiccertificates.NewDynamicServingContentFromFiles("aggregator-proxy-cert", config.KubeAggregatorConfig.ExtraConfig.ProxyClientCertFile, config.KubeAggregatorConfig.ExtraConfig.ProxyClientKeyFile)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
proxyCurrentCertKeyContentFunc = func() ([]byte, []byte) {
|
||||
return aggregatorProxyCerts.CurrentCertKeyContent()
|
||||
}
|
||||
}
|
||||
|
||||
availableController, err := NewAvailableConditionController(
|
||||
aggregatorServer.APIRegistrationInformers.Apiregistration().V1().APIServices(),
|
||||
externalNamesInformer,
|
||||
apiregistrationClient.ApiregistrationV1(),
|
||||
nil,
|
||||
(func() ([]byte, []byte))(nil),
|
||||
proxyCurrentCertKeyContentFunc,
|
||||
completedConfig.ExtraConfig.ServiceResolver,
|
||||
)
|
||||
if err != nil {
|
||||
|
@ -39,7 +39,7 @@ func (o *AggregatorServerOptions) AddFlags(fs *pflag.FlagSet) {
|
||||
"path to proxy client cert file")
|
||||
|
||||
fs.StringVar(&o.ProxyClientKeyFile, "proxy-client-key-file", o.ProxyClientKeyFile,
|
||||
"path to proxy client cert file")
|
||||
"path to proxy client key file")
|
||||
}
|
||||
|
||||
func (o *AggregatorServerOptions) Validate() []error {
|
||||
|
Loading…
Reference in New Issue
Block a user