Files
grafana/pkg/services/apiserver/options/ready-roundtripper.go
Charandas aa2cf8e398 Remove kube-aggregator from OSS (#103659)
* feat: remove kube-aggregator for OSS and provide injection points with runner iface

* upgrade authlib to support expiresIn

* new FT

* new FT again

* update go.mod

* get rid of the slice implementation

* reconcile conflicts

* gracefully handle enterprise not being linked situation with kubeAggregator FT true

* allow dataplane agg and kube agg to both be added to delegate chain

* make update-workspace

* address feedback

* revert go.mod changes

* go.mod updates

* elaborate on why and how of skipping the Ready channel handling

* after rebase and make run
2025-05-15 11:14:23 -07:00

22 lines
618 B
Go

package options
import (
"net/http"
)
// NOTE: both dataplane aggregator and kubernetes aggregator (when enterprise is linked) have logic around
// setting this RoundTripper as ready, however, kubernetes aggregator part is skipped naturally,
// given it is invoked as part of the delegate chain headed by the dataplane aggregator, and not through
// its own Run method.
type RoundTripperFunc struct {
Ready chan struct{}
Fn func(req *http.Request) (*http.Response, error)
}
func (f *RoundTripperFunc) RoundTrip(req *http.Request) (*http.Response, error) {
if f.Fn == nil {
<-f.Ready
}
return f.Fn(req)
}