Skip to content

Commit

Permalink
specify namespace on k8sgpt crd (#291)
Browse files Browse the repository at this point in the history
Signed-off-by: Iqbal Singh <singhiqbal1007@gmail.com>
Co-authored-by: Aris Boutselis <aris.boutselis@senseon.io>
  • Loading branch information
singhiqbal1007 and Aris Boutselis committed Jan 29, 2024
1 parent 26f7c71 commit 6492cce
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions api/v1alpha1/k8sgpt_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ type K8sGPTSpec struct {
RemoteCache *RemoteCacheRef `json:"remoteCache,omitempty"`
Integrations *Integrations `json:"integrations,omitempty"`
NodeSelector map[string]string `json:"nodeSelector,omitempty"`
TargetNamespace string `json:"targetNamespace,omitempty"`
// Define the kubeconfig the Deployment must use.
// If empty, the Deployment will use the ServiceAccount provided by Kubernetes itself.
Kubeconfig *SecretRef `json:"kubeconfig,omitempty"`
Expand Down
2 changes: 2 additions & 0 deletions chart/operator/templates/k8sgpt-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,8 @@ spec:
webhook:
type: string
type: object
targetNamespace:
type: string
version:
type: string
type: object
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 @@ -188,6 +188,8 @@ spec:
webhook:
type: string
type: object
targetNamespace:
type: string
version:
type: string
type: object
Expand Down
1 change: 1 addition & 0 deletions pkg/client/analysis.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ func (c *Client) ProcessAnalysis(deployment v1.Deployment, config *v1alpha1.K8sG
Explain: config.Spec.AI.Enabled && allowAIRequest,
Nocache: config.Spec.NoCache,
Backend: config.Spec.AI.Backend,
Namespace: config.Spec.TargetNamespace,
Filters: config.Spec.Filters,
Anonymize: config.Spec.AI.Anonymize,
Language: config.Spec.AI.Language,
Expand Down

0 comments on commit 6492cce

Please sign in to comment.