diff --git a/Makefile b/Makefile index 78fef824..692afe8a 100644 --- a/Makefile +++ b/Makefile @@ -130,7 +130,7 @@ $(CONTROLLER_GEN): $(LOCALBIN) .PHONY: envtest envtest: $(ENVTEST) ## Download envtest-setup locally if necessary. $(ENVTEST): $(LOCALBIN) - GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest + GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@c7e1dc9b5302d649d5531e19168dd7ea0013736d HELM = $(shell pwd)/bin/helm helm: ## Download helm locally if necessary. diff --git a/cloudprovider/kubernetes/hostPort.go b/cloudprovider/kubernetes/hostPort.go index b8c47e51..36031189 100644 --- a/cloudprovider/kubernetes/hostPort.go +++ b/cloudprovider/kubernetes/hostPort.go @@ -130,10 +130,6 @@ func (hpp *HostPortPlugin) OnPodUpdated(c client.Client, pod *corev1.Pod, ctx co nodeIp := getAddress(node) networkManager := utils.NewNetworkManager(pod, c) - status, _ := networkManager.GetNetworkStatus() - if status != nil { - return pod, nil - } iNetworkPorts := make([]gamekruiseiov1alpha1.NetworkPort, 0) eNetworkPorts := make([]gamekruiseiov1alpha1.NetworkPort, 0) @@ -157,7 +153,7 @@ func (hpp *HostPortPlugin) OnPodUpdated(c client.Client, pod *corev1.Pod, ctx co } // network not ready - if len(iNetworkPorts) == 0 || len(eNetworkPorts) == 0 { + if len(iNetworkPorts) == 0 || len(eNetworkPorts) == 0 || pod.Status.PodIP == "" { pod, err := networkManager.UpdateNetworkStatus(gamekruiseiov1alpha1.NetworkStatus{ CurrentNetworkState: gamekruiseiov1alpha1.NetworkNotReady, }, pod)