Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NO MERGE - add lock on AllPodsByNode #44

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
TAG=v2.6.0-proto205
TAG=v2.6.2

# hub.comcast.net/k8s-eng/ravel:v2.6.0-proto205 -> v2.6.0-rc7
# c2.6.2: adding lock on watcher.AllPodsByNode
# v2.6.0-proto189 -> v2.6.0-rc4
# rc6: hub.comcast.net/k8s-eng/ravel:v2.5.0-proto45
# rc7: hub.comcast.net/k8s-eng/ravel:v2.5.0-proto66
Expand All @@ -17,8 +18,8 @@ build:
docker build -t hub.comcast.net/k8s-eng/ravel:${TAG} -f Dockerfile .

push:
DOCKER_HOST=ssh://69.252.103.115 docker push hub.comcast.net/k8s-eng/ravel:${TAG}
#docker push hub.comcast.net/k8s-eng/ravel:${TAG}
#DOCKER_HOST=ssh://69.252.103.115 docker push hub.comcast.net/k8s-eng/ravel:${TAG}
docker push hub.comcast.net/k8s-eng/ravel:${TAG}

default-gobgp: build-gobgp push-gobgp

Expand Down
2 changes: 2 additions & 0 deletions pkg/watcher/watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -745,12 +745,14 @@ func (w *Watcher) buildNodeConfig() ([]*v1.Node, error) {
func (w *Watcher) GetPodIPsOnNode(nodeName string, serviceName string, namespace string, portName string) []string {

// fetch all the pod IPs on the node
w.RLock()
nodePodIPs := []string{}
for _, p := range w.AllPodsByNode[nodeName] {
if len(p.Status.PodIP) > 0 {
nodePodIPs = append(nodePodIPs, p.Status.PodIP)
}
}
w.RUnlock()
// log.Println("watcher: GetPodIPsOnNode: found", len(nodePodIPs), "pod IPs for node", nodeName)

var foundIPs []string
Expand Down