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
When using datadog.kubernetesResourcesAnnotationsAsTags and/or datadog.kubernetesResourcesLabelsAsTags, the RBAC rules are not rendered correctly when the resource key include more than one period (such as is often the case with CRDs). Instead of splitting the resource name from the group, it puts the entire key in the "resources" list of the core ("") group, which is incorrect and invalid.
There is another related issue with how the maps are merged when generating RBAC where the contents of kubernetesResourcesLabelsAsTags are getting merged into kubernetesResourcesAnnotationsAsTags resulting in an incorrect value for DD_KUBERNETES_RESOURCES_ANNOTATIONS_AS_TAGS.
There is a similar issue with datadog-agent itself, which has also been reported: DataDog/datadog-agent#33646 (along with a proposed fix). I will submit a PR to propose a fix for this, as well.
rules:
# Iterate through the apiGroups and create rules for each resource
- apiGroups:
- ""resources:
- pods
- servicesverbs:
- get
- list
- watch
- apiGroups:
- "apps"resources:
- deployments
- statefulsetsverbs:
- get
- list
- watch
- apiGroups:
- "example.com"resources:
- anotercustoms
- customsverbs:
- get
- list
- watch
rules:
# Iterate through the apiGroups and create rules for each resource
- apiGroups:
- ""resources:
- anotercustoms.example.com
- customs.example.com
- pods
- servicesverbs:
- get
- list
- watch
- apiGroups:
- "apps"resources:
- deployments
- statefulsetsverbs:
- get
- list
- watch
When using
datadog.kubernetesResourcesAnnotationsAsTags
and/ordatadog.kubernetesResourcesLabelsAsTags
, the RBAC rules are not rendered correctly when the resource key include more than one period (such as is often the case with CRDs). Instead of splitting the resource name from the group, it puts the entire key in the "resources" list of the core (""
) group, which is incorrect and invalid.There is another related issue with how the maps are merged when generating RBAC where the contents of
kubernetesResourcesLabelsAsTags
are getting merged intokubernetesResourcesAnnotationsAsTags
resulting in an incorrect value forDD_KUBERNETES_RESOURCES_ANNOTATIONS_AS_TAGS
.There is a similar issue with datadog-agent itself, which has also been reported: DataDog/datadog-agent#33646 (along with a proposed fix). I will submit a PR to propose a fix for this, as well.
Example
Consider the following values:
Expected
RBAC:
Env vars:
Actual
RBAC:
Env vars:
The text was updated successfully, but these errors were encountered: