fix: using /32 in case of bare IPs

This commit is contained in:
Dario Tranchitella
2021-06-21 12:12:04 +02:00
parent 46fc65a988
commit 7237972b80
+3
View File
@@ -79,6 +79,9 @@ func (r *handler) handleService(ctx context.Context, clt client.Client, decoder
}
for _, allowed := range tnt.Spec.ExternalServiceIPs.Allowed {
if !strings.Contains(string(allowed), "/") {
allowed += "/32"
}
_, allowedIP, _ := net.ParseCIDR(string(allowed))
for _, externalIP := range svc.Spec.ExternalIPs {
IP := net.ParseIP(externalIP)