Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions admin/server/handlers/hcp/serialconsole_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ func TestSerialConsoleHandler(t *testing.T) {
internalID, err := api.NewInternalID("/api/clusters_mgmt/v1/clusters/test-cluster-id")
require.NoError(t, err)
hcp := &api.HCPOpenShiftCluster{
CosmosMetadata: arm.CosmosMetadata{
ResourceID: resourceID,
},
TrackedResource: arm.TrackedResource{
Resource: arm.Resource{ID: resourceID},
},
Expand All @@ -117,6 +120,9 @@ func TestSerialConsoleHandler(t *testing.T) {
internalID, err := api.NewInternalID("/api/clusters_mgmt/v1/clusters/test-cluster-id")
require.NoError(t, err)
hcp := &api.HCPOpenShiftCluster{
CosmosMetadata: arm.CosmosMetadata{
ResourceID: resourceID,
},
TrackedResource: arm.TrackedResource{
Resource: arm.Resource{ID: resourceID},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ func newTestSubscription() *arm.Subscription {
func newTestCluster(t *testing.T, clusterUID string, provisioningState arm.ProvisioningState, createdAt *time.Time) *api.HCPOpenShiftCluster {
t.Helper()
return &api.HCPOpenShiftCluster{
CosmosMetadata: arm.CosmosMetadata{
ResourceID: newTestClusterResourceID(t),
},
TrackedResource: arm.TrackedResource{
Resource: arm.Resource{
ID: newTestClusterResourceID(t),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ func TestOrphanedBillingCleanup_SyncOnce(t *testing.T) {
clusters: []*api.HCPOpenShiftCluster{
// Only cluster-2 exists
{
CosmosMetadata: arm.CosmosMetadata{
ResourceID: api.Must(azcorearm.ParseResourceID("/subscriptions/" + testSubscriptionID + "/resourceGroups/" + testResourceGroupName + "/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/cluster-2")),
},
TrackedResource: arm.TrackedResource{
Resource: arm.Resource{
ID: api.Must(azcorearm.ParseResourceID("/subscriptions/" + testSubscriptionID + "/resourceGroups/" + testResourceGroupName + "/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/cluster-2")),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,9 @@ func newTestCluster(opts ...func(*api.HCPOpenShiftCluster)) *api.HCPOpenShiftClu
))

cluster := &api.HCPOpenShiftCluster{
CosmosMetadata: arm.CosmosMetadata{
ResourceID: resourceID,
},
TrackedResource: arm.TrackedResource{
Resource: arm.Resource{
ID: resourceID,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ func TestBuildInitialReadonlyMaestroBundleForHostedCluster(t *testing.T) {

clusterResourceID := api.Must(azcorearm.ParseResourceID("/subscriptions/test-sub/resourceGroups/test-rg/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/test-cluster"))
cluster := &api.HCPOpenShiftCluster{
CosmosMetadata: arm.CosmosMetadata{
ResourceID: clusterResourceID,
},
TrackedResource: arm.TrackedResource{
Resource: arm.Resource{
ID: clusterResourceID,
Expand Down Expand Up @@ -399,6 +402,9 @@ func TestCreateClusterScopedMaestroReadonlyBundlesSyncer_syncMaestroBundle(t *te
}
ctx := context.Background()
cluster := &api.HCPOpenShiftCluster{
CosmosMetadata: arm.CosmosMetadata{
ResourceID: clusterResourceID,
},
TrackedResource: arm.TrackedResource{
Resource: arm.Resource{ID: clusterResourceID},
},
Expand Down Expand Up @@ -537,6 +543,9 @@ func TestCreateClusterScopedMaestroReadonlyBundlesSyncer_SyncOnce_GetServiceProv

clusterResourceID := api.Must(azcorearm.ParseResourceID("/subscriptions/test-sub/resourceGroups/test-rg/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/test-cluster"))
cluster := &api.HCPOpenShiftCluster{
CosmosMetadata: arm.CosmosMetadata{
ResourceID: clusterResourceID,
},
TrackedResource: arm.TrackedResource{Resource: arm.Resource{ID: clusterResourceID}},
ServiceProviderProperties: api.HCPOpenShiftClusterServiceProviderProperties{
ClusterServiceID: api.Ptr(api.Must(api.NewInternalID("/api/aro_hcp/v1alpha1/clusters/11111111111111111111111111111111"))),
Expand Down Expand Up @@ -587,6 +596,9 @@ func TestCreateClusterScopedMaestroReadonlyBundlesSyncer_SyncOnce_AllBundlesAlre

clusterResourceID := api.Must(azcorearm.ParseResourceID("/subscriptions/test-sub/resourceGroups/test-rg/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/test-cluster"))
cluster := &api.HCPOpenShiftCluster{
CosmosMetadata: arm.CosmosMetadata{
ResourceID: clusterResourceID,
},
TrackedResource: arm.TrackedResource{
Resource: arm.Resource{ID: clusterResourceID},
},
Expand Down Expand Up @@ -656,6 +668,9 @@ func TestCreateClusterScopedMaestroReadonlyBundlesSyncer_SyncOnce_SyncLoopExecut
// Setup cluster
clusterResourceID := api.Must(azcorearm.ParseResourceID("/subscriptions/test-sub/resourceGroups/test-rg/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/test-cluster"))
cluster := &api.HCPOpenShiftCluster{
CosmosMetadata: arm.CosmosMetadata{
ResourceID: clusterResourceID,
},
TrackedResource: arm.TrackedResource{
Resource: arm.Resource{
ID: clusterResourceID,
Expand Down Expand Up @@ -769,6 +784,9 @@ func TestCreateClusterScopedMaestroReadonlyBundlesSyncer_SyncOnce_ProcessesParti

clusterResourceID := api.Must(azcorearm.ParseResourceID("/subscriptions/test-sub/resourceGroups/test-rg/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/test-cluster"))
cluster := &api.HCPOpenShiftCluster{
CosmosMetadata: arm.CosmosMetadata{
ResourceID: clusterResourceID,
},
TrackedResource: arm.TrackedResource{
Resource: arm.Resource{ID: clusterResourceID},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,9 @@ func TestCSStateDump_SyncOnce(t *testing.T) {
if tt.createCluster {
clusterResourceID := api.Must(azcorearm.ParseResourceID("/subscriptions/test-sub/resourceGroups/test-rg/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/test-cluster"))
cluster := &api.HCPOpenShiftCluster{
CosmosMetadata: arm.CosmosMetadata{
ResourceID: clusterResourceID,
},
TrackedResource: arm.TrackedResource{
Resource: arm.Resource{ID: clusterResourceID},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -802,6 +802,9 @@ func TestDeleteOrphanedMaestroReadonlyBundles_mapServiceProviderClustersByProvis
mockResourcesDBClient := databasetesting.NewMockResourcesDBClient()
mockCS := ocm.NewMockClusterServiceClientSpec(ctrl)
cluster := &api.HCPOpenShiftCluster{
CosmosMetadata: arm.CosmosMetadata{
ResourceID: clusterResourceID,
},
TrackedResource: arm.TrackedResource{Resource: arm.Resource{ID: clusterResourceID}},
ServiceProviderProperties: api.HCPOpenShiftClusterServiceProviderProperties{
ClusterServiceID: api.Ptr(api.Must(api.NewInternalID("/api/aro_hcp/v1alpha1/clusters/csid"))),
Expand All @@ -826,6 +829,9 @@ func TestDeleteOrphanedMaestroReadonlyBundles_mapServiceProviderClustersByProvis
mockResourcesDBClient := databasetesting.NewMockResourcesDBClient()
mockCS := ocm.NewMockClusterServiceClientSpec(ctrl)
cluster := &api.HCPOpenShiftCluster{
CosmosMetadata: arm.CosmosMetadata{
ResourceID: clusterResourceID,
},
TrackedResource: arm.TrackedResource{Resource: arm.Resource{ID: clusterResourceID}},
ServiceProviderProperties: api.HCPOpenShiftClusterServiceProviderProperties{
ClusterServiceID: api.Ptr(api.Must(api.NewInternalID("/api/aro_hcp/v1alpha1/clusters/csid"))),
Expand Down Expand Up @@ -863,6 +869,9 @@ func TestDeleteOrphanedMaestroReadonlyBundles_mapServiceProviderClustersByProvis
mockResourcesDBClient := databasetesting.NewMockResourcesDBClient()
mockCS := ocm.NewMockClusterServiceClientSpec(ctrl)
cluster := &api.HCPOpenShiftCluster{
CosmosMetadata: arm.CosmosMetadata{
ResourceID: clusterResourceID,
},
TrackedResource: arm.TrackedResource{Resource: arm.Resource{ID: clusterResourceID}},
ServiceProviderProperties: api.HCPOpenShiftClusterServiceProviderProperties{
ClusterServiceID: api.Ptr(api.Must(api.NewInternalID("/api/aro_hcp/v1alpha1/clusters/csid"))),
Expand Down Expand Up @@ -895,12 +904,18 @@ func TestDeleteOrphanedMaestroReadonlyBundles_mapServiceProviderClustersByProvis
cluster1ResourceID := api.Must(azcorearm.ParseResourceID("/subscriptions/sub1/resourceGroups/rg1/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/cluster1"))
cluster2ResourceID := api.Must(azcorearm.ParseResourceID("/subscriptions/sub2/resourceGroups/rg2/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/cluster2"))
cluster1 := &api.HCPOpenShiftCluster{
CosmosMetadata: arm.CosmosMetadata{
ResourceID: cluster1ResourceID,
},
TrackedResource: arm.TrackedResource{Resource: arm.Resource{ID: cluster1ResourceID}},
ServiceProviderProperties: api.HCPOpenShiftClusterServiceProviderProperties{
ClusterServiceID: api.Ptr(api.Must(api.NewInternalID("/api/aro_hcp/v1alpha1/clusters/csid1"))),
},
}
cluster2 := &api.HCPOpenShiftCluster{
CosmosMetadata: arm.CosmosMetadata{
ResourceID: cluster2ResourceID,
},
TrackedResource: arm.TrackedResource{Resource: arm.Resource{ID: cluster2ResourceID}},
ServiceProviderProperties: api.HCPOpenShiftClusterServiceProviderProperties{
ClusterServiceID: api.Ptr(api.Must(api.NewInternalID("/api/aro_hcp/v1alpha1/clusters/csid2"))),
Expand Down Expand Up @@ -1106,6 +1121,9 @@ func TestDeleteOrphanedMaestroReadonlyBundles_mapServiceProviderNodePoolsByProvi
mockResourcesDBClient := databasetesting.NewMockResourcesDBClient()
mockCS := ocm.NewMockClusterServiceClientSpec(ctrl)
cluster := &api.HCPOpenShiftCluster{
CosmosMetadata: arm.CosmosMetadata{
ResourceID: clusterResourceID,
},
TrackedResource: arm.TrackedResource{Resource: arm.Resource{ID: clusterResourceID}},
ServiceProviderProperties: api.HCPOpenShiftClusterServiceProviderProperties{
ClusterServiceID: ptr.To(api.Must(api.NewInternalID("/api/aro_hcp/v1alpha1/clusters/csid"))),
Expand All @@ -1130,6 +1148,9 @@ func TestDeleteOrphanedMaestroReadonlyBundles_mapServiceProviderNodePoolsByProvi
mockResourcesDBClient := databasetesting.NewMockResourcesDBClient()
mockCS := ocm.NewMockClusterServiceClientSpec(ctrl)
cluster := &api.HCPOpenShiftCluster{
CosmosMetadata: arm.CosmosMetadata{
ResourceID: clusterResourceID,
},
TrackedResource: arm.TrackedResource{Resource: arm.Resource{ID: clusterResourceID}},
ServiceProviderProperties: api.HCPOpenShiftClusterServiceProviderProperties{
ClusterServiceID: ptr.To(api.Must(api.NewInternalID("/api/aro_hcp/v1alpha1/clusters/csid"))),
Expand Down Expand Up @@ -1167,6 +1188,9 @@ func TestDeleteOrphanedMaestroReadonlyBundles_mapServiceProviderNodePoolsByProvi
mockResourcesDBClient := databasetesting.NewMockResourcesDBClient()
mockCS := ocm.NewMockClusterServiceClientSpec(ctrl)
cluster := &api.HCPOpenShiftCluster{
CosmosMetadata: arm.CosmosMetadata{
ResourceID: clusterResourceID,
},
TrackedResource: arm.TrackedResource{Resource: arm.Resource{ID: clusterResourceID}},
ServiceProviderProperties: api.HCPOpenShiftClusterServiceProviderProperties{
ClusterServiceID: ptr.To(api.Must(api.NewInternalID("/api/aro_hcp/v1alpha1/clusters/csid"))),
Expand Down Expand Up @@ -1199,12 +1223,18 @@ func TestDeleteOrphanedMaestroReadonlyBundles_mapServiceProviderNodePoolsByProvi
cluster1ResourceID := api.Must(azcorearm.ParseResourceID("/subscriptions/sub1/resourceGroups/rg1/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/cluster1"))
cluster2ResourceID := api.Must(azcorearm.ParseResourceID("/subscriptions/sub2/resourceGroups/rg2/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/cluster2"))
cluster1 := &api.HCPOpenShiftCluster{
CosmosMetadata: arm.CosmosMetadata{
ResourceID: cluster1ResourceID,
},
TrackedResource: arm.TrackedResource{Resource: arm.Resource{ID: cluster1ResourceID}},
ServiceProviderProperties: api.HCPOpenShiftClusterServiceProviderProperties{
ClusterServiceID: ptr.To(api.Must(api.NewInternalID("/api/aro_hcp/v1alpha1/clusters/csid1"))),
},
}
cluster2 := &api.HCPOpenShiftCluster{
CosmosMetadata: arm.CosmosMetadata{
ResourceID: cluster2ResourceID,
},
TrackedResource: arm.TrackedResource{Resource: arm.Resource{ID: cluster2ResourceID}},
ServiceProviderProperties: api.HCPOpenShiftClusterServiceProviderProperties{
ClusterServiceID: ptr.To(api.Must(api.NewInternalID("/api/aro_hcp/v1alpha1/clusters/csid2"))),
Expand Down Expand Up @@ -1346,6 +1376,9 @@ func TestDeleteOrphanedMaestroReadonlyBundles_ensureClusterScopedOrphanedMaestro
setupMock: func(t *testing.T, m *maestro.MockClient, mockResourcesDBClient *databasetesting.MockResourcesDBClient, mockCS *ocm.MockClusterServiceClientSpec, shard *arohcpv1alpha1.ProvisionShard) map[string]*shardMaestroClient {
clusterRID := spcResourceID.Parent
cluster := &api.HCPOpenShiftCluster{
CosmosMetadata: arm.CosmosMetadata{
ResourceID: clusterRID,
},
TrackedResource: arm.TrackedResource{Resource: arm.Resource{ID: clusterRID}},
ServiceProviderProperties: api.HCPOpenShiftClusterServiceProviderProperties{
ClusterServiceID: ptr.To(api.Must(api.NewInternalID("/api/aro_hcp/v1alpha1/clusters/csid"))),
Expand Down Expand Up @@ -1386,6 +1419,9 @@ func TestDeleteOrphanedMaestroReadonlyBundles_ensureClusterScopedOrphanedMaestro
setupMock: func(t *testing.T, m *maestro.MockClient, mockResourcesDBClient *databasetesting.MockResourcesDBClient, mockCS *ocm.MockClusterServiceClientSpec, shard *arohcpv1alpha1.ProvisionShard) map[string]*shardMaestroClient {
clusterRID := spcResourceID.Parent
cluster := &api.HCPOpenShiftCluster{
CosmosMetadata: arm.CosmosMetadata{
ResourceID: clusterRID,
},
TrackedResource: arm.TrackedResource{Resource: arm.Resource{ID: clusterRID}},
ServiceProviderProperties: api.HCPOpenShiftClusterServiceProviderProperties{
ClusterServiceID: ptr.To(api.Must(api.NewInternalID("/api/aro_hcp/v1alpha1/clusters/csid"))),
Expand Down Expand Up @@ -1567,6 +1603,9 @@ func TestDeleteOrphanedMaestroReadonlyBundles_ensureOrphanedNodePoolScopedMaestr
setupMock: func(t *testing.T, m *maestro.MockClient, mockResourcesDBClient *databasetesting.MockResourcesDBClient, mockCS *ocm.MockClusterServiceClientSpec, shard *arohcpv1alpha1.ProvisionShard) map[string]*shardMaestroClient {
clusterRID := spnpResourceID.Parent.Parent
cluster := &api.HCPOpenShiftCluster{
CosmosMetadata: arm.CosmosMetadata{
ResourceID: clusterRID,
},
TrackedResource: arm.TrackedResource{Resource: arm.Resource{ID: clusterRID}},
ServiceProviderProperties: api.HCPOpenShiftClusterServiceProviderProperties{
ClusterServiceID: ptr.To(api.Must(api.NewInternalID("/api/aro_hcp/v1alpha1/clusters/csid"))),
Expand Down Expand Up @@ -1607,6 +1646,9 @@ func TestDeleteOrphanedMaestroReadonlyBundles_ensureOrphanedNodePoolScopedMaestr
setupMock: func(t *testing.T, m *maestro.MockClient, mockResourcesDBClient *databasetesting.MockResourcesDBClient, mockCS *ocm.MockClusterServiceClientSpec, shard *arohcpv1alpha1.ProvisionShard) map[string]*shardMaestroClient {
clusterRID := spnpResourceID.Parent.Parent
cluster := &api.HCPOpenShiftCluster{
CosmosMetadata: arm.CosmosMetadata{
ResourceID: clusterRID,
},
TrackedResource: arm.TrackedResource{Resource: arm.Resource{ID: clusterRID}},
ServiceProviderProperties: api.HCPOpenShiftClusterServiceProviderProperties{
ClusterServiceID: ptr.To(api.Must(api.NewInternalID("/api/aro_hcp/v1alpha1/clusters/csid"))),
Expand Down Expand Up @@ -1695,6 +1737,9 @@ func TestDeleteOrphanedMaestroReadonlyBundles_ensureClusterScopedOrphanedMaestro
spcOnShard1ResourceID := api.Must(azcorearm.ParseResourceID("/subscriptions/sub/resourceGroups/rg/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/cluster1/serviceProviderClusters/default"))
clusterRID := spcOnShard1ResourceID.Parent
cluster := &api.HCPOpenShiftCluster{
CosmosMetadata: arm.CosmosMetadata{
ResourceID: clusterRID,
},
TrackedResource: arm.TrackedResource{Resource: arm.Resource{ID: clusterRID}},
ServiceProviderProperties: api.HCPOpenShiftClusterServiceProviderProperties{
ClusterServiceID: ptr.To(api.Must(api.NewInternalID("/api/aro_hcp/v1alpha1/clusters/csid"))),
Expand Down Expand Up @@ -1777,6 +1822,9 @@ func TestDeleteOrphanedMaestroReadonlyBundles_ensureClusterScopedOrphanedMaestro
spcResourceID := api.Must(azcorearm.ParseResourceID("/subscriptions/sub/resourceGroups/rg/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/cluster-a/serviceProviderClusters/default"))
clusterRID := spcResourceID.Parent
cluster := &api.HCPOpenShiftCluster{
CosmosMetadata: arm.CosmosMetadata{
ResourceID: clusterRID,
},
TrackedResource: arm.TrackedResource{Resource: arm.Resource{ID: clusterRID}},
ServiceProviderProperties: api.HCPOpenShiftClusterServiceProviderProperties{
ClusterServiceID: ptr.To(api.Must(api.NewInternalID("/api/aro_hcp/v1alpha1/clusters/csid"))),
Expand Down Expand Up @@ -1834,6 +1882,9 @@ func TestDeleteOrphanedMaestroReadonlyBundles_ensureClusterScopedOrphanedMaestro
spcResourceID := api.Must(azcorearm.ParseResourceID("/subscriptions/sub/resourceGroups/rg/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/cluster/serviceProviderClusters/default"))
clusterRID := spcResourceID.Parent
cluster := &api.HCPOpenShiftCluster{
CosmosMetadata: arm.CosmosMetadata{
ResourceID: clusterRID,
},
TrackedResource: arm.TrackedResource{Resource: arm.Resource{ID: clusterRID}},
ServiceProviderProperties: api.HCPOpenShiftClusterServiceProviderProperties{
ClusterServiceID: ptr.To(api.Must(api.NewInternalID("/api/aro_hcp/v1alpha1/clusters/csid"))),
Expand Down Expand Up @@ -1891,6 +1942,9 @@ func TestDeleteOrphanedMaestroReadonlyBundles_SyncOnce_FullFlow_DeletesOrphanedB

clusterResourceID := api.Must(azcorearm.ParseResourceID("/subscriptions/sub/resourceGroups/rg/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/cluster"))
cluster := &api.HCPOpenShiftCluster{
CosmosMetadata: arm.CosmosMetadata{
ResourceID: clusterResourceID,
},
TrackedResource: arm.TrackedResource{Resource: arm.Resource{ID: clusterResourceID}},
ServiceProviderProperties: api.HCPOpenShiftClusterServiceProviderProperties{
ClusterServiceID: api.Ptr(api.Must(api.NewInternalID("/api/aro_hcp/v1alpha1/clusters/csid"))),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,9 @@ var _ database.ServiceProviderClusterCRUD = &errorInjectingSPCCRUD{}
func TestMaestroReadonlyBundleHelpers_calculateManagementClusterContentFromMaestroBundle(t *testing.T) {
clusterResourceID := api.Must(azcorearm.ParseResourceID("/subscriptions/sub/resourceGroups/rg/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/cluster"))
cluster := &api.HCPOpenShiftCluster{
CosmosMetadata: arm.CosmosMetadata{
ResourceID: clusterResourceID,
},
TrackedResource: arm.TrackedResource{Resource: arm.Resource{ID: clusterResourceID}},
}
ref := &api.MaestroBundleReference{
Expand Down Expand Up @@ -439,6 +442,9 @@ func TestMaestroReadonlyBundleHelpers_readAndPersistMaestroReadonlyBundleContent
ctx := context.Background()
clusterResourceID := api.Must(azcorearm.ParseResourceID("/subscriptions/sub/resourceGroups/rg/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/cluster"))
cluster := &api.HCPOpenShiftCluster{
CosmosMetadata: arm.CosmosMetadata{
ResourceID: clusterResourceID,
},
TrackedResource: arm.TrackedResource{Resource: arm.Resource{ID: clusterResourceID}},
}
ref := &api.MaestroBundleReference{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ func newTestCluster(t *testing.T, name string, state arm.ProvisioningState, crea
}

return &api.HCPOpenShiftCluster{
CosmosMetadata: arm.CosmosMetadata{
ResourceID: api.Must(azcorearm.ParseResourceID("/subscriptions/sub-1/resourceGroups/rg/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/" + name)),
},
TrackedResource: arm.TrackedResource{
Resource: arm.Resource{
ID: api.Must(azcorearm.ParseResourceID("/subscriptions/sub-1/resourceGroups/rg/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/" + name)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,9 @@ func newTestCluster(t *testing.T) *api.HCPOpenShiftCluster {
"/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/" + testClusterName))
clusterInternalID := api.Must(api.NewInternalID(testClusterServiceIDStr))
return &api.HCPOpenShiftCluster{
CosmosMetadata: arm.CosmosMetadata{
ResourceID: resourceID,
},
TrackedResource: arm.TrackedResource{
Resource: arm.Resource{
ID: resourceID,
Expand Down
Loading