add extra annotations

Signed-off-by: hongming <talonwan@yunify.com>
This commit is contained in:
hongming
2019-05-01 00:23:48 +08:00
committed by zryfish
parent 3e8035dc2b
commit 8e2acfa7f6
16 changed files with 162 additions and 59 deletions

View File

@@ -39,14 +39,14 @@ func (*statefulSetSearcher) get(namespace, name string) (interface{}, error) {
func statefulSetStatus(item *v1.StatefulSet) string {
if item.Spec.Replicas != nil {
if item.Status.ReadyReplicas == 0 && *item.Spec.Replicas == 0 {
return stopped
return StatusStopped
} else if item.Status.ReadyReplicas == *item.Spec.Replicas {
return running
return StatusRunning
} else {
return updating
return StatusUpdating
}
}
return stopped
return StatusStopped
}
// Exactly Match
@@ -62,7 +62,7 @@ func (*statefulSetSearcher) match(match map[string]string, item *v1.StatefulSet)
if !strings.Contains(item.Name, v) && !searchFuzzy(item.Labels, "", v) && !searchFuzzy(item.Annotations, "", v) {
return false
}
case status:
case Status:
if statefulSetStatus(item) != v {
return false
}