kubernetes driver: add support for proxy-url

Signed-off-by: Elran Shefer <elran.shefer@velocity.tech>
This commit is contained in:
Elran Shefer
2023-05-08 16:04:49 +03:00
parent c7c37c3591
commit 29b427ce13
3 changed files with 89 additions and 10 deletions

View File

@ -19,6 +19,7 @@ import (
type EndpointMeta struct {
context.EndpointMetaBase
DefaultNamespace string `json:",omitempty"`
ProxyURL string `json:",omitempty"`
AuthProvider *clientcmdapi.AuthProviderConfig `json:",omitempty"`
Exec *clientcmdapi.ExecConfig `json:",omitempty"`
UsernamePassword *UsernamePassword `json:"usernamePassword,omitempty"`
@ -62,6 +63,9 @@ func (c *Endpoint) KubernetesConfig() clientcmd.ClientConfig {
cfg := clientcmdapi.NewConfig()
cluster := clientcmdapi.NewCluster()
cluster.Server = c.Host
if c.ProxyURL != "" {
cluster.ProxyURL = c.ProxyURL
}
cluster.InsecureSkipTLSVerify = c.SkipTLSVerify
authInfo := clientcmdapi.NewAuthInfo()
if c.TLSData != nil {