We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f871df7 commit 6e4bff6Copy full SHA for 6e4bff6
config/config_test.go
@@ -72,3 +72,25 @@ func Test_NodeRegexp(t *testing.T) {
72
t.Error("Expected not matching, but matching node")
73
}
74
75
+
76
77
+func Test_NodeLabelMatcher(t *testing.T) {
78
+ node := buildNode()
79
80
+ pool := PoolConfig{
81
+ Name: "testing",
82
+ Selector: []PoolConfigSelector{
83
+ {
84
+ Path: "{.metadata.labels.node\\.kubernetes\\.io/role}",
85
+ Match: stringPtr("worker"),
86
+ },
87
88
+ }
89
+ matching, err := pool.IsMatchingNode(node)
90
+ if err != nil {
91
+ t.Errorf("Unexpected error: %v", err)
92
93
+ if !matching {
94
+ t.Error("Expected matching, but not matching node")
95
96
+}
0 commit comments