Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahalsmiller committed May 8, 2024
1 parent 582fddc commit 3c1cab1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions control-plane/api-gateway/cache/consul.go
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ func (c *Cache) ensureRole(client *api.Client, gatewayName string) (string, erro

_, _, err = client.ACL().RoleCreate(role, &api.WriteOptions{})
if err != nil && !isRoleExistsErr(err, aclRoleName) {
//don't error out in the case that the role already exists
//don't error out in the case that the role already exists.
return "", err
}

Expand Down Expand Up @@ -601,7 +601,7 @@ func isPolicyExistsErr(err error, policyName string) bool {
return isExistsErr(err, "Policy", policyName)
}

// isExistsErr returns true if err is due to trying to call an API for a given type and it already exists
// isExistsErr returns true if err is due to trying to call an API for a given type and it already exists.
func isExistsErr(err error, typeName, name string) bool {
return err != nil &&
strings.Contains(err.Error(), "Unexpected response code: 500") &&
Expand Down

0 comments on commit 3c1cab1

Please sign in to comment.