Skip to content

Commit 82db345

Browse files
authored
add selector, selector_query to statful_set (#293)
1 parent 82aa111 commit 82db345

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

k8s-test/tests/kubernetes_stateful_set/test-get-expected.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@
88
"pod_management_policy": "OrderedReady",
99
"ready_replicas": 2,
1010
"replicas": 2,
11+
"selector": {
12+
"matchLabels": {
13+
"app": "nginx"
14+
}
15+
},
16+
"selector_query": "app=nginx",
1117
"revision_history_limit": 10,
1218
"service_name": "nginx",
1319
"update_strategy": {

k8s-test/tests/kubernetes_stateful_set/test-get-query.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ select
33
namespace,
44
service_name,
55
replicas,
6+
selector,
7+
selector_query,
68
collision_count,
79
current_replicas,
810
observed_generation,

kubernetes/table_kubernetes_stateful_set.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,18 @@ func tableKubernetesStatefulSet(ctx context.Context) *plugin.Table {
3838
Description: "The desired number of replicas of the given Template.",
3939
Transform: transform.FromField("Spec.Replicas"),
4040
},
41+
{
42+
Name: "selector_query",
43+
Type: proto.ColumnType_STRING,
44+
Description: "A query string representation of the selector.",
45+
Transform: transform.FromField("Spec.Selector").Transform(labelSelectorToString),
46+
},
47+
{
48+
Name: "selector",
49+
Type: proto.ColumnType_JSON,
50+
Description: "Label selector for pods. A label selector is a label query over a set of resources.",
51+
Transform: transform.FromField("Spec.Selector"),
52+
},
4153
{
4254
Name: "collision_count",
4355
Type: proto.ColumnType_INT,

0 commit comments

Comments
 (0)