Skip to content

πŸ› Security group rule creation fails when rule already existsΒ #2637

@bnallapeta

Description

@bnallapeta

/kind bug

What steps did you take and what happened:
When creating security group rules in OpenStack, if a rule already exists, the operation fails with HTTP 409 error instead of being treated as idempotent.

What did you expect to happen:
Security group rule creation should be idempotent - if a rule already exists, it should be treated as a successful operation.

Have fixed it here:

// Handle HTTP 409 (SecurityGroupRuleExists) as success - the rule already exists
if strings.Contains(err.Error(), "SecurityGroupRuleExists") || strings.Contains(err.Error(), "already exists") {
s.scope.Logger().V(4).Info("Security group rule already exists, treating as success", "description", r.Description, "securityGroupID", securityGroupID)
return nil
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.

    Type

    No type

    Projects

    Status

    Inbox

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions