Skip to content

Commit

Permalink
chore: validate type assertion to prevent panic (#436)
Browse files Browse the repository at this point in the history
  • Loading branch information
reversearrow authored Apr 8, 2024
1 parent 4a817ad commit a652a4e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion kong/test_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ func RunWhenEnterprise(t *testing.T, versionRange string, required RequiredFeatu
if !currentVersion.IsKongGatewayEnterprise() {
t.Skip("non-Enterprise test Kong instance, skipping")
}
configuration := info["configuration"].(map[string]interface{})
configuration, ok := info["configuration"].(map[string]interface{})
if !ok {
t.Errorf("failed to cast 'configuration' to map[string]interface{}")
}

if required.RBAC && configuration["rbac"].(string) != "on" {
t.Skip("RBAC not enabled on test Kong instance, skipping")
Expand Down

0 comments on commit a652a4e

Please sign in to comment.