Skip to content

Commit

Permalink
Fix cidr multi format. (#2125)
Browse files Browse the repository at this point in the history
Signed-off-by: huaiyou <huaiyou.cyz@alibaba-inc.com>
  • Loading branch information
VinceCui authored Mar 17, 2023
1 parent adb56a9 commit a7c62b7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/clusterfile/decoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,8 @@ func checkAndFillCluster(cluster *v2.Cluster) error {

clusterEnvMap := strUtil.ConvertStringSliceToMap(cluster.Spec.Env)
if svcCIDR, ok := clusterEnvMap[common.EnvSvcCIDR]; ok && svcCIDR != nil {
_, cidr, err := net.ParseCIDR(svcCIDR.(string))
cidrs := strings.Split(svcCIDR.(string), ",")
_, cidr, err := net.ParseCIDR(cidrs[0])
if err != nil {
return fmt.Errorf("failed to parse svc CIDR: %v", err)
}
Expand Down

0 comments on commit a7c62b7

Please sign in to comment.