diff --git a/pkg/controller/infrastructure/actuator.go b/pkg/controller/infrastructure/actuator.go index e2826742e..a36370e7e 100644 --- a/pkg/controller/infrastructure/actuator.go +++ b/pkg/controller/infrastructure/actuator.go @@ -55,8 +55,9 @@ func patchProviderStatusAndState( patch := client.MergeFrom(infra.DeepCopy()) if status != nil { infra.Status.ProviderStatus = &runtime.RawExtension{Object: status} - for _, natIP := range status.Networks.NatIPs { - infra.Status.EgressCIDRs = append(infra.Status.EgressCIDRs, fmt.Sprintf("%s/32", natIP.IP)) + infra.Status.EgressCIDRs = make([]string, len(status.Networks.NatIPs)) + for i, natIP := range status.Networks.NatIPs { + infra.Status.EgressCIDRs[i] = fmt.Sprintf("%s/32", natIP.IP) } } if state != nil {