Added three different optional filters to the kubernetes DQL query via the additionalFilter placeholder.
The namespace is now compared with the component annotation backstage.io/kubernetes-namespace. For non-kubernetes queries the metadata namespace is used and fallback to default. The following filter is added | filter namespace.id == "{namespace}"
The kubernetes id is now compared with the component annotation backstage.io/kubernetes-id. The optional filter is added via | filter workload.labels[`backstage.io/kubernetes-id`] == "{kubernetesId}"
The kubernetes label is now compared with the component annotation backstage.io/kubernetes-label-selector. The annotation label1=value1,label2=value2 will resolve to to | filter workload.labels[`label1`] == "value1" AND workload.labels[`label2`] == "value2"
Also
One of the labels backstage.io/kubernetes-id, backstage.io/kubernetes-label-selector is now required for the kubernetes query
If a kubernetes-label-selector is given, the kubernetes-id is ignored.
Removed the component namespace fallback to default for kubernetes queries. We want to query all namespaces if nothing is defined.
:heavy_check_mark: Common checklist
[x] Added tests for new functionality and regression tests for bug fixes
[ ] Screenshots of before and after attached (for UI changes)
[ ] Added or updated documentation (if applicable)
Introduction
Added three different optional filters to the kubernetes DQL query via the
additionalFilter
placeholder.backstage.io/kubernetes-namespace
. For non-kubernetes queries the metadata namespace is used and fallback todefault
. The following filter is added| filter namespace.id == "{namespace}"
backstage.io/kubernetes-id
. The optional filter is added via| filter workload.labels[`backstage.io/kubernetes-id`] == "{kubernetesId}"
backstage.io/kubernetes-label-selector
. The annotationlabel1=value1,label2=value2
will resolve to to| filter workload.labels[`label1`] == "value1" AND workload.labels[`label2`] == "value2"
Also
backstage.io/kubernetes-id
,backstage.io/kubernetes-label-selector
is now required for the kubernetes querydefault
for kubernetes queries. We want to query all namespaces if nothing is defined.:heavy_check_mark: Common checklist