Skip to content

Commit

Permalink
chore: updated nocache
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
  • Loading branch information
AlexsJones committed Apr 24, 2023
1 parent 429ae2d commit d4bf6eb
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
1 change: 1 addition & 0 deletions api/v1alpha1/k8sgpt_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ type K8sGPTSpec struct {
Namespace string `json:"namespace,omitempty"`
Version string `json:"version,omitempty"`
EnableAI bool `json:"enableAI,omitempty"`
NoCache bool `json:"noCache,omitempty"`
}

// K8sGPTStatus defines the observed state of K8sGPT
Expand Down
2 changes: 2 additions & 0 deletions config/crd/bases/core.k8sgpt.ai_k8sgpts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ spec:
type: string
namespace:
type: string
noCache:
type: boolean
secret:
properties:
key:
Expand Down
7 changes: 1 addition & 6 deletions config/samples/core_v1alpha1_k8sgpt.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
apiVersion: core.k8sgpt.ai/v1alpha1
kind: K8sGPT
metadata:
labels:
app.kubernetes.io/name: k8sgpt
app.kubernetes.io/instance: k8sgpt-sample
app.kubernetes.io/part-of: k8sgpt-operator
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/created-by: k8sgpt-operator
name: k8sgpt-sample
spec:
namespace: default
model: gpt-3.5-turbo
backend: openai
noCache: false
version: v0.2.4
enableAI: true
secret:
Expand Down
4 changes: 4 additions & 0 deletions pkg/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ func (c *Client) ProcessAnalysis(deployment v1.Deployment, config *v1alpha1.K8sG
url = url + "?explain=true"
}

if config.Spec.NoCache {
url = url + "?nocache=true"
}

r, err := c.httpClient.Get(url)
if err != nil {
return nil, err
Expand Down

0 comments on commit d4bf6eb

Please sign in to comment.