Skip to content

Commit

Permalink
Add UT for RecconcileVPCSecurityGroups
Browse files Browse the repository at this point in the history
  • Loading branch information
arshadda committed Oct 16, 2024
1 parent 0196f1a commit 9816d30
Show file tree
Hide file tree
Showing 2 changed files with 567 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cloud/scope/powervs_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -1631,7 +1631,7 @@ func (s *PowerVSClusterScope) validateVPCSecurityGroup(securityGroup infrav1beta
return nil, nil, fmt.Errorf("failed to validate VPC security group rules: %v", err)
}
if !ok {
if _, _, controllerCreated := s.GetVPCSecurityGroupByName(*securityGroup.Name); !*controllerCreated {
if _, _, controllerCreated := s.GetVPCSecurityGroupByName(*securityGroup.Name); controllerCreated != nil && !*controllerCreated {
return nil, nil, fmt.Errorf("VPC security group by name exists but rules are not matching")
}
return nil, nil, s.createVPCSecurityGroupRulesAndSetStatus(securityGroup.Rules, securityGroupDet.ID, securityGroupDet.Name)
Expand Down
Loading

0 comments on commit 9816d30

Please sign in to comment.