Skip to content

Commit 6fcf309

Browse files
committed
Use IsIPv6CIDRString from k8s utils
1 parent 41c21dc commit 6fcf309

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

modules/common/ocp/ocp.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ package ocp
1818

1919
import (
2020
"context"
21-
"strings"
2221

2322
"github.com/openstack-k8s-operators/lib-common/modules/common/helper"
2423

2524
ocp_config "github.com/openshift/api/config/v1"
2625
"gopkg.in/yaml.v3"
2726
corev1 "k8s.io/api/core/v1"
2827
"k8s.io/apimachinery/pkg/types"
28+
k8s_utils "k8s.io/utils/net"
2929
)
3030

3131
// IsFipsCluster - Check if OCP has fips enabled which is a day 1 operation
@@ -59,7 +59,7 @@ func HasIPv6ClusterNetwork(ctx context.Context, h *helper.Helper) (bool, error)
5959
}
6060

6161
for _, clusterNetwork := range networkConfig.Status.ClusterNetwork {
62-
if strings.Count(clusterNetwork.CIDR, ":") >= 2 {
62+
if k8s_utils.IsIPv6CIDRString(clusterNetwork.CIDR) {
6363
return true, nil
6464
}
6565
}

0 commit comments

Comments
 (0)