fix: Daemonset status search returns wrong result
Signed-off-by: hongming <talonwan@yunify.com>
This commit is contained in:
@@ -38,9 +38,9 @@ func (c *daemonSetSearcher) Get(namespace, name string) (interface{}, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func daemonSetStatus(item *v1.DaemonSet) string {
|
func daemonSetStatus(item *v1.DaemonSet) string {
|
||||||
if item.Status.NumberAvailable == 0 {
|
if item.Status.DesiredNumberScheduled == 0 && item.Status.NumberReady == 0 {
|
||||||
return v1alpha2.StatusStopped
|
return v1alpha2.StatusStopped
|
||||||
} else if item.Status.DesiredNumberScheduled == item.Status.NumberAvailable {
|
} else if item.Status.DesiredNumberScheduled == item.Status.NumberReady {
|
||||||
return v1alpha2.StatusRunning
|
return v1alpha2.StatusRunning
|
||||||
} else {
|
} else {
|
||||||
return v1alpha2.StatusUpdating
|
return v1alpha2.StatusUpdating
|
||||||
|
|||||||
Reference in New Issue
Block a user