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