CRDs-catalog icon indicating copy to clipboard operation
CRDs-catalog copied to clipboard

add alternative permissionlist naming

Open gilbahat opened this issue 1 year ago • 3 comments

Apparently this CRD may (also) need to be called permissionlist rather than (just) permission

gilbahat avatar Aug 28 '22 11:08 gilbahat

I couldn't find the CRD that creates the CR type PermissionList: https://github.com/rabbitmq/messaging-topology-operator/tree/main/config/crd/bases Can you share a link to the CRD itself?

eyarz avatar Aug 28 '22 11:08 eyarz

my GitOps contains the following (redacted):

apiVersion: rabbitmq.com/v1beta1
kind: PermissionList
metadata:
  name: rabbitmq-permission-list
  annotations:
    refresh: dummy-refresh-annotation
items:
  - apiVersion: rabbitmq.com/v1beta1
    kind: Permission
    metadata:
      name: redacted
    spec:
      user: redacted
      vhost: redacted
      permissions:
        configure: ".*"
        write: ".*"
        read: ".*"
      rabbitmqClusterReference:
        name: rabbitmq
  - apiVersion: rabbitmq.com/v1beta1
    kind: Permission
    metadata:
      name: redacted
    spec:
      user: redacted
      vhost: redacted
      permissions:
        configure: ".*"
        write: ".*"
        read: ".*"
      rabbitmqClusterReference:
        name: rabbitmq

if you look at the permissions CRD, you see this:

status:
  acceptedNames:
    categories:
    - all
    kind: Permission
    listKind: PermissionList
    plural: permissions
    singular: permission

I would wager that the CRD extractor does not currently support this. Perhaps my patch is not the right one, even if it does superficially fix the problem. I also see this being a bit hard to support by the templating mechanism seeking a designated file name.

gilbahat avatar Aug 28 '22 12:08 gilbahat

from reading around, I understand that listKind has the same schema as the "regular" kind, correct?

I'm wondering if creating duplicate schemas with just different names is the right way to handle this use case.

eyarz avatar Aug 28 '22 20:08 eyarz