Skip to content

Commit a2d2da6

Browse files
authored
Merge pull request #366 from palSagnik/master
Make count of config pipeline dynamic
2 parents 7a3a606 + 2da3d19 commit a2d2da6

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

internal/config/crd_config_test.go

+9-5
Original file line numberDiff line numberDiff line change
@@ -99,18 +99,22 @@ func TestBlackListResources(t *testing.T) {
9999

100100
expectedBlackList := []string{"namespaces.v1.", "pods.v1."}
101101
if !reflect.DeepEqual(meshsyncConfig.BlackList, expectedBlackList) {
102-
t.Error("WhiteListed resources not equal")
102+
t.Error("BlackListed resources not equal")
103103
}
104104

105105
// now we assertain the global and local pipelines have been correctly configured
106106
// excempted global pipelines: namespaces
107107
// excempted local pipelines: pods, replicasets
108108

109-
if len(meshsyncConfig.Pipelines["global"]) != 5 {
110-
t.Error("global pipelines not well configured expected 5")
109+
// counting expected pipelines after blacklist
110+
expectedGlobalCount := len(meshsyncConfig.Pipelines["global"]) - 1 //excluding namespaces
111+
expectedLocalCount := len(meshsyncConfig.Pipelines["local"]) - 2 //excluding pods, replicasets
112+
113+
if len(meshsyncConfig.Pipelines["global"]) != expectedGlobalCount {
114+
t.Errorf("global pipelines not well configured expected %d", expectedGlobalCount)
111115
}
112116

113-
if len(meshsyncConfig.Pipelines["local"]) != 14 {
114-
t.Error("global pipelines not well configured expected 15")
117+
if len(meshsyncConfig.Pipelines["local"]) != expectedLocalCount {
118+
t.Errorf("local pipelines not well configured expected %d", expectedLocalCount)
115119
}
116120
}

0 commit comments

Comments
 (0)