@@ -41,12 +41,6 @@ type DaemonSet struct {
41
41
42
42
// Container images of the Daemon Set.
43
43
ContainerImages []string `json:"containerImages"`
44
-
45
- // Internal endpoints of all Kubernetes services have the same label selector as this Daemon Set.
46
- InternalEndpoints []common.Endpoint `json:"internalEndpoints"`
47
-
48
- // External endpoints of all Kubernetes services have the same label selector as this Daemon Set.
49
- ExternalEndpoints []common.Endpoint `json:"externalEndpoints"`
50
44
}
51
45
52
46
// GetDaemonSetList returns a list of all Daemon Set in the cluster.
@@ -57,7 +51,6 @@ func GetDaemonSetList(client *client.Client, nsQuery *common.NamespaceQuery) (*D
57
51
ServiceList : common .GetServiceListChannel (client , nsQuery , 1 ),
58
52
PodList : common .GetPodListChannel (client , nsQuery , 1 ),
59
53
EventList : common .GetEventListChannel (client , nsQuery , 1 ),
60
- NodeList : common .GetNodeListChannel (client , 1 ),
61
54
}
62
55
63
56
return GetDaemonSetListFromChannels (channels )
@@ -73,11 +66,6 @@ func GetDaemonSetListFromChannels(channels *common.ResourceChannels) (
73
66
return nil , err
74
67
}
75
68
76
- services := <- channels .ServiceList .List
77
- if err := <- channels .ServiceList .Error ; err != nil {
78
- return nil , err
79
- }
80
-
81
69
pods := <- channels .PodList .List
82
70
if err := <- channels .PodList .Error ; err != nil {
83
71
return nil , err
@@ -88,38 +76,21 @@ func GetDaemonSetListFromChannels(channels *common.ResourceChannels) (
88
76
return nil , err
89
77
}
90
78
91
- nodes := <- channels .NodeList .List
92
- if err := <- channels .NodeList .Error ; err != nil {
93
- return nil , err
94
- }
95
-
96
- result := getDaemonSetList (daemonSets .Items , services .Items ,
97
- pods .Items , events .Items , nodes .Items )
79
+ result := getDaemonSetList (daemonSets .Items , pods .Items , events .Items )
98
80
99
81
return result , nil
100
82
}
101
83
102
84
// Returns a list of all Daemon Set model objects in the cluster, based on all Kubernetes
103
85
// Daemon Set and Service API objects.
104
86
// The function processes all Daemon Set API objects and finds matching Services for them.
105
- func getDaemonSetList (daemonSets []extensions.DaemonSet ,
106
- services []api.Service , pods []api.Pod , events []api.Event ,
107
- nodes []api.Node ) * DaemonSetList {
87
+ func getDaemonSetList (daemonSets []extensions.DaemonSet , pods []api.Pod ,
88
+ events []api.Event ) * DaemonSetList {
108
89
109
90
daemonSetList := & DaemonSetList {DaemonSets : make ([]DaemonSet , 0 )}
110
91
111
92
for _ , daemonSet := range daemonSets {
112
93
113
- matchingServices := getMatchingServicesforDS (services , & daemonSet )
114
- var internalEndpoints []common.Endpoint
115
- var externalEndpoints []common.Endpoint
116
- for _ , service := range matchingServices {
117
- internalEndpoints = append (internalEndpoints ,
118
- common .GetInternalEndpoint (service .Name , service .Namespace , service .Spec .Ports ))
119
- // TODO: This may be wrong as we dont use all attributes from selector
120
- externalEndpoints = common .GetExternalEndpoints (daemonSet .Spec .Selector .MatchLabels , pods , service , nodes )
121
- }
122
-
123
94
matchingPods := make ([]api.Pod , 0 )
124
95
for _ , pod := range pods {
125
96
if pod .ObjectMeta .Namespace == daemonSet .ObjectMeta .Namespace &&
@@ -134,12 +105,10 @@ func getDaemonSetList(daemonSets []extensions.DaemonSet,
134
105
135
106
daemonSetList .DaemonSets = append (daemonSetList .DaemonSets ,
136
107
DaemonSet {
137
- ObjectMeta : common .NewObjectMeta (daemonSet .ObjectMeta ),
138
- TypeMeta : common .NewTypeMeta (common .ResourceKindDaemonSet ),
139
- Pods : podInfo ,
140
- ContainerImages : common .GetContainerImages (& daemonSet .Spec .Template .Spec ),
141
- InternalEndpoints : internalEndpoints ,
142
- ExternalEndpoints : externalEndpoints ,
108
+ ObjectMeta : common .NewObjectMeta (daemonSet .ObjectMeta ),
109
+ TypeMeta : common .NewTypeMeta (common .ResourceKindDaemonSet ),
110
+ Pods : podInfo ,
111
+ ContainerImages : common .GetContainerImages (& daemonSet .Spec .Template .Spec ),
143
112
})
144
113
}
145
114
0 commit comments