Skip to content

Commit 49421ca

Browse files
authored
Fix Variable Query Editor for Containers (#65)
Fix the variable query editor for the Kubernetes containers, which used the `resourceId` field instead of the `namespace` field for the Kubernetes namespace. Fix the example dashboard included in the repository.
1 parent 1f416e1 commit 49421ca

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

provisioning/dashboards/kubernetes/kubernetes-workloads.json

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
"cellHeight": "sm",
7373
"showHeader": true
7474
},
75-
"pluginVersion": "12.2.0",
75+
"pluginVersion": "12.3.0",
7676
"targets": [
7777
{
7878
"datasource": {
@@ -84,7 +84,7 @@
8484
"parameterValue": "",
8585
"queryType": "kubernetes-resources",
8686
"refId": "A",
87-
"resource": "${resource}",
87+
"resourceId": "${resource}",
8888
"variableField": "Name",
8989
"wide": false
9090
}
@@ -114,12 +114,13 @@
114114
"enableLogDetails": true,
115115
"prettifyLogMessage": false,
116116
"showCommonLabels": false,
117+
"showControls": false,
117118
"showLabels": false,
118119
"showTime": true,
119120
"sortOrder": "Descending",
120121
"wrapLogMessage": false
121122
},
122-
"pluginVersion": "12.2.0",
123+
"pluginVersion": "12.3.0",
123124
"targets": [
124125
{
125126
"container": "${container}",
@@ -128,7 +129,7 @@
128129
"namespace": "${namespace}",
129130
"queryType": "kubernetes-logs",
130131
"refId": "A",
131-
"resource": "${resource}"
132+
"resourceId": "${resource}"
132133
}
133134
],
134135
"title": "Logs",
@@ -143,7 +144,7 @@
143144
{
144145
"allowCustomValue": false,
145146
"current": {
146-
"text": "Deployment",
147+
"text": "deployment.apps",
147148
"value": "deployment.apps"
148149
},
149150
"description": "",
@@ -212,7 +213,7 @@
212213
"parameterName": "",
213214
"parameterValue": "",
214215
"queryType": "kubernetes-resources",
215-
"resource": "${resource}",
216+
"resourceId": "${resource}",
216217
"variableField": "Name",
217218
"wide": false
218219
},
@@ -234,7 +235,7 @@
234235
"name": "${name}",
235236
"namespace": "${namespace}",
236237
"queryType": "kubernetes-containers",
237-
"resource": "${resource}"
238+
"resourceId": "${resource}"
238239
},
239240
"refresh": 1,
240241
"regex": "",

src/datasource/components/variablequeryeditor/KubernetesContainers.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ export function KubernetesContainers({ datasource, query, onChange }: Props) {
2525
/>
2626
<NamespaceField
2727
datasource={datasource}
28-
namespace={query.resourceId}
28+
namespace={query.namespace}
2929
onNamespaceChange={(value) => {
30-
onChange({ ...query, resourceId: value });
30+
onChange({ ...query, namespace: value });
3131
}}
3232
/>
3333
<ResourceNameField

0 commit comments

Comments
 (0)