Skip to content

ApplicationAuth controller is not able to update userkey of Application when product.Spec.AuthUserKey() != nil #1078

@vinolipartec

Description

@vinolipartec

When

  1. 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
  1. associated with an application:
apiVersion: capabilities.3scale.net/v1beta1
kind: Application
metadata:
  name: test-app
spec:
  productCR:
    name: test-product
  1. 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

  1. if authUserKey == user_key or is not set, update works
  2. 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
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions