Skip to content

Commit

Permalink
feat: add minio params to s3 cache (k8sgpt-ai#464)
Browse files Browse the repository at this point in the history
Signed-off-by: Shahrooz Aghili <[email protected]>
  • Loading branch information
aghilish committed Sep 30, 2024
1 parent 1f11912 commit 1731008
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 11 deletions.
3 changes: 3 additions & 0 deletions api/v1alpha1/k8sgpt_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ type RemoteCacheRef struct {
type S3Backend struct {
BucketName string `json:"bucketName,omitempty"`
Region string `json:"region,omitempty"`
Endpoint string `json:"endpoint,omitempty"`
// +kubebuilder:default:=false
Insecure bool `json:"insecure"`
}

type AzureBackend struct {
Expand Down
7 changes: 7 additions & 0 deletions config/crd/bases/core.k8sgpt.ai_k8sgpts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,15 @@ spec:
properties:
bucketName:
type: string
endpoint:
type: string
insecure:
default: false
type: boolean
region:
type: string
required:
- insecure
type: object
type: object
repository:
Expand Down
4 changes: 1 addition & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ require (
github.com/prometheus/client_golang v1.20.3
google.golang.org/grpc v1.65.0
gopkg.in/yaml.v2 v2.4.0
gopkg.in/yaml.v3 v3.0.1
k8s.io/api v0.29.3
k8s.io/apimachinery v0.29.3
k8s.io/cli-runtime v0.29.3
Expand All @@ -30,8 +29,6 @@ require (
)

require (
buf.build/gen/go/k8sgpt-ai/k8sgpt/connectrpc/go v1.17.0-20240920204244-7a91c8620515.1 // indirect
buf.build/gen/go/k8sgpt-ai/k8sgpt/grpc-ecosystem/gateway/v2 v2.22.0-20240920204244-7a91c8620515.1 // indirect
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
github.com/MakeNowJust/heredoc v1.0.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
Expand Down Expand Up @@ -101,6 +98,7 @@ require (
google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 // indirect
google.golang.org/protobuf v1.34.2 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apiextensions-apiserver v0.27.2 // indirect
k8s.io/component-base v0.29.3 // indirect
k8s.io/klog/v2 v2.110.1 // indirect
Expand Down
8 changes: 0 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
buf.build/gen/go/k8sgpt-ai/k8sgpt/connectrpc/go v1.17.0-20240920204244-7a91c8620515.1 h1:fvowVes7HyfrXBxJY7f9V5EW/Y/LNr4aZRv1GrMrjKw=
buf.build/gen/go/k8sgpt-ai/k8sgpt/connectrpc/go v1.17.0-20240920204244-7a91c8620515.1/go.mod h1:vY5/6MV/yEDzj4w3qjNX+qEcYwPrUQk26N6slfQJRUY=
buf.build/gen/go/k8sgpt-ai/k8sgpt/grpc-ecosystem/gateway/v2 v2.22.0-20240920204244-7a91c8620515.1 h1:qgcrhhBtW1KVxZ0izTXciQ/KR9RmE2V2EdkY+0pqE5g=
buf.build/gen/go/k8sgpt-ai/k8sgpt/grpc-ecosystem/gateway/v2 v2.22.0-20240920204244-7a91c8620515.1/go.mod h1:qVT3VFVrkD5nFUD/KEzjLbTyLwIubUsrc/TyG0X35EU=
buf.build/gen/go/k8sgpt-ai/k8sgpt/grpc/go v1.5.1-20240807134501-ea98c104104d.1 h1:W/4o/wizyw9oBry0PRZFDH9i55u8MLxmODUSZHW7krU=
buf.build/gen/go/k8sgpt-ai/k8sgpt/grpc/go v1.5.1-20240807134501-ea98c104104d.1/go.mod h1:cJGWJGXgaTTqiPaZAuQPvkjkxQCWoAlCWte3/ZrpU8s=
buf.build/gen/go/k8sgpt-ai/k8sgpt/grpc/go v1.5.1-20240920204244-7a91c8620515.1 h1:zrgiD9fwDXvwXw5P+lG5O+JEKvrUxsNs2xNS+c41xOA=
buf.build/gen/go/k8sgpt-ai/k8sgpt/grpc/go v1.5.1-20240920204244-7a91c8620515.1/go.mod h1:UWLDF7rVrPUgIhYUkufxK2MQoCt8c2L2Mr2XKGepJdI=
buf.build/gen/go/k8sgpt-ai/k8sgpt/protocolbuffers/go v1.34.2-20240807134501-ea98c104104d.2 h1:D3HPkRDfG1F4/yjNYTYkVgnh6aa1Fj14tiP5sBJ0pfA=
buf.build/gen/go/k8sgpt-ai/k8sgpt/protocolbuffers/go v1.34.2-20240807134501-ea98c104104d.2/go.mod h1:1wq1qVxvJkTEUQsF5/XjmhQYXYhbVoLSGhKnzS3ie54=
buf.build/gen/go/k8sgpt-ai/k8sgpt/protocolbuffers/go v1.34.2-20240920204244-7a91c8620515.2 h1:KNevBMEFHuPv6Z1Uhp9V3UNW06xnvp6hA2Jf6HPLdas=
buf.build/gen/go/k8sgpt-ai/k8sgpt/protocolbuffers/go v1.34.2-20240920204244-7a91c8620515.2/go.mod h1:1wq1qVxvJkTEUQsF5/XjmhQYXYhbVoLSGhKnzS3ie54=
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
Expand Down
2 changes: 2 additions & 0 deletions pkg/client/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ func (c *Client) AddConfig(config *v1alpha1.K8sGPT) error {
S3Cache: &schemav1.S3Cache{
BucketName: config.Spec.RemoteCache.S3.BucketName,
Region: config.Spec.RemoteCache.S3.Region,
Endpoint: config.Spec.RemoteCache.S3.Endpoint,
Insecure: config.Spec.RemoteCache.S3.Insecure,
},
},
}
Expand Down

0 comments on commit 1731008

Please sign in to comment.