Skip to content

Commit c955529

Browse files
authored
Remove ProxyEndpoint hardcoded backend checks to allow usage of HTTP proxies in any backend (#651)
Signed-off-by: pdefreitas <[email protected]>
1 parent 7c0fa91 commit c955529

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

pkg/resources/k8sgpt.go

+2-5
Original file line numberDiff line numberDiff line change
@@ -496,18 +496,15 @@ func GetDeployment(config v1alpha1.K8sGPT, outOfClusterMode bool, c client.Clien
496496
return &appsv1.Deployment{}, err.New("engine is supported only by azureopenai provider")
497497
}
498498

499-
// ProxyEndpoint is required only when azureopenai or openai is the ai backend
500-
if config.Spec.AI.ProxyEndpoint != "" && (config.Spec.AI.Backend == v1alpha1.AzureOpenAI || config.Spec.AI.Backend == v1alpha1.OpenAI) {
499+
// Configure ProxyEndpoint env variable
500+
if config.Spec.AI.ProxyEndpoint != "" {
501501
proxyEndpoint := corev1.EnvVar{
502502
Name: "K8SGPT_PROXY_ENDPOINT",
503503
Value: config.Spec.AI.ProxyEndpoint,
504504
}
505505
deployment.Spec.Template.Spec.Containers[0].Env = append(
506506
deployment.Spec.Template.Spec.Containers[0].Env, proxyEndpoint,
507507
)
508-
} else if config.Spec.AI.ProxyEndpoint != "" && config.Spec.AI.Backend != v1alpha1.AzureOpenAI && config.Spec.AI.Backend != v1alpha1.OpenAI {
509-
return &appsv1.Deployment{}, err.New("proxyEndpoint is supported only by azureopenai and openai provider")
510-
511508
}
512509

513510
// Add checks for amazonbedrock

0 commit comments

Comments
 (0)