fix AlibabaCloud-NATGW network ready condition when multi-ports (#94)
Signed-off-by: ChrisLiu <chrisliu1995@163.com>
This commit is contained in:
parent
3d523f9611
commit
4ec1a65e3a
|
|
@ -122,7 +122,12 @@ func (n NatGwPlugin) OnPodUpdated(c client.Client, pod *corev1.Pod, ctx context.
|
||||||
}
|
}
|
||||||
networkStatus.InternalAddresses = internalAddresses
|
networkStatus.InternalAddresses = internalAddresses
|
||||||
networkStatus.ExternalAddresses = externalAddresses
|
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)
|
pod, err = networkManager.UpdateNetworkStatus(*networkStatus, pod)
|
||||||
return pod, errors.ToPluginError(err, errors.InternalError)
|
return pod, errors.ToPluginError(err, errors.InternalError)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue