diff --git a/pkg/health/health.go b/pkg/health/health.go index e9ea7f6..b6fd8e3 100644 --- a/pkg/health/health.go +++ b/pkg/health/health.go @@ -38,6 +38,7 @@ const ( HealthStatusCreating HealthStatusCode = "Creating" HealthStatusDeleted HealthStatusCode = "Deleted" HealthStatusDeleting HealthStatusCode = "Deleting" + HealthStatusTerminating HealthStatusCode = "Terminating" HealthStatusError HealthStatusCode = "Error" HealthStatusRolloutFailed HealthStatusCode = "Rollout Failed" HealthStatusInaccesible HealthStatusCode = "Inaccesible" @@ -121,7 +122,7 @@ func GetResourceHealth(obj *unstructured.Unstructured, healthOverride HealthOver if obj.GetDeletionTimestamp() != nil { return &HealthStatus{ - Status: HealthStatusDeleting, + Status: HealthStatusTerminating, }, nil } diff --git a/pkg/health/health_namespace.go b/pkg/health/health_namespace.go index e5ab5cb..496eec1 100644 --- a/pkg/health/health_namespace.go +++ b/pkg/health/health_namespace.go @@ -24,6 +24,6 @@ func getNamespaceHealth(obj *unstructured.Unstructured) (*HealthStatus, error) { return &HealthStatus{ Health: HealthUnknown, - Status: HealthStatusDeleting, + Status: HealthStatusTerminating, }, nil } diff --git a/pkg/health/health_pod.go b/pkg/health/health_pod.go index 1570e92..351d7c2 100644 --- a/pkg/health/health_pod.go +++ b/pkg/health/health_pod.go @@ -29,13 +29,13 @@ func getCorev1PodHealth(pod *corev1.Pod) (*HealthStatus, error) { if pod.ObjectMeta.DeletionTimestamp != nil && !pod.ObjectMeta.DeletionTimestamp.IsZero() { if isReady { return &HealthStatus{ - Status: HealthStatusDeleting, + Status: HealthStatusTerminating, Ready: false, Health: HealthHealthy, }, nil } else { return &HealthStatus{ - Status: HealthStatusDeleting, + Status: HealthStatusTerminating, Ready: false, Health: HealthUnhealthy, }, nil diff --git a/pkg/health/health_test.go b/pkg/health/health_test.go index e9a7a27..a55a74f 100644 --- a/pkg/health/health_test.go +++ b/pkg/health/health_test.go @@ -37,7 +37,7 @@ func getHealthStatus(yamlPath string, t *testing.T) *health.HealthStatus { func TestNamespace(t *testing.T) { assertAppHealth(t, "./testdata/namespace.yaml", health.HealthStatusHealthy, health.HealthUnknown, true) - assertAppHealth(t, "./testdata/namespace-terminating.yaml", health.HealthStatusDeleting, health.HealthUnknown, false) + assertAppHealth(t, "./testdata/namespace-terminating.yaml", health.HealthStatusTerminating, health.HealthUnknown, false) } func TestCertificate(t *testing.T) { @@ -130,7 +130,7 @@ func TestPod(t *testing.T) { assertAppHealth(t, "./testdata/pod-running-restart-onfailure.yaml", health.HealthStatusRunning, health.HealthUnhealthy, false) assertAppHealth(t, "./testdata/pod-failed.yaml", health.HealthStatusError, health.HealthUnhealthy, true) assertAppHealth(t, "./testdata/pod-succeeded.yaml", health.HealthStatusCompleted, health.HealthHealthy, true) - assertAppHealth(t, "./testdata/pod-deletion.yaml", health.HealthStatusDeleting, health.HealthUnhealthy, false) + assertAppHealth(t, "./testdata/pod-deletion.yaml", health.HealthStatusTerminating, health.HealthUnhealthy, false) } // func TestAPIService(t *testing.T) {