krateoplatformops / core-provider

0 stars 2 forks source link

Wrong naming of resoureces in generated roles and clusterroles #54

Closed matteogastaldello closed 2 months ago

matteogastaldello commented 2 months ago

Describe the bug A clear and concise description of what the bug is.

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
 creationTimestamp: "2024-07-23T12:37:29Z"
 name: powerbi
 resourceVersion: "89740346"
 uid: 38e2c328-9984-4680-b4bf-23c9f58ab9e3
rules:
- apiGroups:
 - ""
 resources:
 - namespaces
 verbs:
 - get
 - list
 - watch
 - create
- apiGroups:
 - jira.krateo.io
 resources:
 - ticketjiras
 verbs:
 - '*'
- apiGroups:
 - powerbi.krateo.io
 resources:
 - pipelinepbis
 verbs:
 - '*'
- apiGroups:
 - powerbi.krateo.io
 resources:
 - workspaces
 verbs:
 - '*'
- apiGroups:
 - powerbi.krateo.io
 resources:
 - workspacecheckers
 verbs:
 - '*'

Here the resources named “pipelinepbis” and “ticketjiras” are not correct. The correct plural defined for these CRD are “pipelinespbi” and “ticketsjira”.

The problem is due the assumption that pluralization from Kind with Pluralise function of the fleet library would cover all the cases