Skip to content

Commit 304cd34

Browse files
authored
Merge pull request #4754 from Azure/revert-4
Revert "Merge pull request #4605 from Azure/fix-panic"
2 parents 2a70660 + 1272266 commit 304cd34

File tree

2 files changed

+0
-13
lines changed

2 files changed

+0
-13
lines changed

backend/pkg/informers/informers.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -489,14 +489,8 @@ func NewActiveOperationInformerWithRelistDuration(lister database.GlobalLister[a
489489
func resourceGroupIndexFunc(obj interface{}) ([]string, error) {
490490
switch castObj := obj.(type) {
491491
case arm.CosmosMetadataAccessor:
492-
if castObj.GetResourceID() == nil {
493-
return nil, utils.TrackError(fmt.Errorf("obj is missing resourceID: %T %v", obj, obj))
494-
}
495492
return []string{api.ToResourceGroupResourceIDString(castObj.GetResourceID().SubscriptionID, castObj.GetResourceID().ResourceGroupName)}, nil
496493
case arm.CosmosPersistable:
497-
if castObj.GetCosmosData() == nil || castObj.GetCosmosData().ResourceID == nil {
498-
return nil, utils.TrackError(fmt.Errorf("obj is missing resourceID: %T %v", obj, obj))
499-
}
500494
return []string{api.ToResourceGroupResourceIDString(castObj.GetCosmosData().ResourceID.SubscriptionID, castObj.GetCosmosData().ResourceID.ResourceGroupName)}, nil
501495
default:
502496
return nil, utils.TrackError(fmt.Errorf("unexpected type %T, expected api.CosmosMetadataAccessor or api.CosmosPersistable", obj))

internal/database/convert_generic.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,6 @@ func CosmosGenericToInternal[InternalAPIType any](cosmosObj *GenericDocument[Int
6565
if !ok {
6666
return nil, fmt.Errorf("internalObj must be an arm.CosmosMetadataAccessor: %T", cosmosObj)
6767
}
68-
if ret.GetResourceID() == nil {
69-
if cosmosObj.ResourceID != nil {
70-
ret.(arm.CosmosPersistable).GetCosmosData().ResourceID = cosmosObj.ResourceID
71-
} else {
72-
return nil, fmt.Errorf("internalObj is missing a resourceID: %T: %q", cosmosObj, cosmosObj.ID)
73-
}
74-
}
7568
ret.(arm.CosmosPersistable).GetCosmosData().ExistingCosmosUID = cosmosObj.ID
7669
ret.SetEtag(cosmosObj.CosmosETag)
7770

0 commit comments

Comments
 (0)