Skip to content

Commit

Permalink
Use IsIPv6CIDRString from k8s utils
Browse files Browse the repository at this point in the history
  • Loading branch information
olliewalsh committed Jul 9, 2024
1 parent 41c21dc commit 6fcf309
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/common/ocp/ocp.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ package ocp

import (
"context"
"strings"

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

ocp_config "github.com/openshift/api/config/v1"
"gopkg.in/yaml.v3"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/types"
k8s_utils "k8s.io/utils/net"
)

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

for _, clusterNetwork := range networkConfig.Status.ClusterNetwork {
if strings.Count(clusterNetwork.CIDR, ":") >= 2 {
if k8s_utils.IsIPv6CIDRString(clusterNetwork.CIDR) {
return true, nil
}
}
Expand Down

0 comments on commit 6fcf309

Please sign in to comment.