From 9f26a36bcd8b6497a890fa13562d4c19b917f6f6 Mon Sep 17 00:00:00 2001 From: Aman Nijhawan Date: Wed, 1 Feb 2023 23:29:23 +0000 Subject: [PATCH] Adding a unit test to verify that partitioned rolling upgrade for a statefulset works. Signed-off-by: Aman Nijhawan --- pkg/kube/ready_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkg/kube/ready_test.go b/pkg/kube/ready_test.go index 9fe20d8cb..b5764ab68 100644 --- a/pkg/kube/ready_test.go +++ b/pkg/kube/ready_test.go @@ -189,6 +189,13 @@ func Test_ReadyChecker_statefulSetReady(t *testing.T) { }, want: false, }, + { + name: "statefulset is ready when current revision for current replicas does not match update revision for updated replicas when using partition !=0", + args: args{ + sts: newStatefulSetWithUpdateRevision("foo", 3, 2, 3, 3, "foo-bbbbbbb"), + }, + want: true, + }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) {