When
- we have a product with a custom authUserKey field:
apiVersion: capabilities.3scale.net/v1beta1
kind: Product
metadata:
name: test-product
spec:
deployment:
apicastSelfManaged:
authentication:
userkey:
authUserKey: x-api-token
- associated with an application:
apiVersion: capabilities.3scale.net/v1beta1
kind: Application
metadata:
name: test-app
spec:
productCR:
name: test-product
- and we want to change the user_key using ApplicationAuth:
apiVersion: capabilities.3scale.net/v1beta1
kind: ApplicationAuth
metadata:
name: test
spec:
applicationCRName: test-app
authSecretRef:
name: test-secret
I expect
that the user_key of application "test-app" will be updated.
Instead
it's not updated.
Notes
- if authUserKey == user_key or is not set, update works
- the operator uses authUserKey value in the PUT request, it seems that operator has a different behavior from the 3scale cli
|
if product.Spec.AuthUserKey() == nil { |
|
params["user_key"] = authSecret.UserKey |
|
} else { |
|
params[*product.Spec.AuthUserKey()] = authSecret.UserKey |
|
} |
When
I expect
that the user_key of application "test-app" will be updated.
Instead
it's not updated.
Notes
3scale-operator/controllers/capabilities/applicationauth_controller.go
Lines 251 to 255 in 4e7d68b