mirror of
https://github.com/grafana/grafana.git
synced 2024-12-28 01:41:24 -06:00
Chore: fixes for admisison handlers (#90033)
This commit is contained in:
parent
eef9a7b4e5
commit
844d575681
@ -48,8 +48,8 @@ func (s *Service) MutateAdmission(ctx context.Context, req *backend.AdmissionReq
|
||||
default:
|
||||
return getBadRequest(fmt.Sprintf("expected apiVersion: v0alpha1, found: %s", settings.APIVersion)), nil
|
||||
}
|
||||
if settings.URL != "" {
|
||||
return getBadRequest("unsupported URL value"), nil
|
||||
if settings.URL == "" {
|
||||
return getBadRequest("missing URL value"), nil
|
||||
}
|
||||
|
||||
pb, err := backend.DataSourceInstanceSettingsToProtoBytes(settings)
|
||||
|
@ -48,8 +48,8 @@ func (s *Service) MutateAdmission(ctx context.Context, req *backend.AdmissionReq
|
||||
default:
|
||||
return getBadRequest(fmt.Sprintf("expected apiVersion: v0alpha1, found: %s", settings.APIVersion)), nil
|
||||
}
|
||||
if settings.URL != "" {
|
||||
return getBadRequest("unsupported URL value"), nil
|
||||
if settings.URL == "" {
|
||||
return getBadRequest("missing URL value"), nil
|
||||
}
|
||||
|
||||
pb, err := backend.DataSourceInstanceSettingsToProtoBytes(settings)
|
||||
|
@ -45,6 +45,17 @@ func (s *Service) CheckHealth(ctx context.Context, req *backend.CheckHealthReque
|
||||
return s.lib.CheckHealth(ctx, req)
|
||||
}
|
||||
|
||||
func (s *Service) ValidateAdmission(ctx context.Context, req *backend.AdmissionRequest) (*backend.ValidationResponse, error) {
|
||||
return s.lib.ValidateAdmission(ctx, req)
|
||||
}
|
||||
|
||||
func (s *Service) MutateAdmission(ctx context.Context, req *backend.AdmissionRequest) (*backend.MutationResponse, error) {
|
||||
return s.lib.MutateAdmission(ctx, req)
|
||||
}
|
||||
func (s *Service) ConvertObject(ctx context.Context, req *backend.ConversionRequest) (*backend.ConversionResponse, error) {
|
||||
return s.lib.ConvertObject(ctx, req)
|
||||
}
|
||||
|
||||
func extendClientOpts(ctx context.Context, settings backend.DataSourceInstanceSettings, clientOpts *sdkhttpclient.Options) error {
|
||||
// Set SigV4 service namespace
|
||||
if clientOpts.SigV4 != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user