bug: APIExport controller uses first encountered GroupResource
match for internal APIs, but separate schemas exist for built-in APIs with multiple versions
#2161
Labels
kind/bug
Categorizes issue or PR as related to a bug.
Describe the bug
APIResourceSchema
for all built-in APIs are generated here and then stored in a slice. When evaluating whether a permission claim is for an internal API, we loop through the generatedAPIResourceSchema
and select the first match by group / resource. However, some built-in APIs (such asFlowSchema
v1beta1
andv1beta2
) have multiple versions, but have a separateAPIResourceSchema
generated for each version. This means that when we loop through, we always use the schema that was added to the slice first.Steps To Reproduce
FlowSchemas
.v1beta1
is served.Expected Behaviour
I believe what would be expected here is that we do match on
GroupResource
, but that theAPIResourceSchema
returned contains schemas for both versions of the given resource.Additional Context
No response
The text was updated successfully, but these errors were encountered: