@@ -332,7 +332,7 @@ var _ = Describe("hub and spoke", Label("v1beta1"), Serial, Ordered, func() {
332332 return nil
333333 }, 5 * time .Minute , 10 * time .Second ).Should (Succeed ())
334334
335- By ("deleting the Hub and ensuring that it isn 't deleted until the ManifestWork is deleted" )
335+ By ("deleting the Hub and ensuring that the Hub and Spoke aren 't deleted until the ManifestWork is deleted" )
336336 ExpectWithOffset (1 , tc .kClient .Delete (tc .ctx , hubClone )).To (Succeed ())
337337 EventuallyWithOffset (1 , func () error {
338338 if err := tc .kClient .Get (tc .ctx , v1beta1hubNN , hubClone ); err != nil {
@@ -344,20 +344,31 @@ var _ = Describe("hub and spoke", Label("v1beta1"), Serial, Ordered, func() {
344344 utils .WarnError (err , "Hub deletion not started" )
345345 return err
346346 }
347- conditions := make ([]metav1.Condition , len (hubClone .Status .Conditions ))
348- for i , c := range hubClone .Status .Conditions {
347+ if err := tc .kClient .Get (tc .ctx , v1beta1hubAsSpokeNN , hubAsSpokeClone ); err != nil {
348+ utils .WarnError (err , "failed to get Spoke" )
349+ return err
350+ }
351+ if hubAsSpokeClone .Status .Phase != v1beta1 .Deleting {
352+ err := fmt .Errorf ("expected %s, got %s" , v1beta1 .Deleting , hubAsSpokeClone .Status .Phase )
353+ utils .WarnError (err , "Spoke deletion not started" )
354+ return err
355+ }
356+ conditions := make ([]metav1.Condition , len (hubAsSpokeClone .Status .Conditions ))
357+ for i , c := range hubAsSpokeClone .Status .Conditions {
349358 conditions [i ] = c .Condition
350359 }
351360 if err := utils .AssertConditions (conditions , map [string ]metav1.ConditionStatus {
352- v1beta1 .HubInitialized : metav1 .ConditionTrue ,
361+ v1beta1 .SpokeJoined : metav1 .ConditionTrue ,
353362 v1beta1 .CleanupFailed : metav1 .ConditionTrue ,
354363 v1beta1 .AddonsConfigured : metav1 .ConditionTrue ,
355- v1beta1 .HubUpgradeFailed : metav1 .ConditionFalse ,
364+ v1beta1 .KlusterletSynced : metav1 .ConditionTrue ,
365+ v1beta1 .PivotComplete : metav1 .ConditionTrue ,
356366 }); err != nil {
357367 utils .WarnError (err , "Hub deletion not blocked" )
358368 return err
359369 }
360370 return nil
371+
361372 }, 5 * time .Minute , 10 * time .Second ).Should (Succeed ())
362373
363374 By ("deleting the manifest work from the hub" )
0 commit comments