Compare commits

...

1 Commits

Author SHA1 Message Date
Alex Jones
08c2c1ce2d chore: added more logging
Signed-off-by: Alex Jones <alex@alexs-mbp.home>
2023-08-27 19:26:21 +01:00

View File

@@ -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