Skip to content

Commit

Permalink
fix AlibabaCloud-NATGW network ready condition when multi-ports (open…
Browse files Browse the repository at this point in the history
…kruise#94)

Signed-off-by: ChrisLiu <[email protected]>
  • Loading branch information
chrisliu1995 authored Aug 30, 2023
1 parent 3d523f9 commit 4ec1a65
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cloudprovider/alibabacloud/natgw.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,12 @@ func (n NatGwPlugin) OnPodUpdated(c client.Client, pod *corev1.Pod, ctx context.
}
networkStatus.InternalAddresses = internalAddresses
networkStatus.ExternalAddresses = externalAddresses
networkStatus.CurrentNetworkState = gamekruiseiov1alpha1.NetworkReady

// NetworkReady when all ports have external addresses
if len(strings.Split(pod.Annotations[PortsAnsKey], ",")) == len(podDNat.Status.Entries) {
networkStatus.CurrentNetworkState = gamekruiseiov1alpha1.NetworkReady
}

pod, err = networkManager.UpdateNetworkStatus(*networkStatus, pod)
return pod, errors.ToPluginError(err, errors.InternalError)
}
Expand Down

0 comments on commit 4ec1a65

Please sign in to comment.