Skip to content

Commit 353a41e

Browse files
Add test requested by copilot
1 parent d9cc479 commit 353a41e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

internal/operator-controller/applier/boxcutter_test.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1514,6 +1514,16 @@ func TestBoxcutterStorageMigrator(t *testing.T) {
15141514
}).
15151515
Return(nil)
15161516

1517+
// The migration flow calls Get() to re-fetch the revision before checking its status.
1518+
// Even for non-migrated revisions, Get() is called to determine if status needs to be set.
1519+
client.
1520+
On("Get", mock.Anything, mock.Anything, mock.AnythingOfType("*v1.ClusterExtensionRevision"), mock.Anything).
1521+
Run(func(args mock.Arguments) {
1522+
rev := args.Get(2).(*ocv1.ClusterExtensionRevision)
1523+
*rev = existingRev
1524+
}).
1525+
Return(nil)
1526+
15171527
err := sm.Migrate(t.Context(), ext, map[string]string{"my-label": "my-value"})
15181528
require.NoError(t, err)
15191529

0 commit comments

Comments
 (0)