Skip to content

Commit

Permalink
fix security group rule creation already exist
Browse files Browse the repository at this point in the history
  • Loading branch information
sebglon committed Sep 3, 2024
1 parent 20beff9 commit f3eebec
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cloud/services/security/securitygroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@ func (s *Service) CreateSecurityGroupRule(securityGroupId string, flow string, i
securityGroupRuleResponse, httpRes, err = oscApiClient.SecurityGroupRuleApi.CreateSecurityGroupRule(oscAuthClient).CreateSecurityGroupRuleRequest(createSecurityGroupRuleRequest).Execute()
if err != nil {
if httpRes != nil {
if httpRes.StatusCode == 409 {
return true, nil
}
return false, fmt.Errorf("error %w httpRes %s", err, httpRes.Status)
}
requestStr := fmt.Sprintf("%v", createSecurityGroupRuleRequest)
Expand Down

0 comments on commit f3eebec

Please sign in to comment.