mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
K8s: resolve crash due to looking up aggregation config when running in a K8s environment (#82125)
K8s: apply authn options only in dev mode - resolves crash due to looking up aggregation config
This commit is contained in:
parent
1ecf9faded
commit
117a4b4b0a
@ -55,8 +55,12 @@ func (o *Options) Validate() []error {
|
||||
return errs
|
||||
}
|
||||
|
||||
if errs := o.RecommendedOptions.Authentication.Validate(); len(errs) != 0 {
|
||||
return errs
|
||||
if o.ExtraOptions.DevMode {
|
||||
// NOTE: Only consider authn for dev mode - resolves the failure due to missing extension apiserver auth-config
|
||||
// in parent k8s
|
||||
if errs := o.RecommendedOptions.Authentication.Validate(); len(errs) != 0 {
|
||||
return errs
|
||||
}
|
||||
}
|
||||
|
||||
if o.StorageOptions.StorageType == StorageTypeEtcd {
|
||||
@ -83,8 +87,12 @@ func (o *Options) ApplyTo(serverConfig *genericapiserver.RecommendedConfig) erro
|
||||
return err
|
||||
}
|
||||
|
||||
if err := o.RecommendedOptions.Authentication.ApplyTo(&serverConfig.Authentication, serverConfig.SecureServing, serverConfig.OpenAPIConfig); err != nil {
|
||||
return err
|
||||
if o.ExtraOptions.DevMode {
|
||||
// NOTE: Only consider authn for dev mode - resolves the failure due to missing extension apiserver auth-config
|
||||
// in parent k8s
|
||||
if err := o.RecommendedOptions.Authentication.ApplyTo(&serverConfig.Authentication, serverConfig.SecureServing, serverConfig.OpenAPIConfig); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if !o.ExtraOptions.DevMode {
|
||||
|
Loading…
Reference in New Issue
Block a user