@@ -977,6 +977,39 @@ func TestPutorPatchOpenShiftClusterUpdatePut(t *testing.T) {
977977 },
978978 wantError : "400: RequestNotAllowed: : Request is not allowed on cluster whose deletion failed. Delete the cluster." ,
979979 },
980+ {
981+ name : "update a cluster from failed with empty failedProvisioningState" ,
982+ request : func () * v20240812preview.OpenShiftCluster {
983+ cluster := getServicePrincipalOpenShiftClusterRequest ()
984+ cluster .Properties .NetworkProfile .OutboundType = v20240812preview .OutboundTypeLoadbalancer
985+ cluster .Properties .NetworkProfile .PreconfiguredNSG = v20240812preview .PreconfiguredNSGDisabled
986+ cluster .Properties .NetworkProfile .LoadBalancerProfile = & v20240812preview.LoadBalancerProfile {
987+ ManagedOutboundIPs : & v20240812preview.ManagedOutboundIPs {
988+ Count : 1 ,
989+ },
990+ }
991+ return cluster
992+ },
993+ fixture : func (f * testdatabase.Fixture ) {
994+ f .AddSubscriptionDocuments (mockSubscriptionDocument )
995+ f .AddOpenShiftClusterDocuments (getExistingServicePrincipalOpenShiftClusterDocument (api .ProvisioningStateFailed , "" , "" ))
996+ },
997+ wantSystemDataEnriched : true ,
998+ wantAsync : true ,
999+ wantStatusCode : http .StatusOK ,
1000+ wantDocuments : func (checker * testdatabase.Checker ) {
1001+ checker .AddAsyncOperationDocuments (getAsynchronousOperationDocument (api .ProvisioningStateUpdating , api .ProvisioningStateUpdating ))
1002+ doc := getExistingServicePrincipalOpenShiftClusterDocument (api .ProvisioningStateUpdating , "" , "" )
1003+ doc .OpenShiftCluster .Properties .NetworkProfile .LoadBalancerProfile .EffectiveOutboundIPs = []api.EffectiveOutboundIP {}
1004+ doc .OpenShiftCluster .Properties .LastProvisioningState = api .ProvisioningStateFailed
1005+ checker .AddOpenShiftClusterDocuments (doc )
1006+ },
1007+ wantResponse : func () * v20240812preview.OpenShiftCluster {
1008+ response := getExistingServicePrincipalOpenShiftClusterResponse ()
1009+ response .Properties .ProvisioningState = v20240812preview .ProvisioningStateUpdating
1010+ return response
1011+ },
1012+ },
9801013 {
9811014 name : "update a Workload Identity cluster from succeeded" ,
9821015 request : func () * v20240812preview.OpenShiftCluster {
@@ -1570,6 +1603,31 @@ func TestPutorPatchOpenShiftClusterUpdatePatch(t *testing.T) {
15701603 },
15711604 wantError : "400: RequestNotAllowed: : Request is not allowed on cluster whose deletion failed. Delete the cluster." ,
15721605 },
1606+ {
1607+ name : "update a cluster from failed with empty failedProvisioningState" ,
1608+ request : func () * v20240812preview.OpenShiftCluster {
1609+ return & v20240812preview.OpenShiftCluster {}
1610+ },
1611+ fixture : func (f * testdatabase.Fixture ) {
1612+ f .AddSubscriptionDocuments (mockSubscriptionDocument )
1613+ f .AddOpenShiftClusterDocuments (getExistingServicePrincipalOpenShiftClusterDocument (api .ProvisioningStateFailed , "" , "" ))
1614+ },
1615+ wantSystemDataEnriched : true ,
1616+ wantAsync : true ,
1617+ wantStatusCode : http .StatusOK ,
1618+ wantDocuments : func (checker * testdatabase.Checker ) {
1619+ checker .AddAsyncOperationDocuments (getAsynchronousOperationDocument (api .ProvisioningStateUpdating , api .ProvisioningStateUpdating ))
1620+ doc := getExistingServicePrincipalOpenShiftClusterDocument (api .ProvisioningStateUpdating , "" , "" )
1621+ doc .OpenShiftCluster .Properties .NetworkProfile .LoadBalancerProfile .EffectiveOutboundIPs = []api.EffectiveOutboundIP {}
1622+ doc .OpenShiftCluster .Properties .LastProvisioningState = api .ProvisioningStateFailed
1623+ checker .AddOpenShiftClusterDocuments (doc )
1624+ },
1625+ wantResponse : func () * v20240812preview.OpenShiftCluster {
1626+ response := getExistingServicePrincipalOpenShiftClusterResponse ()
1627+ response .Properties .ProvisioningState = v20240812preview .ProvisioningStateUpdating
1628+ return response
1629+ },
1630+ },
15731631 } {
15741632 t .Run (tt .name , func (t * testing.T ) {
15751633 ti := newTestInfra (t ).
0 commit comments