Skip to content

Commit

Permalink
client-go : add http-proxy to the kubeconfig
Browse files Browse the repository at this point in the history
Additional http-proxy field is added to the Cluster struct
so that the kubeconfigs can have the proxy details to connect
to the respective APIserver.
fixes:kubernetes/client-go#351
  • Loading branch information
aakp10 committed Feb 13, 2018
1 parent 49bf442 commit 230fb49
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions staging/src/k8s.io/client-go/tools/clientcmd/api/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ type Cluster struct {
// CertificateAuthorityData contains PEM-encoded certificate authority certificates. Overrides CertificateAuthority
// +optional
CertificateAuthorityData []byte `json:"certificate-authority-data,omitempty"`
//HttpProxy holds the proxy server details for the cluster
//+optional
HttpProxy string `json:"http-proxy"`
// Extensions holds additional information. This is useful for extenders so that reads and writes don't clobber unknown fields
// +optional
Extensions map[string]runtime.Object `json:"extensions,omitempty"`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,7 @@ func (config *DirectClientConfig) getCluster() (clientcmdapi.Cluster, error) {
mergedClusterInfo.CertificateAuthority = ""
mergedClusterInfo.CertificateAuthorityData = nil
}
mergedClusterInfo.HttpProxy = os.Getenv("http_proxy")

This comment has been minimized.

Copy link
@mvanholsteijn

mvanholsteijn Dec 5, 2021

Shouldn't this be getenv of HTTPS_PROXY?


return *mergedClusterInfo, nil
}
Expand Down

0 comments on commit 230fb49

Please sign in to comment.