diff --git a/src/gitops/components/rollout/revisions/ReplicaSetInfo.test.ts b/src/gitops/components/rollout/revisions/ReplicaSetInfo.test.ts index 10bdbed72..a82bc6618 100644 --- a/src/gitops/components/rollout/revisions/ReplicaSetInfo.test.ts +++ b/src/gitops/components/rollout/revisions/ReplicaSetInfo.test.ts @@ -132,6 +132,26 @@ describe('getReplicaSetInfo', () => { expect(result[0].status).toMatchInlineSnapshot(`"ScaledDown"`); }); + it('marks the replica set Progressing when replicas are still catching up', async () => { + const rollout = makeRollout(); + const rs = makeRS('rs-scaling', 'scaling-hash', '3', 3); + rs.status.availableReplicas = 1; + rs.status.readyReplicas = 1; + rs.status.replicas = 2; + const result = await getReplicaSetInfo(rollout, [rs], [], []); + expect(result[0].status).toMatchInlineSnapshot(`"Progressing"`); + }); + + it('picks up the scale-down deadline from the annotation', async () => { + const rollout = makeRollout(); + const rs = makeRS('rs-old', 'old-hash', '0', 0); + rs.status.replicas = 0; + rs.status.availableReplicas = 0; + rs.metadata.annotations['scale-down-deadline'] = '2026-10-22T12:00:00Z'; + const result = await getReplicaSetInfo(rollout, [rs], [], []); + expect(result[0].replicaSetScaleDownDeadline).toMatchInlineSnapshot(`"2026-10-22T12:00:00Z"`); + }); + it('assigns pods to their owning RS', async () => { const rollout = makeRollout(); const rs = makeRS('rs-1', 'hash-1', '1'); diff --git a/src/gitops/components/shared/pod-utils.test.ts b/src/gitops/components/shared/pod-utils.test.ts index 73750ac80..787fc2da8 100644 --- a/src/gitops/components/shared/pod-utils.test.ts +++ b/src/gitops/components/shared/pod-utils.test.ts @@ -103,4 +103,26 @@ describe('getPodStatus', () => { ), ).toMatchInlineSnapshot(`"Succeeded"`); }); + + it('marks the pod Not Ready when containerStatuses is missing', () => { + const pod = makePod(); + delete pod.status.containerStatuses; + expect(getPodStatus(pod)).toMatchInlineSnapshot(`"Not Ready"`); + }); + + it('ignores an unrecognised waiting reason instead of CrashLoopBackOff', () => { + expect( + getPodStatus( + makePod({ + containerStatuses: [ + { + name: 'main', + ready: false, + state: { waiting: { reason: 'ContainerCreating' } }, + }, + ], + }), + ), + ).toMatchInlineSnapshot(`"Not Ready"`); + }); });