diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-12 12:12:56 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-12 12:12:56 +0300 |
commit | 2d560e614a2d5feea84288c2d1f50b40d796f97a (patch) | |
tree | 8a6a18e6f5befc04de3db43554899aced9af5fd3 /app/assets/javascripts/kubernetes_dashboard/helpers | |
parent | d89147da045b9d00c4e35de3c7b39ed2b02ef7a6 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/kubernetes_dashboard/helpers')
-rw-r--r-- | app/assets/javascripts/kubernetes_dashboard/helpers/k8s_integration_helper.js | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/app/assets/javascripts/kubernetes_dashboard/helpers/k8s_integration_helper.js b/app/assets/javascripts/kubernetes_dashboard/helpers/k8s_integration_helper.js index d55a57f0ab7..17f1ebdc013 100644 --- a/app/assets/javascripts/kubernetes_dashboard/helpers/k8s_integration_helper.js +++ b/app/assets/javascripts/kubernetes_dashboard/helpers/k8s_integration_helper.js @@ -1,5 +1,11 @@ import { differenceInSeconds } from '~/lib/utils/datetime_utility'; -import { STATUS_TRUE, STATUS_FALSE, PHASE_PENDING, PHASE_READY, PHASE_FAILED } from '../constants'; +import { + STATUS_TRUE, + STATUS_FALSE, + STATUS_PENDING, + STATUS_READY, + STATUS_FAILED, +} from '../constants'; export function getAge(creationTimestamp) { if (!creationTimestamp) return ''; @@ -28,10 +34,17 @@ export function getAge(creationTimestamp) { export function calculateDeploymentStatus(item) { const [available, progressing] = item.status?.conditions ?? []; if (available?.status === STATUS_TRUE) { - return PHASE_READY; + return STATUS_READY; } if (available?.status === STATUS_FALSE && progressing?.status !== STATUS_TRUE) { - return PHASE_FAILED; + return STATUS_FAILED; } - return PHASE_PENDING; + return STATUS_PENDING; +} + +export function calculateStatefulSetStatus(item) { + if (item.status?.readyReplicas === item.spec?.replicas) { + return STATUS_READY; + } + return STATUS_FAILED; } |