Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add back writethrough cache #2

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions flytepropeller/pkg/controller/executors/kube.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,13 @@ var NewClient = func(config *rest.Config, options client.Options) (client.Client
// create the k8s client
k8sClient, err := client.New(config, options)
if err != nil {
return k8sClient, err
return nil, err
}

k8sOtelClient := otelutils.WrapK8sClient(k8sClient)
k8sOtelClient, err := newWriteThroughCachingWriter(otelutils.WrapK8sClient(k8sClient), 50000)
if err != nil {
return nil, err
}

return k8sOtelClient, nil
}
Expand Down Expand Up @@ -126,8 +129,8 @@ func (w writeThroughCachingWriter) Delete(ctx context.Context, obj client.Object
return nil
}

func newWriteThroughCachingWriter(c client.Client, cacheSize int, scope promutils.Scope) (writeThroughCachingWriter, error) {
filter, err := fastcheck.NewOppoBloomFilter(cacheSize, scope.NewSubScope("kube_filter"))
func newWriteThroughCachingWriter(c client.Client, cacheSize int) (writeThroughCachingWriter, error) {
filter, err := fastcheck.NewOppoBloomFilter(cacheSize, promutils.NewScope("kube_filter"))
if err != nil {
return writeThroughCachingWriter{}, err
}
Expand Down
Loading