diff --git a/internal/config/crd_config_test.go b/internal/config/crd_config_test.go index 05af239c..52c1498f 100644 --- a/internal/config/crd_config_test.go +++ b/internal/config/crd_config_test.go @@ -20,7 +20,112 @@ var ( ) func TestWhiteListResources(t *testing.T) { - + Pipelines = map[string]PipelineConfigs{ + GlobalResourceKey: []PipelineConfig{ + // Core Resources + { + Name: "namespaces.v1.", + PublishTo: DefaultPublishingSubject, + }, + { + Name: "configmaps.v1.", + PublishTo: "meshery.meshsync.core", + Events: DefaultEvents, + }, + { + Name: "nodes.v1.", + PublishTo: "meshery.meshsync.core", + Events: DefaultEvents, + }, + { + Name: "secrets.v1.", + PublishTo: "meshery.meshsync.core", + Events: DefaultEvents, + }, + { + Name: "persistentvolumes.v1.", + PublishTo: "meshery.meshsync.core", + Events: DefaultEvents, + }, + { + Name: "persistentvolumeclaims.v1.", + PublishTo: "meshery.meshsync.core", + Events: DefaultEvents, + }, + }, + LocalResourceKey: []PipelineConfig{ + // Core Resources + { + Name: "replicasets.v1.apps", + PublishTo: DefaultPublishingSubject, + }, + { + Name: "pods.v1.", + PublishTo: DefaultPublishingSubject, + }, + { + Name: "services.v1.", + PublishTo: DefaultPublishingSubject, + }, + { + Name: "deployments.v1.apps", + PublishTo: DefaultPublishingSubject, + }, + { + Name: "statefulsets.v1.apps", + PublishTo: DefaultPublishingSubject, + }, + { + Name: "daemonsets.v1.apps", + PublishTo: DefaultPublishingSubject, + }, + //Added Ingress support + { + Name: "ingresses.v1.networking.k8s.io", + PublishTo: DefaultPublishingSubject, + }, + // Added endpoint support + { + Name: "endpoints.v1.", + PublishTo: DefaultPublishingSubject, + }, + //Added endpointslice support + { + Name: "endpointslices.v1.discovery.k8s.io", + PublishTo: DefaultPublishingSubject, + }, + // Added cronJob support + { + Name: "cronjobs.v1.batch", + PublishTo: DefaultPublishingSubject, + }, + //Added ReplicationController support + { + Name: "replicationcontrollers.v1.", + PublishTo: DefaultPublishingSubject, + }, + //Added storageClass support + { + Name: "storageclasses.v1.storage.k8s.io", + PublishTo: DefaultPublishingSubject, + }, + //Added ClusterRole support + { + Name: "clusterroles.v1.rbac.authorization.k8s.io", + PublishTo: DefaultPublishingSubject, + }, + //Added VolumeAttachment support + { + Name: "volumeattachments.v1.storage.k8s.io", + PublishTo: DefaultPublishingSubject, + }, + //Added apiservice support + { + Name: "apiservices.v1.apiregistration.k8s.io", + PublishTo: DefaultPublishingSubject, + }, + }, + } // Create an instance of the custom resource. watchList := corev1.ConfigMap{ TypeMeta: metav1.TypeMeta{ @@ -106,7 +211,7 @@ func TestBlackListResources(t *testing.T) { // excempted global pipelines: namespaces // excempted local pipelines: pods, replicasets - if len(meshsyncConfig.Pipelines["global"]) != 6 { + if len(meshsyncConfig.Pipelines["global"]) != 5 { t.Errorf("global pipelines not well configured got %d expected 6", len(meshsyncConfig.Pipelines["global"])) }