Skip to content

Commit

Permalink
address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
emmayang committed Oct 18, 2021
1 parent fb7863e commit a3e1e82
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions cloud/scope/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,7 @@ func (s *ClusterScope) CreateSubnet() (*vpcv1.Subnet, error) {
}

options := &vpcv1.CreateSubnetOptions{}
var cidrBlock string
cidrBlock, err = s.getSubnetAddrPrefix(s.IBMVPCCluster.Status.VPC.ID, s.IBMVPCCluster.Spec.Zone)
cidrBlock, err := s.getSubnetAddrPrefix(s.IBMVPCCluster.Status.VPC.ID, s.IBMVPCCluster.Spec.Zone)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -227,8 +226,9 @@ func (s *ClusterScope) CreateSubnet() (*vpcv1.Subnet, error) {
}

func (s *ClusterScope) getSubnetAddrPrefix(vpcID, zone string) (string, error) {
options := &vpcv1.ListVPCAddressPrefixesOptions{}
options.VPCID = &vpcID
options := &vpcv1.ListVPCAddressPrefixesOptions{
VPCID: &vpcID,
}
addrCollection, _, err := s.IBMVPCClients.VPCService.ListVPCAddressPrefixes(options)

if err != nil {
Expand All @@ -239,7 +239,7 @@ func (s *ClusterScope) getSubnetAddrPrefix(vpcID, zone string) (string, error) {
return *addrPrefix.CIDR, nil
}
}
return "", fmt.Errorf("Error when getting subnet addr prefix for VPC %s in zone %s", vpcID, zone)
return "", fmt.Errorf("not found a valid CIDR for VPC %s in zone %s", vpcID, zone)
}
}

Expand Down

0 comments on commit a3e1e82

Please sign in to comment.