K8s: refactor build handler chain func to allow easier injection from enterprise (#100777)

This commit is contained in:
Charandas
2025-02-14 18:08:00 -08:00
committed by GitHub
parent e5b49a406f
commit ea788975e0
10 changed files with 50 additions and 51 deletions

View File

@ -36,6 +36,11 @@ func (o *KubeAggregatorOptions) AddFlags(fs *pflag.FlagSet) {
return
}
// the following two config variables are slated to be faded out in cloud deployments after which
// their scope is restricted to local development and non Grafana Cloud use-cases only
// leaving them unspecified leads to graceful behavior in grafana-aggregator
// and would work for configurations where the aggregated servers and aggregator are auth-less and trusting
// of each other
fs.StringVar(&o.ProxyClientCertFile, "proxy-client-cert-file", o.ProxyClientCertFile,
"path to proxy client cert file")
@ -101,9 +106,8 @@ func (o *KubeAggregatorOptions) ApplyTo(aggregatorConfig *aggregatorapiserver.Co
genericConfig.PostStartHooks = map[string]genericapiserver.PostStartHookConfigEntry{}
// These hooks use v1 informers, which are not available in the grafana aggregator.
genericConfig.DisabledPostStartHooks = genericConfig.DisabledPostStartHooks.Insert("apiservice-status-local-available-controller")
genericConfig.DisabledPostStartHooks = genericConfig.DisabledPostStartHooks.Insert("apiservice-status-remote-available-controller")
genericConfig.DisabledPostStartHooks = genericConfig.DisabledPostStartHooks.Insert("start-kube-aggregator-informers")
genericConfig.DisabledPostStartHooks = genericConfig.DisabledPostStartHooks.Insert("apiservice-status-local-available-controller")
return nil
}