@@ -792,6 +792,27 @@ func TestReconcileVMSS(t *testing.T) {
792792 }}
793793 instances := newDefaultInstances ()
794794
795+ setupDefaultVMSSInProgressOperationDoneExpectations (s , m , vmss , instances )
796+ s .DeleteLongRunningOperationState (spec .Name , serviceName , infrav1 .PutFuture )
797+ s .DeleteLongRunningOperationState (spec .Name , serviceName , infrav1 .PatchFuture )
798+ s .UpdatePutStatus (infrav1 .BootstrapSucceededCondition , serviceName , nil )
799+ s .Location ().AnyTimes ().Return ("test-location" )
800+ s .HasReplicasExternallyManaged (gomockinternal .AContext ()).Return (false )
801+ },
802+ },
803+ {
804+ name : "should not panic when DiagnosticsProfile is nil" ,
805+ expectedError : "" ,
806+ expect : func (g * WithT , s * mock_scalesets.MockScaleSetScopeMockRecorder , m * mock_scalesets.MockClientMockRecorder ) {
807+ spec := newDefaultVMSSSpec ()
808+ spec .DiagnosticsProfile = nil
809+ s .ScaleSetSpec ().Return (spec ).AnyTimes ()
810+
811+ vmss := newDefaultVMSS ("VM_SIZE" )
812+ vmss .VirtualMachineScaleSetProperties .VirtualMachineProfile .DiagnosticsProfile = nil
813+
814+ instances := newDefaultInstances ()
815+
795816 setupDefaultVMSSInProgressOperationDoneExpectations (s , m , vmss , instances )
796817 s .DeleteLongRunningOperationState (spec .Name , serviceName , infrav1 .PutFuture )
797818 s .DeleteLongRunningOperationState (spec .Name , serviceName , infrav1 .PatchFuture )
0 commit comments