Skip to content

Commit

Permalink
update kafka and api-jey tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MuweiHe committed Sep 10, 2021
1 parent 1900962 commit 9876553
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion internal/cmd/api-key/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,11 @@ func (c *command) list(cmd *cobra.Command, _ []string) error {
return errors.New(errors.BadServiceAccountIDErrorMsg)
}
userIdMap := c.mapResourceIdToUserId(allUsers)
userId = userIdMap[serviceAccountID]
var ok bool
userId, ok = userIdMap[serviceAccountID]
if !ok {
return errors.NewErrorWithSuggestions(fmt.Sprintf(errors.ServiceAccountNotFoundErrorMsg, serviceAccountID), errors.ServiceAccountNotFoundSuggestions)
}
}

currentUser, err := cmd.Flags().GetBool("current-user")
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/output/kafka/kafka-acls-list-json.golden
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"operation": "READ",
"pattern_type": "LITERAL",
"permission": "ALLOW",
"principal": "User:sa-123",
"principal": "User:sa-12345",
"resource_name": "test-topic",
"resource_type": "TOPIC"
}
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/output/kafka/kafka-acls-list-yaml.golden
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
- operation: READ
pattern_type: LITERAL
permission: ALLOW
principal: User:sa-123
principal: User:sa-12345
resource_name: test-topic
resource_type: TOPIC

0 comments on commit 9876553

Please sign in to comment.