Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Blake Pettersson <blake.pettersson@gmail.com>
Signed-off-by: Manuel Kieweg <2939765+mkieweg@users.noreply.github.com>
  • Loading branch information
mkieweg and blakepettersson authored Jul 2, 2024
1 parent ffecff0 commit 642faf2
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions controller/appcontroller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1630,7 +1630,6 @@ func TestUpdateHealthStatusProgression(t *testing.T) {
ObjectMeta: metav1.ObjectMeta{
Name: "demo",
Namespace: "default",
Labels: map[string]string{"status": "Degraded"},
},
Status: v1.DeploymentStatus{
ObservedGeneration: 0,
Expand Down Expand Up @@ -1683,28 +1682,34 @@ apps/Deployment:

testCases := []struct {
name string
initialStatus string
expectedStatus health.HealthStatusCode
}{
{
name: "Degraded to Missing",
initialStatus: "Degraded",
expectedStatus: health.HealthStatusMissing,
},
{
name: "Missing to Progressing",
initialStatus: "Missing",
expectedStatus: health.HealthStatusProgressing,
},
{
name: "Progressing to Healthy",
initialStatus: "Progressing",
expectedStatus: health.HealthStatusHealthy,
},
{
name: "Healthy to Degraded",
name: "Healthy to Degraded",
initialStatus: "Healthy",
expectedStatus: health.HealthStatusDegraded,
},
}

for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {
deployment.SetLabels(map[string]string{"status": tc.initialStatus})
ctrl.processAppRefreshQueueItem()
apps, err := ctrl.appLister.List(labels.Everything())
require.NoError(t, err)
Expand Down

0 comments on commit 642faf2

Please sign in to comment.