Skip to content

Commit

Permalink
Add kubernetes host to the no proxy list
Browse files Browse the repository at this point in the history
  • Loading branch information
vinokurig committed Jan 18, 2024
1 parent c738dc7 commit c16a638
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
4 changes: 3 additions & 1 deletion pkg/deploy/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,9 @@ func ReadCheClusterProxyConfiguration(ctx *chetypes.DeployContext) (*chetypes.Pr
}

func MergeNonProxy(noProxy1 string, noProxy2 string) string {
if noProxy1 == "" {
if noProxy1 == "" && noProxy2 == "" {
return ""
} else if noProxy1 == "" {
return noProxy2
} else if noProxy2 == "" {
return noProxy1
Expand Down
6 changes: 0 additions & 6 deletions pkg/deploy/server/server_configmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ package server
import (
"encoding/json"
"fmt"
"os"
"strconv"
"strings"

Expand Down Expand Up @@ -89,11 +88,6 @@ func (s *CheServerReconciler) getCheConfigMapData(ctx *chetypes.DeployContext) (
proxyJavaOpts := ""
cheWorkspaceNoProxy := ctx.Proxy.NoProxy
if ctx.Proxy.HttpProxy != "" {
if ctx.Proxy.NoProxy == "" {
cheWorkspaceNoProxy = os.Getenv("KUBERNETES_SERVICE_HOST")
} else {
cheWorkspaceNoProxy = cheWorkspaceNoProxy + "," + os.Getenv("KUBERNETES_SERVICE_HOST")
}
proxyJavaOpts, err = deploy.GenerateProxyJavaOpts(ctx.Proxy, cheWorkspaceNoProxy)
if err != nil {
logrus.Errorf("Failed to generate java proxy options: %v", err)
Expand Down

0 comments on commit c16a638

Please sign in to comment.