Skip to content

Commit

Permalink
fix: unit test of manager/insight/test_helper (#431)
Browse files Browse the repository at this point in the history
## What type of PR is this?
/kind bug

## What this PR does / why we need it:
fix unit test of manager/insight/test_helper
  • Loading branch information
panshuai111 authored May 17, 2024
1 parent fd31c12 commit 3e96ecf
Showing 1 changed file with 12 additions and 62 deletions.
74 changes: 12 additions & 62 deletions pkg/core/manager/insight/test_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,13 +229,12 @@ func mockClusterTopologyMapForCluster() map[string]ClusterTopology {
},
Count: 1,
Relationship: map[string]string{
".v1.Node": "parent",
".v1.PersistentVolumeClaim": "child",
".v1.Secret": "child",
".v1.Service": "parent",
"apps.cafe.cloud.alipay.com.v1alpha1.InPlaceSet": "parent",
"apps.v1.ReplicaSet": "parent",
"policy.v1beta1.PodDisruptionBudget": "parent",
".v1.Node": "parent",
".v1.PersistentVolumeClaim": "child",
".v1.Secret": "child",
".v1.Service": "parent",
"apps.v1.ReplicaSet": "parent",
"policy.v1beta1.PodDisruptionBudget": "parent",
},
},
".v1.Secret": {
Expand All @@ -260,29 +259,6 @@ func mockClusterTopologyMapForCluster() map[string]ClusterTopology {
".v1.Pod": "child",
},
},
"apps.cafe.cloud.alipay.com.v1alpha1.CafeDeployment": {
ResourceGroup: entity.ResourceGroup{
Cluster: "existing-cluster",
APIVersion: "apps.cafe.cloud.alipay.com/v1alpha1",
Kind: "CafeDeployment",
},
Count: 1,
Relationship: map[string]string{
"apps.cafe.cloud.alipay.com.v1alpha1.InPlaceSet": "child",
},
},
"apps.cafe.cloud.alipay.com.v1alpha1.InPlaceSet": {
ResourceGroup: entity.ResourceGroup{
Cluster: "existing-cluster",
APIVersion: "apps.cafe.cloud.alipay.com/v1alpha1",
Kind: "InPlaceSet",
},
Count: 1,
Relationship: map[string]string{
".v1.Pod": "child",
"apps.cafe.cloud.alipay.com.v1alpha1.CafeDeployment": "parent",
},
},
"apps.v1.Deployment": {
ResourceGroup: entity.ResourceGroup{
Cluster: "existing-cluster",
Expand Down Expand Up @@ -369,13 +345,12 @@ func mockClusterTopologyMapForClusterNamespace() map[string]ClusterTopology {
},
Count: 1,
Relationship: map[string]string{
".v1.Node": "parent",
".v1.PersistentVolumeClaim": "child",
".v1.Secret": "child",
".v1.Service": "parent",
"apps.cafe.cloud.alipay.com.v1alpha1.InPlaceSet": "parent",
"apps.v1.ReplicaSet": "parent",
"policy.v1beta1.PodDisruptionBudget": "parent",
".v1.Node": "parent",
".v1.PersistentVolumeClaim": "child",
".v1.Secret": "child",
".v1.Service": "parent",
"apps.v1.ReplicaSet": "parent",
"policy.v1beta1.PodDisruptionBudget": "parent",
},
},
".v1.Secret": {
Expand All @@ -402,31 +377,6 @@ func mockClusterTopologyMapForClusterNamespace() map[string]ClusterTopology {
".v1.Pod": "child",
},
},
"apps.cafe.cloud.alipay.com.v1alpha1.CafeDeployment": {
ResourceGroup: entity.ResourceGroup{
Cluster: "existing-cluster",
APIVersion: "apps.cafe.cloud.alipay.com/v1alpha1",
Kind: "CafeDeployment",
Namespace: "default",
},
Count: 1,
Relationship: map[string]string{
"apps.cafe.cloud.alipay.com.v1alpha1.InPlaceSet": "child",
},
},
"apps.cafe.cloud.alipay.com.v1alpha1.InPlaceSet": {
ResourceGroup: entity.ResourceGroup{
Cluster: "existing-cluster",
APIVersion: "apps.cafe.cloud.alipay.com/v1alpha1",
Kind: "InPlaceSet",
Namespace: "default",
},
Count: 1,
Relationship: map[string]string{
".v1.Pod": "child",
"apps.cafe.cloud.alipay.com.v1alpha1.CafeDeployment": "parent",
},
},
"apps.v1.Deployment": {
ResourceGroup: entity.ResourceGroup{
Cluster: "existing-cluster",
Expand Down

0 comments on commit 3e96ecf

Please sign in to comment.