You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If both the namespace and the consumer have hyphens, plugin does not work at all, for instance: namespace kube-system and comsumer jack-sparrow result in the following entry:
every request to the route with applied consumer-restriction is rejected with 401, {"message":"The consumer_name is forbidden."}
On top of that, APISIX currently flattens consumer names by replacing hyphens with underscores. However, this implementation doesn't properly handle hyphenated namespace names, leading to potential naming conflicts. For example, consider these two valid consumers:
Consumer consumer1 in namespace foo-bar becomes foo_bar_consumer1
Consumer bar-consumer1 in namespace foo would also become foo_bar_consumer1
The controller does not reject it, but blindly reconciles the consumer updating the entry even though the data comes from a different custom resource
I expect the first scenario to work normally. I cannot control namespaces names, so the only workaround I found is to use consumer names without an underscore in its name.
For the second issue I would expect the controller not to reconcile the other ApisixConsumer as it would conflict with existing one.
Current Behavior
If both the namespace and the consumer have hyphens, plugin does not work at all, for instance: namespace
kube-system
and comsumerjack-sparrow
result in the following entry:every request to the route with applied consumer-restriction is rejected with 401,
{"message":"The consumer_name is forbidden."}
On top of that, APISIX currently flattens consumer names by replacing hyphens with underscores. However, this implementation doesn't properly handle hyphenated namespace names, leading to potential naming conflicts. For example, consider these two valid consumers:
The controller does not reject it, but blindly reconciles the consumer updating the entry even though the data comes from a different custom resource
There are few issues related to the problem:
-
apisix#7825however no real solution was provided
Expected Behavior
I expect the first scenario to work normally. I cannot control namespaces names, so the only workaround I found is to use consumer names without an underscore in its name.
For the second issue I would expect the controller not to reconcile the other ApisixConsumer as it would conflict with existing one.
Error Logs
No response
Steps to Reproduce
just kubectl apply -f this and notice 401s
Environment
The text was updated successfully, but these errors were encountered: