[ADD] add test code

This commit is contained in:
zhoujunhao 2018-06-13 18:20:02 +08:00
parent f757b07add
commit 38664596b5

View File

@ -259,12 +259,14 @@ func queryStatefulResource(m *Manager) []Resource {
} }
} }
fmt.Println(StatefulSetsMap)
for k, valuse := range StatefulSetsMap { for k, valuse := range StatefulSetsMap {
StatefulSetsList, err := m.kubeclient.StatefulSets(k).List(meta_v1.ListOptions{}) StatefulSetsList, err := m.kubeclient.StatefulSets(k).List(meta_v1.ListOptions{})
if err != nil { if err != nil {
logrus.Error(err) logrus.Error(err)
} }
for _, v := range StatefulSetsList.Items { for _, v := range StatefulSetsList.Items {
fmt.Println(v.Namespace,v.Name)
if InSlice(v.Name, valuse) { if InSlice(v.Name, valuse) {
s := &statefulResource{ s := &statefulResource{
createTime: time.Now(), createTime: time.Now(),