@@ -21,12 +21,16 @@ type ServiceGroup struct {
21
21
22
22
DeploymentConfigPipelines []DeploymentConfigPipeline
23
23
ReplicationControllers []ReplicationController
24
+ ReplicaSets []ReplicaSet
25
+ Deployments []Deployment
24
26
StatefulSets []StatefulSet
25
27
26
28
// TODO: this has to stop
27
29
FulfillingStatefulSets []* kubegraph.StatefulSetNode
30
+ FulfillingDeployments []* kubegraph.DeploymentNode
28
31
FulfillingDCs []* appsgraph.DeploymentConfigNode
29
32
FulfillingRCs []* kubegraph.ReplicationControllerNode
33
+ FulfillingRSs []* kubegraph.ReplicaSetNode
30
34
FulfillingPods []* kubegraph.PodNode
31
35
32
36
ExposingRoutes []* routegraph.RouteNode
@@ -67,12 +71,16 @@ func NewServiceGroup(g osgraph.Graph, serviceNode *kubegraph.ServiceNode) (Servi
67
71
service .FulfillingDCs = append (service .FulfillingDCs , castContainer )
68
72
case * kubegraph.ReplicationControllerNode :
69
73
service .FulfillingRCs = append (service .FulfillingRCs , castContainer )
74
+ case * kubegraph.ReplicaSetNode :
75
+ service .FulfillingRSs = append (service .FulfillingRSs , castContainer )
70
76
case * kubegraph.PodNode :
71
77
service .FulfillingPods = append (service .FulfillingPods , castContainer )
72
78
case * kubegraph.StatefulSetNode :
73
79
service .FulfillingStatefulSets = append (service .FulfillingStatefulSets , castContainer )
80
+ case * kubegraph.DeploymentNode :
81
+ service .FulfillingDeployments = append (service .FulfillingDeployments , castContainer )
74
82
default :
75
- utilruntime .HandleError (fmt .Errorf ("unrecognized container: %v" , castContainer ))
83
+ utilruntime .HandleError (fmt .Errorf ("unrecognized container: %v (%T)" , castContainer , castContainer ))
76
84
}
77
85
}
78
86
@@ -102,13 +110,27 @@ func NewServiceGroup(g osgraph.Graph, serviceNode *kubegraph.ServiceNode) (Servi
102
110
service .ReplicationControllers = append (service .ReplicationControllers , rcView )
103
111
}
104
112
113
+ for _ , fulfillingRS := range service .FulfillingRSs {
114
+ rsView , rsCovers := NewReplicaSet (g , fulfillingRS )
115
+
116
+ covered .Insert (rsCovers .List ()... )
117
+ service .ReplicaSets = append (service .ReplicaSets , rsView )
118
+ }
119
+
105
120
for _ , fulfillingStatefulSet := range service .FulfillingStatefulSets {
106
121
view , covers := NewStatefulSet (g , fulfillingStatefulSet )
107
122
108
123
covered .Insert (covers .List ()... )
109
124
service .StatefulSets = append (service .StatefulSets , view )
110
125
}
111
126
127
+ for _ , fulfillingDeployment := range service .FulfillingDeployments {
128
+ view , covers := NewDeployment (g , fulfillingDeployment )
129
+
130
+ covered .Insert (covers .List ()... )
131
+ service .Deployments = append (service .Deployments , view )
132
+ }
133
+
112
134
for _ , fulfillingPod := range service .FulfillingPods {
113
135
_ , podCovers := NewPod (g , fulfillingPod )
114
136
covered .Insert (podCovers .List ()... )
0 commit comments