mirror of
https://github.com/k8sgpt-ai/k8sgpt.git
synced 2026-03-18 19:17:25 +00:00
Compare commits
1 Commits
release-pl
...
feat/cache
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
08c2c1ce2d |
@@ -3,7 +3,7 @@ package server
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
|
||||
"fmt"
|
||||
schemav1 "buf.build/gen/go/k8sgpt-ai/k8sgpt/protocolbuffers/go/schema/v1"
|
||||
"github.com/k8sgpt-ai/k8sgpt/pkg/cache"
|
||||
)
|
||||
@@ -14,11 +14,14 @@ func (h *handler) AddConfig(ctx context.Context, i *schemav1.AddConfigRequest) (
|
||||
return nil, errors.New("BucketName & Region are required")
|
||||
}
|
||||
|
||||
|
||||
err := cache.AddRemoteCache(i.Cache.BucketName, i.Cache.Region)
|
||||
if err != nil {
|
||||
return &schemav1.AddConfigResponse{}, err
|
||||
}
|
||||
|
||||
fmt.Println(fmt.Sprintf("Adding remote cache with bucket name: %s and region: %s", i.Cache.BucketName, i.Cache.Region))
|
||||
|
||||
return &schemav1.AddConfigResponse{
|
||||
Status: "Configuration updated.",
|
||||
}, nil
|
||||
@@ -31,6 +34,7 @@ func (h *handler) RemoveConfig(ctx context.Context, i *schemav1.RemoveConfigRequ
|
||||
return &schemav1.RemoveConfigResponse{}, err
|
||||
}
|
||||
|
||||
fmt.Println(fmt.Sprintf("Removing remote cache with bucket name: %s", i.Cache.BucketName))
|
||||
return &schemav1.RemoveConfigResponse{
|
||||
Status: "Successfully removed the remote cache",
|
||||
}, nil
|
||||
|
||||
Reference in New Issue
Block a user