@@ -727,7 +727,6 @@ func TestCreateOrUpdateResource(t *testing.T) {
727727 })
728728 specMock .MockASOResourceSpecGetter .EXPECT ().WasManaged (gomock .Any ()).Return (false )
729729
730- specMock .MockTagsGetterSetter .EXPECT ().GetActualTags (gomock .Any ()).Return (nil )
731730 specMock .MockTagsGetterSetter .EXPECT ().GetAdditionalTags ().Return (nil )
732731 specMock .MockTagsGetterSetter .EXPECT ().GetDesiredTags (gomock .Any ()).Return (nil ).Times (2 )
733732 specMock .MockTagsGetterSetter .EXPECT ().SetTags (gomock .Any (), gomock .Any ())
@@ -819,71 +818,6 @@ func TestCreateOrUpdateResource(t *testing.T) {
819818 g .Expect (err .Error ()).To (ContainSubstring ("failed to reconcile tags" ))
820819 })
821820
822- t .Run ("with tags not done error and readyErr" , func (t * testing.T ) {
823- g := NewGomegaWithT (t )
824-
825- sch := runtime .NewScheme ()
826- g .Expect (asoresourcesv1 .AddToScheme (sch )).To (Succeed ())
827- c := fakeclient .NewClientBuilder ().
828- WithScheme (sch ).
829- Build ()
830- s := New [* asoresourcesv1.ResourceGroup ](c , clusterName )
831-
832- mockCtrl := gomock .NewController (t )
833- specMock := struct {
834- * mock_azure.MockASOResourceSpecGetter [* asoresourcesv1.ResourceGroup ]
835- * mock_aso.MockTagsGetterSetter [* asoresourcesv1.ResourceGroup ]
836- }{
837- MockASOResourceSpecGetter : mock_azure.NewMockASOResourceSpecGetter [* asoresourcesv1.ResourceGroup ](mockCtrl ),
838- MockTagsGetterSetter : mock_aso.NewMockTagsGetterSetter [* asoresourcesv1.ResourceGroup ](mockCtrl ),
839- }
840- specMock .MockASOResourceSpecGetter .EXPECT ().ResourceRef ().Return (& asoresourcesv1.ResourceGroup {
841- ObjectMeta : metav1.ObjectMeta {
842- Name : "name" ,
843- Namespace : "namespace" ,
844- },
845- })
846- specMock .MockASOResourceSpecGetter .EXPECT ().Parameters (gomockinternal .AContext (), gomock .Any ()).DoAndReturn (func (_ context.Context , group * asoresourcesv1.ResourceGroup ) (* asoresourcesv1.ResourceGroup , error ) {
847- return group , nil
848- })
849-
850- existing := & asoresourcesv1.ResourceGroup {
851- ObjectMeta : metav1.ObjectMeta {
852- Name : "name" ,
853- Namespace : "namespace" ,
854- Labels : map [string ]string {
855- infrav1 .OwnedByClusterLabelKey : clusterName ,
856- },
857- Annotations : map [string ]string {
858- asoannotations .ReconcilePolicy : string (asoannotations .ReconcilePolicyManage ),
859- },
860- },
861- Spec : asoresourcesv1.ResourceGroup_Spec {
862- Tags : map [string ]string {"desired" : "tags" },
863- },
864- Status : asoresourcesv1.ResourceGroup_STATUS {
865- Tags : map [string ]string {"actual" : "tags" },
866- Conditions : []conditions.Condition {
867- {
868- Type : conditions .ConditionTypeReady ,
869- Status : metav1 .ConditionFalse ,
870- Message : "not ready :(" ,
871- },
872- },
873- },
874- }
875-
876- specMock .MockTagsGetterSetter .EXPECT ().GetActualTags (gomock .Any ()).Return (existing .Status .Tags )
877- specMock .MockTagsGetterSetter .EXPECT ().GetDesiredTags (gomock .Any ()).Return (existing .Spec .Tags )
878-
879- ctx := context .Background ()
880- g .Expect (c .Create (ctx , existing )).To (Succeed ())
881-
882- result , err := s .CreateOrUpdateResource (ctx , specMock , "service" )
883- g .Expect (result ).To (BeNil ())
884- g .Expect (err .Error ()).To (ContainSubstring ("not ready :(" ))
885- })
886-
887821 t .Run ("reconcile policy annotation resets after un-pause" , func (t * testing.T ) {
888822 g := NewGomegaWithT (t )
889823
0 commit comments