Skip to content

Commit

Permalink
Merge pull request #366 from palSagnik/master
Browse files Browse the repository at this point in the history
Make count of config pipeline dynamic
  • Loading branch information
jameshorton2337 authored Jan 9, 2025
2 parents 7a3a606 + 2da3d19 commit a2d2da6
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions internal/config/crd_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,18 +99,22 @@ func TestBlackListResources(t *testing.T) {

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

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

if len(meshsyncConfig.Pipelines["global"]) != 5 {
t.Error("global pipelines not well configured expected 5")
// counting expected pipelines after blacklist
expectedGlobalCount := len(meshsyncConfig.Pipelines["global"]) - 1 //excluding namespaces
expectedLocalCount := len(meshsyncConfig.Pipelines["local"]) - 2 //excluding pods, replicasets

if len(meshsyncConfig.Pipelines["global"]) != expectedGlobalCount {
t.Errorf("global pipelines not well configured expected %d", expectedGlobalCount)
}

if len(meshsyncConfig.Pipelines["local"]) != 14 {
t.Error("global pipelines not well configured expected 15")
if len(meshsyncConfig.Pipelines["local"]) != expectedLocalCount {
t.Errorf("local pipelines not well configured expected %d", expectedLocalCount)
}
}

0 comments on commit a2d2da6

Please sign in to comment.