@@ -19,6 +19,7 @@ import (
19
19
20
20
"github.com/kubernetes/dashboard/client"
21
21
"github.com/kubernetes/dashboard/resource/common"
22
+ "github.com/kubernetes/dashboard/resource/daemonset"
22
23
"github.com/kubernetes/dashboard/resource/deployment"
23
24
"github.com/kubernetes/dashboard/resource/pod"
24
25
"github.com/kubernetes/dashboard/resource/replicaset"
@@ -35,6 +36,8 @@ type Workloads struct {
35
36
ReplicationControllerList replicationcontroller.ReplicationControllerList `json:"replicationControllerList"`
36
37
37
38
PodList pod.PodList `json:"podList"`
39
+
40
+ DaemonSetList daemonset.DaemonSetList `json:"daemonSetList"`
38
41
}
39
42
40
43
// GetWorkloads returns a list of all workloads in the cluster.
@@ -45,11 +48,12 @@ func GetWorkloads(client k8sClient.Interface,
45
48
channels := & common.ResourceChannels {
46
49
ReplicationControllerList : common .GetReplicationControllerListChannel (client , nsQuery , 1 ),
47
50
ReplicaSetList : common .GetReplicaSetListChannel (client .Extensions (), nsQuery , 1 ),
51
+ DaemonSetList : common .GetDaemonSetListChannel (client .Extensions (), nsQuery , 1 ),
48
52
DeploymentList : common .GetDeploymentListChannel (client .Extensions (), nsQuery , 1 ),
49
- ServiceList : common .GetServiceListChannel (client , nsQuery , 3 ),
50
- PodList : common .GetPodListChannel (client , nsQuery , 4 ),
51
- EventList : common .GetEventListChannel (client , nsQuery , 3 ),
52
- NodeList : common .GetNodeListChannel (client , nsQuery , 3 ),
53
+ ServiceList : common .GetServiceListChannel (client , nsQuery , 4 ),
54
+ PodList : common .GetPodListChannel (client , nsQuery , 5 ),
55
+ EventList : common .GetEventListChannel (client , nsQuery , 4 ),
56
+ NodeList : common .GetNodeListChannel (client , nsQuery , 4 ),
53
57
}
54
58
55
59
return GetWorkloadsFromChannels (channels , heapsterClient )
@@ -64,7 +68,8 @@ func GetWorkloadsFromChannels(channels *common.ResourceChannels,
64
68
deploymentChan := make (chan * deployment.DeploymentList )
65
69
rcChan := make (chan * replicationcontroller.ReplicationControllerList )
66
70
podChan := make (chan * pod.PodList )
67
- errChan := make (chan error , 4 )
71
+ dsChan := make (chan * daemonset.DaemonSetList )
72
+ errChan := make (chan error , 5 )
68
73
69
74
go func () {
70
75
rcList , err := replicationcontroller .GetReplicationControllerListFromChannels (channels )
@@ -90,6 +95,12 @@ func GetWorkloadsFromChannels(channels *common.ResourceChannels,
90
95
podChan <- podList
91
96
}()
92
97
98
+ go func () {
99
+ dsList , err := daemonset .GetDaemonSetListFromChannels (channels )
100
+ errChan <- err
101
+ dsChan <- dsList
102
+ }()
103
+
93
104
rcList := <- rcChan
94
105
err := <- errChan
95
106
if err != nil {
@@ -114,11 +125,18 @@ func GetWorkloadsFromChannels(channels *common.ResourceChannels,
114
125
return nil , err
115
126
}
116
127
128
+ dsList := <- dsChan
129
+ err = <- errChan
130
+ if err != nil {
131
+ return nil , err
132
+ }
133
+
117
134
workloads := & Workloads {
118
135
ReplicaSetList : * rsList ,
119
136
ReplicationControllerList : * rcList ,
120
137
DeploymentList : * deploymentList ,
121
138
PodList : * podList ,
139
+ DaemonSetList : * dsList ,
122
140
}
123
141
124
142
return workloads , nil
0 commit comments