Skip to content

Commit

Permalink
use util.hostNameEnv instead KUBE_NODE_NAME
Browse files Browse the repository at this point in the history
  • Loading branch information
pengbinbin1 committed Aug 21, 2021
1 parent 38e04f3 commit 0380d64
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/daemon/gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,7 @@ func (c *Controller) setExGateway() error {

func (c *Controller) getLocalPodIPsNeedNAT(protocol string) ([]string, error) {
var localPodIPs []string
hostname := os.Getenv("KUBE_NODE_NAME")
hostname := os.Getenv(util.HostnameEnv)
allPods, err := c.podsLister.List(labels.Everything())
if err != nil {
klog.Errorf("list pods failed, %+v", err)
Expand Down Expand Up @@ -684,7 +684,7 @@ func (c *Controller) getLocalPodIPsNeedPR(protocol string) (map[policyRouteMeta]
return nil, err
}

hostname := os.Getenv("KUBE_NODE_NAME")
hostname := os.Getenv(util.HostnameEnv)
localPodIPs := make(map[policyRouteMeta][]string)
for _, pod := range allPods {
if pod.Spec.HostNetwork ||
Expand Down

0 comments on commit 0380d64

Please sign in to comment.