returns true if min_replicas are not ready and no updated replicas have errored
(deployment *kapps.Deployment)
| 394 | |
| 395 | // returns true if min_replicas are not ready and no updated replicas have errored |
| 396 | func isAPIUpdating(deployment *kapps.Deployment) (bool, error) { |
| 397 | pods, err := config.K8s.ListPodsByLabel("apiName", deployment.Labels["apiName"]) |
| 398 | if err != nil { |
| 399 | return false, err |
| 400 | } |
| 401 | |
| 402 | replicaCounts := GetReplicaCounts(deployment, pods) |
| 403 | |
| 404 | autoscalingSpec, err := userconfig.AutoscalingFromAnnotations(deployment) |
| 405 | if err != nil { |
| 406 | return false, err |
| 407 | } |
| 408 | |
| 409 | if replicaCounts.Ready < autoscalingSpec.MinReplicas && replicaCounts.TotalFailed() == 0 { |
| 410 | return true, nil |
| 411 | } |
| 412 | |
| 413 | return false, nil |
| 414 | } |
| 415 | |
| 416 | func isPodSpecLatest(deployment *kapps.Deployment, pod *kcore.Pod) bool { |
| 417 | return deployment.Spec.Template.Labels["podID"] == pod.Labels["podID"] && |
no test coverage detected