diff --git a/backend/pkg/controllers/create_nodepool_scoped_maestro_readonly_bundles_controller_test.go b/backend/pkg/controllers/create_nodepool_scoped_maestro_readonly_bundles_controller_test.go index bee76b8cc26..3e50d7f5a04 100644 --- a/backend/pkg/controllers/create_nodepool_scoped_maestro_readonly_bundles_controller_test.go +++ b/backend/pkg/controllers/create_nodepool_scoped_maestro_readonly_bundles_controller_test.go @@ -146,6 +146,7 @@ func TestBuildInitialReadonlyMaestroBundleForNodePool(t *testing.T) { nodepoolResourceID := api.Must(azcorearm.ParseResourceID("/subscriptions/test-sub/resourceGroups/test-rg/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/test-cluster/nodePools/test-nodepool")) nodepool := &api.HCPOpenShiftClusterNodePool{ + CosmosMetadata: arm.CosmosMetadata{ResourceID: nodepoolResourceID}, TrackedResource: arm.TrackedResource{ Resource: arm.Resource{ ID: nodepoolResourceID, @@ -420,6 +421,7 @@ func TestCreateNodePoolScopedMaestroReadonlyBundlesSyncer_syncMaestroBundle(t *t } ctx := context.Background() nodepool := &api.HCPOpenShiftClusterNodePool{ + CosmosMetadata: arm.CosmosMetadata{ResourceID: nodepoolResourceID}, TrackedResource: arm.TrackedResource{ Resource: arm.Resource{ ID: nodepoolResourceID, @@ -514,6 +516,7 @@ func TestCreateNodePoolScopedMaestroReadonlyBundlesSyncer_SyncOnce_EmptyClusterS nodepoolResourceID := api.Must(azcorearm.ParseResourceID("/subscriptions/test-sub/resourceGroups/test-rg/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/test-cluster/nodePools/test-nodepool")) nodepool := &api.HCPOpenShiftClusterNodePool{ + CosmosMetadata: arm.CosmosMetadata{ResourceID: nodepoolResourceID}, TrackedResource: arm.TrackedResource{ Resource: arm.Resource{ ID: nodepoolResourceID, @@ -566,6 +569,7 @@ func TestCreateNodePoolScopedMaestroReadonlyBundlesSyncer_SyncOnce_GetServicePro nodepoolResourceID := api.Must(azcorearm.ParseResourceID("/subscriptions/test-sub/resourceGroups/test-rg/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/test-cluster/nodePools/test-nodepool")) nodepool := &api.HCPOpenShiftClusterNodePool{ + CosmosMetadata: arm.CosmosMetadata{ResourceID: nodepoolResourceID}, TrackedResource: arm.TrackedResource{ Resource: arm.Resource{ ID: nodepoolResourceID, @@ -620,6 +624,7 @@ func TestCreateNodePoolScopedMaestroReadonlyBundlesSyncer_SyncOnce_AllBundlesAlr nodepoolResourceID := api.Must(azcorearm.ParseResourceID("/subscriptions/test-sub/resourceGroups/test-rg/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/test-cluster/nodePools/test-nodepool")) nodepool := &api.HCPOpenShiftClusterNodePool{ + CosmosMetadata: arm.CosmosMetadata{ResourceID: nodepoolResourceID}, TrackedResource: arm.TrackedResource{ Resource: arm.Resource{ ID: nodepoolResourceID, @@ -684,6 +689,7 @@ func TestCreateNodePoolScopedMaestroReadonlyBundlesSyncer_SyncOnce_SyncLoopExecu nodepoolResourceID := api.Must(azcorearm.ParseResourceID("/subscriptions/test-sub/resourceGroups/test-rg/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/test-cluster/nodePools/test-nodepool")) nodepool := &api.HCPOpenShiftClusterNodePool{ + CosmosMetadata: arm.CosmosMetadata{ResourceID: nodepoolResourceID}, TrackedResource: arm.TrackedResource{ Resource: arm.Resource{ ID: nodepoolResourceID, @@ -784,6 +790,7 @@ func TestCreateNodePoolScopedMaestroReadonlyBundlesSyncer_SyncOnce_ProcessesPart nodepoolResourceID := api.Must(azcorearm.ParseResourceID("/subscriptions/test-sub/resourceGroups/test-rg/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/test-cluster/nodePools/test-nodepool")) nodepool := &api.HCPOpenShiftClusterNodePool{ + CosmosMetadata: arm.CosmosMetadata{ResourceID: nodepoolResourceID}, TrackedResource: arm.TrackedResource{ Resource: arm.Resource{ ID: nodepoolResourceID, diff --git a/backend/pkg/controllers/datadumpcontrollers/cs_state_dump_test.go b/backend/pkg/controllers/datadumpcontrollers/cs_state_dump_test.go index c62b8743e64..049104075bd 100644 --- a/backend/pkg/controllers/datadumpcontrollers/cs_state_dump_test.go +++ b/backend/pkg/controllers/datadumpcontrollers/cs_state_dump_test.go @@ -211,6 +211,7 @@ func newTestNodePool(name, clusterServiceIDStr string) *api.HCPOpenShiftClusterN nodePoolResourceID := api.Must(azcorearm.ParseResourceID( "/subscriptions/test-sub/resourceGroups/test-rg/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/test-cluster/nodePools/" + name)) np := &api.HCPOpenShiftClusterNodePool{ + CosmosMetadata: arm.CosmosMetadata{ResourceID: nodePoolResourceID}, TrackedResource: arm.TrackedResource{ Resource: arm.Resource{ ID: nodePoolResourceID, diff --git a/backend/pkg/controllers/metricscontrollers/resource_metrics_controller_test.go b/backend/pkg/controllers/metricscontrollers/resource_metrics_controller_test.go index 73c44690aff..349af2f0bc6 100644 --- a/backend/pkg/controllers/metricscontrollers/resource_metrics_controller_test.go +++ b/backend/pkg/controllers/metricscontrollers/resource_metrics_controller_test.go @@ -133,6 +133,7 @@ func TestNodePoolMetricsHandler_SetsMetrics(t *testing.T) { handler := NewNodePoolMetricsHandler(reg) nodePool := &api.HCPOpenShiftClusterNodePool{ + CosmosMetadata: arm.CosmosMetadata{ResourceID: api.Must(azcorearm.ParseResourceID("/subscriptions/sub-1/resourceGroups/rg/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/cluster-1/nodePools/np-1"))}, TrackedResource: arm.TrackedResource{ Resource: arm.Resource{ ID: api.Must(azcorearm.ParseResourceID("/subscriptions/sub-1/resourceGroups/rg/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/cluster-1/nodePools/np-1")), diff --git a/backend/pkg/controllers/nodepoolpropertiescontroller/node_pool_properties_sync_test.go b/backend/pkg/controllers/nodepoolpropertiescontroller/node_pool_properties_sync_test.go index e1549276f43..9ac175193ba 100644 --- a/backend/pkg/controllers/nodepoolpropertiescontroller/node_pool_properties_sync_test.go +++ b/backend/pkg/controllers/nodepoolpropertiescontroller/node_pool_properties_sync_test.go @@ -292,6 +292,7 @@ func newTestNodePool(t *testing.T, opts func(*api.HCPOpenShiftClusterNodePool)) "/nodePools/" + testNodePoolName)) nodePoolInternalID := api.Must(api.NewInternalID(testNodePoolCSIDStr)) np := &api.HCPOpenShiftClusterNodePool{ + CosmosMetadata: arm.CosmosMetadata{ResourceID: resourceID}, TrackedResource: arm.TrackedResource{ Resource: arm.Resource{ ID: resourceID, diff --git a/backend/pkg/controllers/operationcontrollers/test_helpers_test.go b/backend/pkg/controllers/operationcontrollers/test_helpers_test.go index f84eb625d49..23a8fdc038a 100644 --- a/backend/pkg/controllers/operationcontrollers/test_helpers_test.go +++ b/backend/pkg/controllers/operationcontrollers/test_helpers_test.go @@ -177,6 +177,7 @@ func (f *nodePoolTestFixture) newCluster() *api.HCPOpenShiftCluster { func (f *nodePoolTestFixture) newNodePool() *api.HCPOpenShiftClusterNodePool { return &api.HCPOpenShiftClusterNodePool{ + CosmosMetadata: arm.CosmosMetadata{ResourceID: f.nodePoolResourceID}, TrackedResource: arm.TrackedResource{ Resource: arm.Resource{ ID: f.nodePoolResourceID, diff --git a/backend/pkg/controllers/read_and_persist_nodepool_scoped_maestro_readonly_bundles_content_controller_test.go b/backend/pkg/controllers/read_and_persist_nodepool_scoped_maestro_readonly_bundles_content_controller_test.go index 7adefd8a8cf..dc9f5b67c7a 100644 --- a/backend/pkg/controllers/read_and_persist_nodepool_scoped_maestro_readonly_bundles_content_controller_test.go +++ b/backend/pkg/controllers/read_and_persist_nodepool_scoped_maestro_readonly_bundles_content_controller_test.go @@ -106,6 +106,7 @@ func TestReadAndPersistNodePoolScopedMaestroReadonlyBundlesContentSyncer_SyncOnc nodepoolResourceID := api.Must(azcorearm.ParseResourceID("/subscriptions/test-sub/resourceGroups/test-rg/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/test-cluster/nodePools/test-nodepool")) nodepool := &api.HCPOpenShiftClusterNodePool{ + CosmosMetadata: arm.CosmosMetadata{ResourceID: nodepoolResourceID}, TrackedResource: arm.TrackedResource{ Resource: arm.Resource{ ID: nodepoolResourceID, @@ -153,6 +154,7 @@ func TestReadAndPersistNodePoolScopedMaestroReadonlyBundlesContentSyncer_SyncOnc nodepoolResourceID := api.Must(azcorearm.ParseResourceID("/subscriptions/test-sub/resourceGroups/test-rg/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/test-cluster/nodePools/test-nodepool")) nodepool := &api.HCPOpenShiftClusterNodePool{ + CosmosMetadata: arm.CosmosMetadata{ResourceID: nodepoolResourceID}, TrackedResource: arm.TrackedResource{ Resource: arm.Resource{ ID: nodepoolResourceID, @@ -202,6 +204,7 @@ func TestReadAndPersistNodePoolScopedMaestroReadonlyBundlesContentSyncer_SyncOnc nodepoolResourceID := api.Must(azcorearm.ParseResourceID("/subscriptions/test-sub/resourceGroups/test-rg/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/test-cluster/nodePools/test-nodepool")) nodepool := &api.HCPOpenShiftClusterNodePool{ + CosmosMetadata: arm.CosmosMetadata{ResourceID: nodepoolResourceID}, TrackedResource: arm.TrackedResource{ Resource: arm.Resource{ ID: nodepoolResourceID, @@ -251,6 +254,7 @@ func TestReadAndPersistNodePoolScopedMaestroReadonlyBundlesContentSyncer_SyncOnc nodepoolResourceID := api.Must(azcorearm.ParseResourceID("/subscriptions/test-sub/resourceGroups/test-rg/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/test-cluster/nodePools/test-nodepool")) nodepool := &api.HCPOpenShiftClusterNodePool{ + CosmosMetadata: arm.CosmosMetadata{ResourceID: nodepoolResourceID}, TrackedResource: arm.TrackedResource{ Resource: arm.Resource{ ID: nodepoolResourceID, @@ -314,6 +318,7 @@ func TestReadAndPersistNodePoolScopedMaestroReadonlyBundlesContentSyncer_SyncOnc nodepoolResourceID := api.Must(azcorearm.ParseResourceID("/subscriptions/test-sub/resourceGroups/test-rg/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/test-cluster/nodePools/test-nodepool")) nodepool := &api.HCPOpenShiftClusterNodePool{ + CosmosMetadata: arm.CosmosMetadata{ResourceID: nodepoolResourceID}, TrackedResource: arm.TrackedResource{ Resource: arm.Resource{ ID: nodepoolResourceID, diff --git a/backend/pkg/controllers/upgradecontrollers/control_plane_desired_version_controller_test.go b/backend/pkg/controllers/upgradecontrollers/control_plane_desired_version_controller_test.go index 8ffa513eb2e..07ae8aa571b 100644 --- a/backend/pkg/controllers/upgradecontrollers/control_plane_desired_version_controller_test.go +++ b/backend/pkg/controllers/upgradecontrollers/control_plane_desired_version_controller_test.go @@ -531,6 +531,9 @@ func testCosmosClusterWithWorkersNodePoolAtVersion(nodePoolVersionId string) []a return []any{ cluster, &api.HCPOpenShiftClusterNodePool{ + CosmosMetadata: arm.CosmosMetadata{ + ResourceID: nodePoolResourceId, + }, TrackedResource: arm.NewTrackedResource(nodePoolResourceId, "eastus"), Properties: api.HCPOpenShiftClusterNodePoolProperties{ Version: api.NodePoolVersionProfile{ID: nodePoolVersionId}, diff --git a/backend/pkg/controllers/upgradecontrollers/nodepool_version_controller_test.go b/backend/pkg/controllers/upgradecontrollers/nodepool_version_controller_test.go index 7d10efb625e..1ece812c37d 100644 --- a/backend/pkg/controllers/upgradecontrollers/nodepool_version_controller_test.go +++ b/backend/pkg/controllers/upgradecontrollers/nodepool_version_controller_test.go @@ -125,6 +125,7 @@ func createTestNodePoolWithVersion(t *testing.T, ctx context.Context, mockResour require.NoError(t, err) nodePool := &api.HCPOpenShiftClusterNodePool{ + CosmosMetadata: arm.CosmosMetadata{ResourceID: nodePoolResourceID}, TrackedResource: arm.TrackedResource{ Resource: arm.Resource{ ID: nodePoolResourceID, diff --git a/backend/pkg/informers/informers_test.go b/backend/pkg/informers/informers_test.go index 66c8d8c02d2..42550d656a8 100644 --- a/backend/pkg/informers/informers_test.go +++ b/backend/pkg/informers/informers_test.go @@ -449,6 +449,7 @@ func nodePoolInformerTestCase() informerTestCase { internalID, err := api.NewInternalID("/api/clusters_mgmt/v1/clusters/" + clusterName) require.NoError(t, err) return &api.HCPOpenShiftClusterNodePool{ + CosmosMetadata: arm.CosmosMetadata{ResourceID: npResourceID}, TrackedResource: arm.TrackedResource{ Resource: arm.Resource{ ID: npResourceID, @@ -733,6 +734,7 @@ func controllerInformerTestCase() informerTestCase { "/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/"+clusterName+ "/nodePools/"+nodePoolName) np := &api.HCPOpenShiftClusterNodePool{ + CosmosMetadata: arm.CosmosMetadata{ResourceID: npResourceID}, TrackedResource: arm.TrackedResource{ Resource: arm.Resource{ ID: npResourceID, diff --git a/backend/pkg/listertesting/slice_listers_test.go b/backend/pkg/listertesting/slice_listers_test.go index eb4dd051bac..c8528c540e9 100644 --- a/backend/pkg/listertesting/slice_listers_test.go +++ b/backend/pkg/listertesting/slice_listers_test.go @@ -344,6 +344,7 @@ func newTestNodePool(subscriptionID, resourceGroupName, clusterName, nodePoolNam "/nodePools/" + nodePoolName, )) return &api.HCPOpenShiftClusterNodePool{ + CosmosMetadata: arm.CosmosMetadata{ResourceID: resourceID}, TrackedResource: arm.TrackedResource{ Resource: arm.Resource{ ID: resourceID, diff --git a/frontend/pkg/frontend/node_pool.go b/frontend/pkg/frontend/node_pool.go index 7bebbfa0464..f34676a9fcc 100644 --- a/frontend/pkg/frontend/node_pool.go +++ b/frontend/pkg/frontend/node_pool.go @@ -212,6 +212,7 @@ func decodeDesiredNodePoolCreate(ctx context.Context, azureLocation string) (*ap return nil, nameResourceIDMismatch(resourceID, newInternalNodePool.Name) } conversion.CopyReadOnlyTrackedResourceValues(&newInternalNodePool.TrackedResource, ptr.To(arm.NewTrackedResource(resourceID, azureLocation))) + newInternalNodePool.SetResourceID(resourceID) // set fields that were not included during the conversion, because the user does not provide them or because the // data is determined live on read. @@ -781,8 +782,11 @@ func (f *Frontend) getInternalNodePoolFromStorage(ctx context.Context, resourceI // normalize or return a toupper or tolower form of the resource // group or resource name. The resource group name and resource // name must come from the URL and not the request body. - if !strings.EqualFold(internalNodePool.ID.String(), resourceID.String()) { - return nil, fmt.Errorf("unexpected resourceID: %s", internalNodePool.ID.String()) + if internalNodePool.ResourceID == nil { + return nil, fmt.Errorf("stored nodepool document is missing cosmosMetadata.resourceID") + } + if !strings.EqualFold(internalNodePool.ResourceID.String(), resourceID.String()) { + return nil, fmt.Errorf("unexpected resourceID: %s", internalNodePool.ResourceID.String()) } internalNodePool.ID = resourceID diff --git a/internal/admission/admit_cluster_test.go b/internal/admission/admit_cluster_test.go index 5fed1675fed..468d02babbd 100644 --- a/internal/admission/admit_cluster_test.go +++ b/internal/admission/admit_cluster_test.go @@ -262,6 +262,9 @@ func TestAdmitClusterOnUpdate(t *testing.T) { nodePoolResourceID := api.Must(azcorearm.ParseResourceID( clusterResourceID.String() + "/nodePools/" + name)) return &api.HCPOpenShiftClusterNodePool{ + CosmosMetadata: arm.CosmosMetadata{ + ResourceID: nodePoolResourceID, + }, TrackedResource: arm.NewTrackedResource(nodePoolResourceID, "eastus"), Properties: api.HCPOpenShiftClusterNodePoolProperties{ Version: api.NodePoolVersionProfile{ID: versionID}, diff --git a/internal/api/types_nodepool.go b/internal/api/types_nodepool.go index f6c63103024..874120f6f0f 100644 --- a/internal/api/types_nodepool.go +++ b/internal/api/types_nodepool.go @@ -20,7 +20,6 @@ import ( "k8s.io/utils/ptr" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" azcorearm "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" "github.com/Azure/ARO-HCP/internal/api/arm" @@ -30,29 +29,16 @@ import ( // OpenShift clusters. // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type HCPOpenShiftClusterNodePool struct { + CosmosMetadata `json:"cosmosMetadata"` + arm.TrackedResource Properties HCPOpenShiftClusterNodePoolProperties `json:"properties,omitempty"` ServiceProviderProperties HCPOpenShiftClusterNodePoolServiceProviderProperties `json:"serviceProviderProperties,omitempty"` Identity *arm.ManagedServiceIdentity `json:"identity,omitempty"` - // CosmosETag is an in-memory copy of the _etag field read from the Cosmos DB document (BaseDocument) and - // populated on DB read via the CosmosToInternalNodePool() conversion function. - // We carry it across the API boundary between NodePool (the direct cosmos db type) and HCPOpenShiftClusterNodePool (this) - // so we can populate the CosmosETag in GetCosmosData() so that we can do conditional replaces in cosmos. - // This can be removed once we have inlined and serialized CosmosMetadata in - // HCPOpenShiftClusterNodePool. - CosmosETag azcore.ETag `json:"-"` } var _ arm.CosmosPersistable = &HCPOpenShiftClusterNodePool{} -func (o *HCPOpenShiftClusterNodePool) GetCosmosData() *arm.CosmosMetadata { - return &arm.CosmosMetadata{ - CosmosETag: o.CosmosETag, - ResourceID: o.ID, - ExistingCosmosUID: o.ServiceProviderProperties.ExistingCosmosUID, - } -} - // HCPOpenShiftClusterNodePoolProperties represents the property bag of a // HCPOpenShiftClusterNodePool resource. type HCPOpenShiftClusterNodePoolProperties struct { @@ -68,7 +54,6 @@ type HCPOpenShiftClusterNodePoolProperties struct { } type HCPOpenShiftClusterNodePoolServiceProviderProperties struct { - ExistingCosmosUID string `json:"-"` ClusterServiceID InternalID `json:"clusterServiceID,omitempty"` ActiveOperationID string `json:"activeOperationId,omitempty"` } diff --git a/internal/api/v20240610preview/conversion_fuzz_test.go b/internal/api/v20240610preview/conversion_fuzz_test.go index 4da56ad122d..c0c322d6b25 100644 --- a/internal/api/v20240610preview/conversion_fuzz_test.go +++ b/internal/api/v20240610preview/conversion_fuzz_test.go @@ -40,6 +40,14 @@ func TestRoundTripInternalExternalInternal(t *testing.T) { func(j *azcorearm.ResourceID, c randfill.Continue) { *j = *api.Must(azcorearm.ParseResourceID("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRg")) }, + func(j *api.CosmosMetadata, c randfill.Continue) { + c.FillNoCustom(j) + // ConvertToInternal lowercases the ID, so use the lowercased canonical form + // here so the round-trip comparison succeeds. + j.ResourceID = api.Must(azcorearm.ParseResourceID("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myrg")) + j.ExistingCosmosUID = "" + j.CosmosETag = "" + }, func(j *api.HCPOpenShiftClusterCustomerProperties, c randfill.Continue) { c.FillNoCustom(j) // ImageDigestMirrors is a v20251223preview field that does not exist in v20240610preview. @@ -73,7 +81,6 @@ func TestRoundTripInternalExternalInternal(t *testing.T) { j.ActiveOperationID = "" // ClusterServiceID does not roundtrip through the external type because it is purely an internal detail j.ClusterServiceID = ocm.InternalID{} - j.ExistingCosmosUID = "" }, func(j *api.OSDiskProfile, c randfill.Continue) { c.FillNoCustom(j) diff --git a/internal/api/v20240610preview/nodepools_methods.go b/internal/api/v20240610preview/nodepools_methods.go index b8f7fd4e8c8..5b0c43f1803 100644 --- a/internal/api/v20240610preview/nodepools_methods.go +++ b/internal/api/v20240610preview/nodepools_methods.go @@ -74,6 +74,7 @@ func (h *NodePool) ConvertToInternal(existing *api.HCPOpenShiftClusterNodePool) if h.ID != nil { out.ID = api.Must(azcorearm.ParseResourceID(strings.ToLower(*h.ID))) + out.ResourceID = api.Must(azcorearm.ParseResourceID(strings.ToLower(*h.ID))) } if h.Name != nil { out.Name = *h.Name @@ -309,8 +310,8 @@ func (v version) NewHCPOpenShiftClusterNodePool(from *api.HCPOpenShiftClusterNod } idString := "" - if from.ID != nil { - idString = from.ID.String() + if from.ResourceID != nil { + idString = from.ResourceID.String() } out := &NodePool{ diff --git a/internal/api/v20240610preview/nodepools_methods_test.go b/internal/api/v20240610preview/nodepools_methods_test.go index 5f3d53b06d0..6176528b931 100644 --- a/internal/api/v20240610preview/nodepools_methods_test.go +++ b/internal/api/v20240610preview/nodepools_methods_test.go @@ -40,6 +40,7 @@ func TestSizeGiBRoundTrip(t *testing.T) { { name: "SizeGiB with explicit value should round-trip", original: &api.HCPOpenShiftClusterNodePool{ + CosmosMetadata: arm.CosmosMetadata{ResourceID: api.Must(azcorearm.ParseResourceID(strings.ToLower("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRg/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/myCluster/nodePools/myNodePool")))}, TrackedResource: arm.TrackedResource{ Resource: arm.Resource{ ID: api.Must(azcorearm.ParseResourceID(strings.ToLower("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRg/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/myCluster/nodePools/myNodePool"))), diff --git a/internal/api/v20251223preview/conversion_fuzz_test.go b/internal/api/v20251223preview/conversion_fuzz_test.go index 3940882dedb..56eca130afe 100644 --- a/internal/api/v20251223preview/conversion_fuzz_test.go +++ b/internal/api/v20251223preview/conversion_fuzz_test.go @@ -40,6 +40,14 @@ func TestRoundTripInternalExternalInternal(t *testing.T) { func(j *azcorearm.ResourceID, c randfill.Continue) { *j = *api.Must(azcorearm.ParseResourceID("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRg")) }, + func(j *api.CosmosMetadata, c randfill.Continue) { + c.FillNoCustom(j) + // ConvertToInternal lowercases the ID, so use the lowercased canonical form + // here so the round-trip comparison succeeds. + j.ResourceID = api.Must(azcorearm.ParseResourceID("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myrg")) + j.ExistingCosmosUID = "" + j.CosmosETag = "" + }, func(j *api.ImageDigestMirror, c randfill.Continue) { c.FillNoCustom(j) // MirrorSourcePolicy does not roundtrip through the external type because it is purely an internal detail @@ -71,7 +79,6 @@ func TestRoundTripInternalExternalInternal(t *testing.T) { j.ActiveOperationID = "" // ClusterServiceID does not roundtrip through the external type because it is purely an internal detail j.ClusterServiceID = ocm.InternalID{} - j.ExistingCosmosUID = "" }, func(j *api.HCPOpenShiftClusterExternalAuthServiceProviderProperties, c randfill.Continue) { c.FillNoCustom(j) diff --git a/internal/api/v20251223preview/nodepools_methods.go b/internal/api/v20251223preview/nodepools_methods.go index ffeb6536290..0cdfba01116 100644 --- a/internal/api/v20251223preview/nodepools_methods.go +++ b/internal/api/v20251223preview/nodepools_methods.go @@ -87,6 +87,7 @@ func (h *NodePool) ConvertToInternal(existing *api.HCPOpenShiftClusterNodePool) if h.ID != nil { out.ID = api.Must(azcorearm.ParseResourceID(strings.ToLower(*h.ID))) + out.ResourceID = api.Must(azcorearm.ParseResourceID(strings.ToLower(*h.ID))) } if h.Name != nil { out.Name = *h.Name @@ -301,8 +302,8 @@ func (v version) NewHCPOpenShiftClusterNodePool(from *api.HCPOpenShiftClusterNod } idString := "" - if from.ID != nil { - idString = from.ID.String() + if from.ResourceID != nil { + idString = from.ResourceID.String() } out := &NodePool{ diff --git a/internal/api/v20251223preview/nodepools_methods_test.go b/internal/api/v20251223preview/nodepools_methods_test.go index 9777529565e..5d5580f151c 100644 --- a/internal/api/v20251223preview/nodepools_methods_test.go +++ b/internal/api/v20251223preview/nodepools_methods_test.go @@ -40,6 +40,7 @@ func TestSizeGiBRoundTrip(t *testing.T) { { name: "SizeGiB with explicit value should round-trip", original: &api.HCPOpenShiftClusterNodePool{ + CosmosMetadata: arm.CosmosMetadata{ResourceID: api.Must(azcorearm.ParseResourceID(strings.ToLower("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRg/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/myCluster/nodePools/myNodePool")))}, TrackedResource: arm.TrackedResource{ Resource: arm.Resource{ ID: api.Must(azcorearm.ParseResourceID(strings.ToLower("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRg/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/myCluster/nodePools/myNodePool"))), diff --git a/internal/api/v20251223preview/zero_value_roundtrip_test.go b/internal/api/v20251223preview/zero_value_roundtrip_test.go index 305f44de779..44d79a737fb 100644 --- a/internal/api/v20251223preview/zero_value_roundtrip_test.go +++ b/internal/api/v20251223preview/zero_value_roundtrip_test.go @@ -261,6 +261,7 @@ func jsonRoundTripCluster(t *testing.T, original *api.HCPOpenShiftCluster) *api. // to zero before round-tripping. func newBaselineInternalNodePool() *api.HCPOpenShiftClusterNodePool { return &api.HCPOpenShiftClusterNodePool{ + CosmosMetadata: arm.CosmosMetadata{ResourceID: api.Must(azcorearm.ParseResourceID(strings.ToLower("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRg/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/myCluster/nodePools/myNodePool")))}, TrackedResource: arm.TrackedResource{ Resource: arm.Resource{ ID: api.Must(azcorearm.ParseResourceID(strings.ToLower("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRg/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/myCluster/nodePools/myNodePool"))), diff --git a/internal/api/zz_generated.deepcopy.go b/internal/api/zz_generated.deepcopy.go index 24c64d0e841..b6cb2a03265 100644 --- a/internal/api/zz_generated.deepcopy.go +++ b/internal/api/zz_generated.deepcopy.go @@ -646,6 +646,7 @@ func (in *HCPOpenShiftClusterList) DeepCopyObject() runtime.Object { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *HCPOpenShiftClusterNodePool) DeepCopyInto(out *HCPOpenShiftClusterNodePool) { *out = *in + in.CosmosMetadata.DeepCopyInto(&out.CosmosMetadata) in.TrackedResource.DeepCopyInto(&out.TrackedResource) in.Properties.DeepCopyInto(&out.Properties) out.ServiceProviderProperties = in.ServiceProviderProperties diff --git a/internal/conversion/readonly_nodepool.go b/internal/conversion/readonly_nodepool.go index 6636409f1eb..4887beaae68 100644 --- a/internal/conversion/readonly_nodepool.go +++ b/internal/conversion/readonly_nodepool.go @@ -22,6 +22,10 @@ import ( func CopyReadOnlyNodePoolValues(dest, src *api.HCPOpenShiftClusterNodePool) { CopyReadOnlyTrackedResourceValues(&dest.TrackedResource, &src.TrackedResource) + // CosmosMetadata is read-only on the API surface; carry over so the + // case-preserving ResourceID and CosmosETag survive the replace round-trip. + dest.CosmosMetadata = *src.CosmosMetadata.DeepCopy() + switch { case hasClusterIdentityToSet(src.Identity) && dest.Identity == nil: dest.Identity = &arm.ManagedServiceIdentity{} @@ -34,5 +38,4 @@ func CopyReadOnlyNodePoolValues(dest, src *api.HCPOpenShiftClusterNodePool) { dest.Properties.ProvisioningState = src.Properties.ProvisioningState dest.ServiceProviderProperties = *src.ServiceProviderProperties.DeepCopy() - dest.CosmosETag = src.CosmosETag } diff --git a/internal/database/convert_any.go b/internal/database/convert_any.go index 4feeb355ad1..436797fb10d 100644 --- a/internal/database/convert_any.go +++ b/internal/database/convert_any.go @@ -34,9 +34,6 @@ func CosmosToInternal[InternalAPIType, CosmosAPIType any](obj *CosmosAPIType) (* case *HCPCluster: internalObj, err = CosmosToInternalCluster(cosmosObj) - case *NodePool: - internalObj, err = CosmosToInternalNodePool(cosmosObj) - case *TypedDocument: var expectedObj InternalAPIType switch castObj := any(expectedObj).(type) { @@ -90,9 +87,6 @@ func InternalToCosmos[InternalAPIType, CosmosAPIType any](obj *InternalAPIType) case *api.HCPOpenShiftCluster: cosmosObj, err = InternalToCosmosCluster(internalObj) - case *api.HCPOpenShiftClusterNodePool: - cosmosObj, err = InternalToCosmosNodePool(internalObj) - case *TypedDocument: var expectedObj CosmosAPIType switch castObj := any(expectedObj).(type) { diff --git a/internal/database/convert_cluster_test.go b/internal/database/convert_cluster_test.go index 2c886285514..82205ef2594 100644 --- a/internal/database/convert_cluster_test.go +++ b/internal/database/convert_cluster_test.go @@ -138,7 +138,7 @@ func roundTripInternalToCosmosToInternal[InternalAPIType, CosmosAPIType any](t * case *api.HCPOpenShiftCluster: cast.ServiceProviderProperties.ExistingCosmosUID = "" case *api.HCPOpenShiftClusterNodePool: - cast.ServiceProviderProperties.ExistingCosmosUID = "" + cast.ExistingCosmosUID = "" case *api.HCPOpenShiftClusterExternalAuth: cast.ServiceProviderProperties.ExistingCosmosUID = "" } diff --git a/internal/database/convert_defaults_consistency_test.go b/internal/database/convert_defaults_consistency_test.go index 0090a7ebb6b..bffd505f776 100644 --- a/internal/database/convert_defaults_consistency_test.go +++ b/internal/database/convert_defaults_consistency_test.go @@ -412,7 +412,7 @@ func TestKMSVisibilityDefaultsToPublic(t *testing.T) { } } -// TestPreExistingDataNodePool verifies that CosmosToInternalNodePool applies +// TestPreExistingDataNodePool verifies that CosmosGenericToInternal applies // canonical defaults when reading a Cosmos document that predates the // introduction of DiskStorageAccountType. func TestPreExistingDataNodePool(t *testing.T) { @@ -421,35 +421,33 @@ func TestPreExistingDataNodePool(t *testing.T) { )) // Simulate a pre-existing Cosmos document missing DiskStorageAccountType. - preExistingDoc := &NodePool{ + preExistingDoc := &GenericDocument[api.HCPOpenShiftClusterNodePool]{ TypedDocument: TypedDocument{ BaseDocument: BaseDocument{ID: "test-doc-id"}, ResourceID: resourceID, }, - NodePoolProperties: NodePoolProperties{ - IntermediateResourceDoc: &ResourceDocument{ - ResourceID: resourceID, - InternalID: api.Must(api.NewInternalID("/api/aro_hcp/v1alpha1/clusters/test-cluster/node_pools/test-np")), - ProvisioningState: arm.ProvisioningStateSucceeded, + Content: api.HCPOpenShiftClusterNodePool{ + // DiskStorageAccountType is intentionally zero-valued + CosmosMetadata: arm.CosmosMetadata{ + ResourceID: resourceID, }, - InternalState: NodePoolInternalState{ - InternalAPI: api.HCPOpenShiftClusterNodePool{ - // DiskStorageAccountType is intentionally zero-valued - Properties: api.HCPOpenShiftClusterNodePoolProperties{ - Platform: api.NodePoolPlatformProfile{ - OSDisk: api.OSDiskProfile{ - // DiskStorageAccountType: "" — simulates pre-existing document - }, - }, + Properties: api.HCPOpenShiftClusterNodePoolProperties{ + ProvisioningState: arm.ProvisioningStateSucceeded, + Platform: api.NodePoolPlatformProfile{ + OSDisk: api.OSDiskProfile{ + // DiskStorageAccountType: "" — simulates pre-existing document }, }, }, + ServiceProviderProperties: api.HCPOpenShiftClusterNodePoolServiceProviderProperties{ + ClusterServiceID: api.Must(api.NewInternalID("/api/aro_hcp/v1alpha1/clusters/test-cluster/node_pools/test-np")), + }, }, } - internalNodePool, err := CosmosToInternalNodePool(preExistingDoc) + internalNodePool, err := CosmosGenericToInternal(preExistingDoc) if err != nil { - t.Fatalf("CosmosToInternalNodePool failed: %v", err) + t.Fatalf("CosmosGenericToInternal failed: %v", err) } if internalNodePool.Properties.Platform.OSDisk.DiskStorageAccountType != api.DiskStorageAccountTypePremium_LRS { diff --git a/internal/database/convert_generic.go b/internal/database/convert_generic.go index d3b061ef063..3e01799ff28 100644 --- a/internal/database/convert_generic.go +++ b/internal/database/convert_generic.go @@ -69,6 +69,10 @@ func CosmosGenericToInternal[InternalAPIType any](cosmosObj *GenericDocument[Int cosmosData.ExistingCosmosUID = cosmosObj.ID ret.SetEtag(cosmosObj.CosmosETag) + if defaulter, ok := ret.(Defaulter); ok { + defaulter.EnsureDefaults() + } + // this isn't pretty, but on balance it's a better choice so that we can share all the rest. switch castObj := any(ret).(type) { case *arm.Subscription: @@ -93,3 +97,7 @@ func CosmosGenericToInternal[InternalAPIType any](cosmosObj *GenericDocument[Int return &cosmosObj.Content, nil } + +type Defaulter interface { + EnsureDefaults() +} diff --git a/internal/database/convert_nodepool.go b/internal/database/convert_nodepool.go deleted file mode 100644 index 90ad6a579a1..00000000000 --- a/internal/database/convert_nodepool.go +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright 2025 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package database - -import ( - "fmt" - "strings" - - "github.com/Azure/ARO-HCP/internal/api" - "github.com/Azure/ARO-HCP/internal/api/arm" - "github.com/Azure/ARO-HCP/internal/ocm" -) - -func InternalToCosmosNodePool(internalObj *api.HCPOpenShiftClusterNodePool) (*NodePool, error) { - if internalObj == nil { - return nil, nil - } - - cosmosObj := &NodePool{ - TypedDocument: TypedDocument{ - BaseDocument: BaseDocument{ - ID: internalObj.GetCosmosData().GetCosmosUID(), - }, - PartitionKey: strings.ToLower(internalObj.ID.SubscriptionID), - ResourceID: internalObj.ID, - ResourceType: internalObj.ID.ResourceType.String(), - }, - NodePoolProperties: NodePoolProperties{ - CosmosMetadata: api.CosmosMetadata{ - ResourceID: internalObj.ID, - }, - IntermediateResourceDoc: &ResourceDocument{ - ResourceID: internalObj.ID, - InternalID: internalObj.ServiceProviderProperties.ClusterServiceID, - ActiveOperationID: internalObj.ServiceProviderProperties.ActiveOperationID, - ProvisioningState: internalObj.Properties.ProvisioningState, - Identity: internalObj.Identity.DeepCopy(), - SystemData: internalObj.SystemData, - Tags: copyTags(internalObj.Tags), - }, - InternalState: NodePoolInternalState{ - InternalAPI: *internalObj, - }, - }, - } - - // some pieces of data in the internalNodePool conflict with ResourceDocument fields. We may evolve over time, but for - // now avoid persisting those. - cosmosObj.InternalState.InternalAPI.TrackedResource = arm.TrackedResource{ - Location: internalObj.Location, // this is the only TrackedResource value not present elsewhere in ResourceDcoument - } - cosmosObj.InternalState.InternalAPI.Identity = nil - cosmosObj.InternalState.InternalAPI.Properties.ProvisioningState = "" - cosmosObj.InternalState.InternalAPI.SystemData = nil - cosmosObj.InternalState.InternalAPI.Tags = nil - cosmosObj.InternalState.InternalAPI.ServiceProviderProperties.ClusterServiceID = ocm.InternalID{} - cosmosObj.InternalState.InternalAPI.ServiceProviderProperties.ActiveOperationID = "" - - return cosmosObj, nil -} - -func CosmosToInternalNodePool(cosmosObj *NodePool) (*api.HCPOpenShiftClusterNodePool, error) { - if cosmosObj == nil { - return nil, nil - } - resourceDoc := cosmosObj.IntermediateResourceDoc - if resourceDoc == nil { - return nil, fmt.Errorf("resource document cannot be nil") - } - - tempInternalAPI := cosmosObj.InternalState.InternalAPI - internalObj := &tempInternalAPI - - // some pieces of data are stored on the ResourceDocument, so we need to restore that data - internalObj.TrackedResource = arm.TrackedResource{ - Resource: arm.Resource{ - ID: resourceDoc.ResourceID, - Name: resourceDoc.ResourceID.Name, - Type: resourceDoc.ResourceID.ResourceType.String(), - SystemData: resourceDoc.SystemData, - }, - Location: cosmosObj.InternalState.InternalAPI.Location, - Tags: resourceDoc.Tags, - } - // we carry over the CosmosETag from the cosmos object to the internal object into a - // temporary field until we have inlined and serialized CosmosMetadata in - // HCPOpenShiftClusterNodePool. - internalObj.CosmosETag = cosmosObj.CosmosETag - internalObj.Identity = resourceDoc.Identity.DeepCopy() - internalObj.Properties.ProvisioningState = resourceDoc.ProvisioningState - internalObj.SystemData = resourceDoc.SystemData - internalObj.Tags = copyTags(resourceDoc.Tags) - internalObj.ServiceProviderProperties.ExistingCosmosUID = cosmosObj.ID - internalObj.ServiceProviderProperties.ClusterServiceID = resourceDoc.InternalID - internalObj.ServiceProviderProperties.ActiveOperationID = resourceDoc.ActiveOperationID - - internalObj.EnsureDefaults() - - return internalObj, nil -} diff --git a/internal/database/convert_nodepool_test.go b/internal/database/convert_nodepool_test.go index aaf3137f8e9..a1859492deb 100644 --- a/internal/database/convert_nodepool_test.go +++ b/internal/database/convert_nodepool_test.go @@ -15,92 +15,11 @@ package database import ( - "math/rand" "testing" - "github.com/stretchr/testify/require" - - "sigs.k8s.io/randfill" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - azcorearm "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/ARO-HCP/internal/api" - "github.com/Azure/ARO-HCP/internal/api/arm" ) -func TestRoundTripNodePoolInternalCosmosInternal(t *testing.T) { - seed := rand.Int63() - t.Logf("seed: %d", seed) - - fuzzer := fuzzerFor([]interface{}{ - func(j *azcorearm.ResourceID, c randfill.Continue) { - *j = *api.Must(azcorearm.ParseResourceID("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRg")) - }, - func(j *arm.Resource, c randfill.Continue) { - c.FillNoCustom(j) - j.ID = api.Must(azcorearm.ParseResourceID("/subscriptions/0465bc32-c654-41b8-8d87-9815d7abe8f6/resourceGroups/some-resource-group/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/change-channel")) - j.Name = "change-channel" - j.Type = "Microsoft.RedHatOpenShift/hcpOpenShiftClusters" - }, - func(j *api.HCPOpenShiftClusterNodePool, c randfill.Continue) { - c.FillNoCustom(j) - if j == nil { - return - } - j.ServiceProviderProperties.ExistingCosmosUID = "" - j.CosmosETag = "" - // Canonical defaults are applied on Cosmos read, so ensure - // defaulted fields are never zero during round-trip testing. - if len(j.Properties.Platform.OSDisk.DiskStorageAccountType) == 0 { - j.Properties.Platform.OSDisk.DiskStorageAccountType = api.DiskStorageAccountTypePremium_LRS - } - if len(j.Properties.Platform.OSDisk.DiskType) == 0 { - j.Properties.Platform.OSDisk.DiskType = api.OsDiskTypeManaged - } - }, - func(j *arm.ManagedServiceIdentity, c randfill.Continue) { - c.FillNoCustom(j) - - // we only round trip keys, so only fill in keys - if j != nil && j.UserAssignedIdentities != nil { - for k := range j.UserAssignedIdentities { - j.UserAssignedIdentities[k] = nil - } - } - }, - }, rand.NewSource(seed)) - - // Try a few times, since runTest uses random values. - for i := 0; i < 20; i++ { - original := &api.HCPOpenShiftClusterNodePool{} - fuzzer.Fill(original) - roundTripInternalToCosmosToInternal[api.HCPOpenShiftClusterNodePool, NodePool](t, original) - } -} - -func TestCosmosToInternalNodePoolPreservesETag(t *testing.T) { - expectedETag := azcore.ETag("test-etag-value-12345") - resourceID := api.Must(azcorearm.ParseResourceID("/subscriptions/0465bc32-c654-41b8-8d87-9815d7abe8f6/resourceGroups/rg/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/my-cluster/nodePools/my-np")) - - cosmosObj := &NodePool{ - TypedDocument: TypedDocument{ - BaseDocument: BaseDocument{ - CosmosETag: expectedETag, - }, - }, - NodePoolProperties: NodePoolProperties{ - IntermediateResourceDoc: &ResourceDocument{ - ResourceID: resourceID, - }, - }, - } - - internalObj, err := CosmosToInternalNodePool(cosmosObj) - require.NoError(t, err) - require.Equal(t, expectedETag, internalObj.GetCosmosData().CosmosETag) -} - func TestNodePoolEnsureDefaults(t *testing.T) { tests := []struct { name string diff --git a/internal/database/crud_hcpcluster.go b/internal/database/crud_hcpcluster.go index cb6198916aa..9dd2617d721 100644 --- a/internal/database/crud_hcpcluster.go +++ b/internal/database/crud_hcpcluster.go @@ -176,7 +176,7 @@ func (h *hcpClusterCRUD) NodePools(hcpClusterName string) NodePoolsCRUD { hcpClusterName))) return &nodePoolsCRUD{ - nestedCosmosResourceCRUD: NewCosmosResourceCRUD[api.HCPOpenShiftClusterNodePool, NodePool]( + nestedCosmosResourceCRUD: NewCosmosResourceCRUD[api.HCPOpenShiftClusterNodePool, GenericDocument[api.HCPOpenShiftClusterNodePool]]( h.containerClient, parentResourceID, api.NodePoolResourceType), @@ -227,7 +227,7 @@ func (h *externalAuthCRUD) Controllers(externalAuthName string) ResourceCRUD[api } type nodePoolsCRUD struct { - *nestedCosmosResourceCRUD[api.HCPOpenShiftClusterNodePool, NodePool] + *nestedCosmosResourceCRUD[api.HCPOpenShiftClusterNodePool, GenericDocument[api.HCPOpenShiftClusterNodePool]] } func (h *nodePoolsCRUD) Controllers(nodePoolName string) ResourceCRUD[api.Controller] { diff --git a/internal/database/crud_nested_resource.go b/internal/database/crud_nested_resource.go index c736078002f..6fa861b60db 100644 --- a/internal/database/crud_nested_resource.go +++ b/internal/database/crud_nested_resource.go @@ -48,7 +48,7 @@ type nestedCosmosResourceCRUD[InternalAPIType, CosmosAPIType any] struct { resourceType azcorearm.ResourceType } -var _ ResourceCRUD[api.HCPOpenShiftClusterNodePool] = &nestedCosmosResourceCRUD[api.HCPOpenShiftClusterNodePool, NodePool]{} +var _ ResourceCRUD[api.HCPOpenShiftClusterNodePool] = &nestedCosmosResourceCRUD[api.HCPOpenShiftClusterNodePool, GenericDocument[api.HCPOpenShiftClusterNodePool]]{} func NewCosmosResourceCRUD[InternalAPIType, CosmosAPIType any]( containerClient *azcosmos.ContainerClient, parentResourceID *azcorearm.ResourceID, resourceType azcorearm.ResourceType) *nestedCosmosResourceCRUD[InternalAPIType, CosmosAPIType] { diff --git a/internal/database/global_lister.go b/internal/database/global_lister.go index f2394c021b0..0f2c83663f7 100644 --- a/internal/database/global_lister.go +++ b/internal/database/global_lister.go @@ -79,7 +79,7 @@ func (g *cosmosResourcesGlobalListers) Clusters() GlobalLister[api.HCPOpenShiftC } func (g *cosmosResourcesGlobalListers) NodePools() GlobalLister[api.HCPOpenShiftClusterNodePool] { - return &cosmosGlobalLister[api.HCPOpenShiftClusterNodePool, NodePool]{ + return &cosmosGlobalLister[api.HCPOpenShiftClusterNodePool, GenericDocument[api.HCPOpenShiftClusterNodePool]]{ containerClient: g.resources, resourceType: api.NodePoolResourceType, } diff --git a/internal/database/transaction.go b/internal/database/transaction.go index dbbd713e00d..8bbd30cad27 100644 --- a/internal/database/transaction.go +++ b/internal/database/transaction.go @@ -208,7 +208,7 @@ func (r *cosmosDBTransactionResult) GetItem(cosmosUID string) (any, error) { case strings.ToLower(api.ClusterResourceType.String()): return getCastResult[api.HCPOpenShiftCluster, HCPCluster](r, cosmosUID) case strings.ToLower(api.NodePoolResourceType.String()): - return getCastResult[api.HCPOpenShiftClusterNodePool, NodePool](r, cosmosUID) + return getCastResult[api.HCPOpenShiftClusterNodePool, GenericDocument[api.HCPOpenShiftClusterNodePool]](r, cosmosUID) case strings.ToLower(api.ExternalAuthResourceType.String()): return getCastResult[api.HCPOpenShiftClusterExternalAuth, ExternalAuth](r, cosmosUID) default: diff --git a/internal/database/types_nodepool.go b/internal/database/types_nodepool.go deleted file mode 100644 index 5f85a58cee2..00000000000 --- a/internal/database/types_nodepool.go +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2025 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package database - -import ( - "github.com/Azure/ARO-HCP/internal/api" -) - -type NodePool struct { - TypedDocument `json:",inline"` - - NodePoolProperties `json:"properties"` -} - -type NodePoolProperties struct { - // when we switch to inlining the internalObj, this will be in the right spot. We add it now so that we can switch our - // queries to select on cosmosMetata.ResourceID instead of resourceId - CosmosMetadata api.CosmosMetadata `json:"cosmosMetadata"` - - // IntermediateResourceDoc exists so that we can stop inlining the resource document so that we can directly - // embed the InternalAPIType which has colliding serialization fields. - IntermediateResourceDoc *ResourceDocument `json:"intermediateResourceDoc"` - - // TODO we may need look-aside data that we want to store in the same place. Build the nesting to allow it - InternalState NodePoolInternalState `json:"internalState"` -} - -type NodePoolInternalState struct { - InternalAPI api.HCPOpenShiftClusterNodePool `json:"internalAPI"` -} - -func (o *NodePool) GetTypedDocument() *TypedDocument { - return &o.TypedDocument -} diff --git a/internal/databasetesting/mock_dbclient_test.go b/internal/databasetesting/mock_dbclient_test.go index 8ab938a974b..b9513c617bf 100644 --- a/internal/databasetesting/mock_dbclient_test.go +++ b/internal/databasetesting/mock_dbclient_test.go @@ -900,6 +900,7 @@ func TestNewMockResourcesDBClientWithResources(t *testing.T) { "/nodePools/" + nodePoolName)) nodePool := &api.HCPOpenShiftClusterNodePool{ + CosmosMetadata: arm.CosmosMetadata{ResourceID: nodePoolResourceID}, TrackedResource: arm.TrackedResource{ Resource: arm.Resource{ ID: nodePoolResourceID, diff --git a/internal/databasetesting/mock_resources_crud.go b/internal/databasetesting/mock_resources_crud.go index edf10781b34..d2c51bb7fca 100644 --- a/internal/databasetesting/mock_resources_crud.go +++ b/internal/databasetesting/mock_resources_crud.go @@ -472,7 +472,7 @@ func (m *mockHCPClusterCRUD) NodePools(hcpClusterName string) database.NodePools hcpClusterName))) return &mockNodePoolsCRUD{ - mockResourceCRUD: newMockResourceCRUD[api.HCPOpenShiftClusterNodePool, database.NodePool]( + mockResourceCRUD: newMockResourceCRUD[api.HCPOpenShiftClusterNodePool, database.GenericDocument[api.HCPOpenShiftClusterNodePool]]( m.client, parentResourceID, api.NodePoolResourceType), @@ -507,7 +507,7 @@ var _ database.HCPClusterCRUD = &mockHCPClusterCRUD{} // mockNodePoolsCRUD implements database.NodePoolsCRUD. type mockNodePoolsCRUD struct { - *mockResourceCRUD[api.HCPOpenShiftClusterNodePool, database.NodePool] + *mockResourceCRUD[api.HCPOpenShiftClusterNodePool, database.GenericDocument[api.HCPOpenShiftClusterNodePool]] } func (m *mockNodePoolsCRUD) Controllers(nodePoolName string) database.ResourceCRUD[api.Controller] { diff --git a/internal/databasetesting/mock_resources_db_client.go b/internal/databasetesting/mock_resources_db_client.go index 9f1e21c324d..a6e3f6ac314 100644 --- a/internal/databasetesting/mock_resources_db_client.go +++ b/internal/databasetesting/mock_resources_db_client.go @@ -365,11 +365,11 @@ func (r *mockTransactionResult) GetItem(cosmosUID string) (any, error) { } return database.CosmosToInternalCluster(&cosmosObj) case strings.ToLower(api.NodePoolResourceType.String()): - var cosmosObj database.NodePool + var cosmosObj database.GenericDocument[api.HCPOpenShiftClusterNodePool] if err := json.Unmarshal(data, &cosmosObj); err != nil { return nil, err } - return database.CosmosToInternalNodePool(&cosmosObj) + return database.CosmosGenericToInternal(&cosmosObj) case strings.ToLower(api.ExternalAuthResourceType.String()): var cosmosObj database.ExternalAuth if err := json.Unmarshal(data, &cosmosObj); err != nil { diff --git a/internal/databasetesting/mock_resources_global_lister.go b/internal/databasetesting/mock_resources_global_lister.go index 22ed8b7e98e..aeff77fdf8a 100644 --- a/internal/databasetesting/mock_resources_global_lister.go +++ b/internal/databasetesting/mock_resources_global_lister.go @@ -45,7 +45,7 @@ func (g *mockResourcesGlobalListers) Clusters() database.GlobalLister[api.HCPOpe } func (g *mockResourcesGlobalListers) NodePools() database.GlobalLister[api.HCPOpenShiftClusterNodePool] { - return &mockTypedGlobalLister[api.HCPOpenShiftClusterNodePool, database.NodePool]{ + return &mockTypedGlobalLister[api.HCPOpenShiftClusterNodePool, database.GenericDocument[api.HCPOpenShiftClusterNodePool]]{ client: g.client, resourceType: api.NodePoolResourceType, } diff --git a/internal/ocm/convert.go b/internal/ocm/convert.go index 98b7910782a..7dbe2396f2f 100644 --- a/internal/ocm/convert.go +++ b/internal/ocm/convert.go @@ -572,6 +572,7 @@ func ConvertCStoNodePool(resourceID *azcorearm.ResourceID, azureLocation string, } nodePool := &api.HCPOpenShiftClusterNodePool{ + CosmosMetadata: arm.CosmosMetadata{ResourceID: resourceID}, TrackedResource: arm.TrackedResource{ Resource: arm.Resource{ ID: resourceID, diff --git a/test-integration/backend/controllers/mismatches/artifacts/cluster/remove_orphaned_cluster_descendents/00-load-initial-state/nodepool-basic.json b/test-integration/backend/controllers/mismatches/artifacts/cluster/remove_orphaned_cluster_descendents/00-load-initial-state/nodepool-basic.json index ece7640a988..5797dff7322 100644 --- a/test-integration/backend/controllers/mismatches/artifacts/cluster/remove_orphaned_cluster_descendents/00-load-initial-state/nodepool-basic.json +++ b/test-integration/backend/controllers/mismatches/artifacts/cluster/remove_orphaned_cluster_descendents/00-load-initial-state/nodepool-basic.json @@ -7,55 +7,50 @@ "id": "b3b837bb-154f-5f52-8562-96a8c9d2bb05", "partitionKey": "a433a095-1277-44f1-8453-8d61a4d848c2", "properties": { - "intermediateResourceDoc": { - "activeOperationId": "a7b69c90-242b-4a85-8187-0b3bd4979155", - "internalId": "/api/clusters_mgmt/v1/clusters/w9xhwccbjp/node_pools/k9xp9ghzh2", - "provisioningState": "Accepted", - "resourceId": "/subscriptions/a433a095-1277-44f1-8453-8d61a4d848c2/resourceGroups/unimportantpostponement/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/monstrousprecinct/nodePools/basic", - "systemData": { - "createdBy": "Unknown-ARO-HCP-frontend", - "createdByType": "Application", - "lastModifiedBy": "Unknown-ARO-HCP-frontend", - "lastModifiedByType": "Application" - } - }, - "internalState": { - "internalAPI": { - "location": "fake-location", - "properties": { - "autoRepair": true, - "autoScaling": { - "max": 5, - "min": 1 - }, - "labels": { - "label-ky": "label-value" - }, - "nodeDrainTimeoutMinutes": 2, - "platform": { - "enableEncryptionAtHost": false, - "osDisk": { - "diskStorageAccountType": "Premium_LRS", - "sizeGiB": 64 - }, - "vmSize": "large" - }, - "taints": [ - { - "effect": "NoExecute", - "key": "foo.com/key", - "value": "valid" - } - ], - "version": { - "channelGroup": "stable" - } + "id": "/subscriptions/a433a095-1277-44f1-8453-8d61a4d848c2/resourceGroups/unimportantpostponement/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/monstrousprecinct/nodePools/basic", + "location": "fake-location", + "name": "basic", + "properties": { + "autoRepair": true, + "autoScaling": { + "max": 5, + "min": 1 + }, + "labels": { + "label-ky": "label-value" + }, + "nodeDrainTimeoutMinutes": 2, + "platform": { + "enableEncryptionAtHost": false, + "osDisk": { + "diskStorageAccountType": "Premium_LRS", + "sizeGiB": 64 }, - "serviceProviderProperties": { - "clusterServiceID": "" + "vmSize": "large" + }, + "provisioningState": "Accepted", + "taints": [ + { + "effect": "NoExecute", + "key": "foo.com/key", + "value": "valid" } + ], + "version": { + "channelGroup": "stable" } - } + }, + "serviceProviderProperties": { + "activeOperationId": "a7b69c90-242b-4a85-8187-0b3bd4979155", + "clusterServiceID": "/api/clusters_mgmt/v1/clusters/w9xhwccbjp/node_pools/k9xp9ghzh2" + }, + "systemData": { + "createdBy": "Unknown-ARO-HCP-frontend", + "createdByType": "Application", + "lastModifiedBy": "Unknown-ARO-HCP-frontend", + "lastModifiedByType": "Application" + }, + "type": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/nodePools" }, "resourceID": "/subscriptions/a433a095-1277-44f1-8453-8d61a4d848c2/resourceGroups/unimportantpostponement/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/monstrousprecinct/nodePools/basic", "resourceType": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/nodePools" diff --git a/test-integration/backend/controllers/mismatches/artifacts/delete_orphaned_cosmos/all_parents_exist/00-load-initial-state/nodepool-basic.json b/test-integration/backend/controllers/mismatches/artifacts/delete_orphaned_cosmos/all_parents_exist/00-load-initial-state/nodepool-basic.json index 82907a76314..1edcc7f87b8 100644 --- a/test-integration/backend/controllers/mismatches/artifacts/delete_orphaned_cosmos/all_parents_exist/00-load-initial-state/nodepool-basic.json +++ b/test-integration/backend/controllers/mismatches/artifacts/delete_orphaned_cosmos/all_parents_exist/00-load-initial-state/nodepool-basic.json @@ -2,35 +2,30 @@ "id": "b3b837bb-154f-5f52-8562-96a8c9d2bb05", "partitionKey": "a433a095-1277-44f1-8453-8d61a4d848c2", "properties": { - "intermediateResourceDoc": { - "activeOperationId": "a7b69c90-242b-4a85-8187-0b3bd4979155", - "internalId": "/api/clusters_mgmt/v1/clusters/w9xhwccbjp/node_pools/k9xp9ghzh2", + "id": "/subscriptions/a433a095-1277-44f1-8453-8d61a4d848c2/resourceGroups/unimportantpostponement/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/monstrousprecinct/nodePools/basic", + "location": "fake-location", + "name": "basic", + "properties": { + "autoRepair": true, + "platform": { + "vmSize": "large" + }, "provisioningState": "Accepted", - "resourceId": "/subscriptions/a433a095-1277-44f1-8453-8d61a4d848c2/resourceGroups/unimportantpostponement/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/monstrousprecinct/nodePools/basic", - "systemData": { - "createdBy": "Unknown-ARO-HCP-frontend", - "createdByType": "Application", - "lastModifiedBy": "Unknown-ARO-HCP-frontend", - "lastModifiedByType": "Application" + "version": { + "channelGroup": "stable" } }, - "internalState": { - "internalAPI": { - "location": "fake-location", - "properties": { - "autoRepair": true, - "platform": { - "vmSize": "large" - }, - "version": { - "channelGroup": "stable" - } - }, - "serviceProviderProperties": { - "clusterServiceID": "" - } - } - } + "serviceProviderProperties": { + "activeOperationId": "a7b69c90-242b-4a85-8187-0b3bd4979155", + "clusterServiceID": "/api/clusters_mgmt/v1/clusters/w9xhwccbjp/node_pools/k9xp9ghzh2" + }, + "systemData": { + "createdBy": "Unknown-ARO-HCP-frontend", + "createdByType": "Application", + "lastModifiedBy": "Unknown-ARO-HCP-frontend", + "lastModifiedByType": "Application" + }, + "type": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/nodePools" }, "resourceID": "/subscriptions/a433a095-1277-44f1-8453-8d61a4d848c2/resourceGroups/unimportantpostponement/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/monstrousprecinct/nodePools/basic", "resourceType": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/nodePools" diff --git a/test-integration/backend/controllers/mismatches/artifacts/delete_orphaned_cosmos/all_parents_exist/99-cosmosCompare-end-state/nodepool-basic.json b/test-integration/backend/controllers/mismatches/artifacts/delete_orphaned_cosmos/all_parents_exist/99-cosmosCompare-end-state/nodepool-basic.json index 82907a76314..1edcc7f87b8 100644 --- a/test-integration/backend/controllers/mismatches/artifacts/delete_orphaned_cosmos/all_parents_exist/99-cosmosCompare-end-state/nodepool-basic.json +++ b/test-integration/backend/controllers/mismatches/artifacts/delete_orphaned_cosmos/all_parents_exist/99-cosmosCompare-end-state/nodepool-basic.json @@ -2,35 +2,30 @@ "id": "b3b837bb-154f-5f52-8562-96a8c9d2bb05", "partitionKey": "a433a095-1277-44f1-8453-8d61a4d848c2", "properties": { - "intermediateResourceDoc": { - "activeOperationId": "a7b69c90-242b-4a85-8187-0b3bd4979155", - "internalId": "/api/clusters_mgmt/v1/clusters/w9xhwccbjp/node_pools/k9xp9ghzh2", + "id": "/subscriptions/a433a095-1277-44f1-8453-8d61a4d848c2/resourceGroups/unimportantpostponement/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/monstrousprecinct/nodePools/basic", + "location": "fake-location", + "name": "basic", + "properties": { + "autoRepair": true, + "platform": { + "vmSize": "large" + }, "provisioningState": "Accepted", - "resourceId": "/subscriptions/a433a095-1277-44f1-8453-8d61a4d848c2/resourceGroups/unimportantpostponement/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/monstrousprecinct/nodePools/basic", - "systemData": { - "createdBy": "Unknown-ARO-HCP-frontend", - "createdByType": "Application", - "lastModifiedBy": "Unknown-ARO-HCP-frontend", - "lastModifiedByType": "Application" + "version": { + "channelGroup": "stable" } }, - "internalState": { - "internalAPI": { - "location": "fake-location", - "properties": { - "autoRepair": true, - "platform": { - "vmSize": "large" - }, - "version": { - "channelGroup": "stable" - } - }, - "serviceProviderProperties": { - "clusterServiceID": "" - } - } - } + "serviceProviderProperties": { + "activeOperationId": "a7b69c90-242b-4a85-8187-0b3bd4979155", + "clusterServiceID": "/api/clusters_mgmt/v1/clusters/w9xhwccbjp/node_pools/k9xp9ghzh2" + }, + "systemData": { + "createdBy": "Unknown-ARO-HCP-frontend", + "createdByType": "Application", + "lastModifiedBy": "Unknown-ARO-HCP-frontend", + "lastModifiedByType": "Application" + }, + "type": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/nodePools" }, "resourceID": "/subscriptions/a433a095-1277-44f1-8453-8d61a4d848c2/resourceGroups/unimportantpostponement/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/monstrousprecinct/nodePools/basic", "resourceType": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/nodePools" diff --git a/test-integration/backend/controllers/mismatches/artifacts/externalauth/remove_orphaned_externalauth_descendents/00-load-initial-state/nodepool-basic.json b/test-integration/backend/controllers/mismatches/artifacts/externalauth/remove_orphaned_externalauth_descendents/00-load-initial-state/nodepool-basic.json index 52f75e1bd77..b803b91fc88 100644 --- a/test-integration/backend/controllers/mismatches/artifacts/externalauth/remove_orphaned_externalauth_descendents/00-load-initial-state/nodepool-basic.json +++ b/test-integration/backend/controllers/mismatches/artifacts/externalauth/remove_orphaned_externalauth_descendents/00-load-initial-state/nodepool-basic.json @@ -7,55 +7,50 @@ "id": "b3b837bb-154f-5f52-8562-96a8c9d2bb05", "partitionKey": "a433a095-1277-44f1-8453-8d61a4d848c2", "properties": { - "intermediateResourceDoc": { - "activeOperationId": "a7b69c90-242b-4a85-8187-0b3bd4979155", - "internalId": "/api/clusters_mgmt/v1/clusters/1243e9e9-d150-4ef1-9735-2bbc3cabc7d0/node_pools/k9xp9ghzh2", - "provisioningState": "Accepted", - "resourceId": "/subscriptions/a433a095-1277-44f1-8453-8d61a4d848c2/resourceGroups/unimportantpostponement/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/monstrousprecinct/nodePools/basic", - "systemData": { - "createdBy": "Unknown-ARO-HCP-frontend", - "createdByType": "Application", - "lastModifiedBy": "Unknown-ARO-HCP-frontend", - "lastModifiedByType": "Application" - } - }, - "internalState": { - "internalAPI": { - "location": "fake-location", - "properties": { - "autoRepair": true, - "autoScaling": { - "max": 5, - "min": 1 - }, - "labels": { - "label-ky": "label-value" - }, - "nodeDrainTimeoutMinutes": 2, - "platform": { - "enableEncryptionAtHost": false, - "osDisk": { - "diskStorageAccountType": "Premium_LRS", - "sizeGiB": 64 - }, - "vmSize": "large" - }, - "taints": [ - { - "effect": "NoExecute", - "key": "foo.com/key", - "value": "valid" - } - ], - "version": { - "channelGroup": "stable" - } + "id": "/subscriptions/a433a095-1277-44f1-8453-8d61a4d848c2/resourceGroups/unimportantpostponement/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/monstrousprecinct/nodePools/basic", + "location": "fake-location", + "name": "basic", + "properties": { + "autoRepair": true, + "autoScaling": { + "max": 5, + "min": 1 + }, + "labels": { + "label-ky": "label-value" + }, + "nodeDrainTimeoutMinutes": 2, + "platform": { + "enableEncryptionAtHost": false, + "osDisk": { + "diskStorageAccountType": "Premium_LRS", + "sizeGiB": 64 }, - "serviceProviderProperties": { - "clusterServiceID": "" + "vmSize": "large" + }, + "provisioningState": "Accepted", + "taints": [ + { + "effect": "NoExecute", + "key": "foo.com/key", + "value": "valid" } + ], + "version": { + "channelGroup": "stable" } - } + }, + "serviceProviderProperties": { + "activeOperationId": "a7b69c90-242b-4a85-8187-0b3bd4979155", + "clusterServiceID": "/api/clusters_mgmt/v1/clusters/1243e9e9-d150-4ef1-9735-2bbc3cabc7d0/node_pools/k9xp9ghzh2" + }, + "systemData": { + "createdBy": "Unknown-ARO-HCP-frontend", + "createdByType": "Application", + "lastModifiedBy": "Unknown-ARO-HCP-frontend", + "lastModifiedByType": "Application" + }, + "type": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/nodePools" }, "resourceID": "/subscriptions/a433a095-1277-44f1-8453-8d61a4d848c2/resourceGroups/unimportantpostponement/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/monstrousprecinct/nodePools/basic", "resourceType": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/nodePools" diff --git a/test-integration/backend/controllers/mismatches/artifacts/externalauth/remove_orphaned_externalauth_descendents/99-cosmosCompare-end-state/nodepool-basic.json b/test-integration/backend/controllers/mismatches/artifacts/externalauth/remove_orphaned_externalauth_descendents/99-cosmosCompare-end-state/nodepool-basic.json index 52f75e1bd77..b803b91fc88 100644 --- a/test-integration/backend/controllers/mismatches/artifacts/externalauth/remove_orphaned_externalauth_descendents/99-cosmosCompare-end-state/nodepool-basic.json +++ b/test-integration/backend/controllers/mismatches/artifacts/externalauth/remove_orphaned_externalauth_descendents/99-cosmosCompare-end-state/nodepool-basic.json @@ -7,55 +7,50 @@ "id": "b3b837bb-154f-5f52-8562-96a8c9d2bb05", "partitionKey": "a433a095-1277-44f1-8453-8d61a4d848c2", "properties": { - "intermediateResourceDoc": { - "activeOperationId": "a7b69c90-242b-4a85-8187-0b3bd4979155", - "internalId": "/api/clusters_mgmt/v1/clusters/1243e9e9-d150-4ef1-9735-2bbc3cabc7d0/node_pools/k9xp9ghzh2", - "provisioningState": "Accepted", - "resourceId": "/subscriptions/a433a095-1277-44f1-8453-8d61a4d848c2/resourceGroups/unimportantpostponement/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/monstrousprecinct/nodePools/basic", - "systemData": { - "createdBy": "Unknown-ARO-HCP-frontend", - "createdByType": "Application", - "lastModifiedBy": "Unknown-ARO-HCP-frontend", - "lastModifiedByType": "Application" - } - }, - "internalState": { - "internalAPI": { - "location": "fake-location", - "properties": { - "autoRepair": true, - "autoScaling": { - "max": 5, - "min": 1 - }, - "labels": { - "label-ky": "label-value" - }, - "nodeDrainTimeoutMinutes": 2, - "platform": { - "enableEncryptionAtHost": false, - "osDisk": { - "diskStorageAccountType": "Premium_LRS", - "sizeGiB": 64 - }, - "vmSize": "large" - }, - "taints": [ - { - "effect": "NoExecute", - "key": "foo.com/key", - "value": "valid" - } - ], - "version": { - "channelGroup": "stable" - } + "id": "/subscriptions/a433a095-1277-44f1-8453-8d61a4d848c2/resourceGroups/unimportantpostponement/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/monstrousprecinct/nodePools/basic", + "location": "fake-location", + "name": "basic", + "properties": { + "autoRepair": true, + "autoScaling": { + "max": 5, + "min": 1 + }, + "labels": { + "label-ky": "label-value" + }, + "nodeDrainTimeoutMinutes": 2, + "platform": { + "enableEncryptionAtHost": false, + "osDisk": { + "diskStorageAccountType": "Premium_LRS", + "sizeGiB": 64 }, - "serviceProviderProperties": { - "clusterServiceID": "" + "vmSize": "large" + }, + "provisioningState": "Accepted", + "taints": [ + { + "effect": "NoExecute", + "key": "foo.com/key", + "value": "valid" } + ], + "version": { + "channelGroup": "stable" } - } + }, + "serviceProviderProperties": { + "activeOperationId": "a7b69c90-242b-4a85-8187-0b3bd4979155", + "clusterServiceID": "/api/clusters_mgmt/v1/clusters/1243e9e9-d150-4ef1-9735-2bbc3cabc7d0/node_pools/k9xp9ghzh2" + }, + "systemData": { + "createdBy": "Unknown-ARO-HCP-frontend", + "createdByType": "Application", + "lastModifiedBy": "Unknown-ARO-HCP-frontend", + "lastModifiedByType": "Application" + }, + "type": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/nodePools" }, "resourceID": "/subscriptions/a433a095-1277-44f1-8453-8d61a4d848c2/resourceGroups/unimportantpostponement/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/monstrousprecinct/nodePools/basic", "resourceType": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/nodePools" diff --git a/test-integration/backend/controllers/mismatches/artifacts/nodepool/present_nodepool/00-load-initial-state/nodepool-basic.json b/test-integration/backend/controllers/mismatches/artifacts/nodepool/present_nodepool/00-load-initial-state/nodepool-basic.json index 52f75e1bd77..b803b91fc88 100644 --- a/test-integration/backend/controllers/mismatches/artifacts/nodepool/present_nodepool/00-load-initial-state/nodepool-basic.json +++ b/test-integration/backend/controllers/mismatches/artifacts/nodepool/present_nodepool/00-load-initial-state/nodepool-basic.json @@ -7,55 +7,50 @@ "id": "b3b837bb-154f-5f52-8562-96a8c9d2bb05", "partitionKey": "a433a095-1277-44f1-8453-8d61a4d848c2", "properties": { - "intermediateResourceDoc": { - "activeOperationId": "a7b69c90-242b-4a85-8187-0b3bd4979155", - "internalId": "/api/clusters_mgmt/v1/clusters/1243e9e9-d150-4ef1-9735-2bbc3cabc7d0/node_pools/k9xp9ghzh2", - "provisioningState": "Accepted", - "resourceId": "/subscriptions/a433a095-1277-44f1-8453-8d61a4d848c2/resourceGroups/unimportantpostponement/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/monstrousprecinct/nodePools/basic", - "systemData": { - "createdBy": "Unknown-ARO-HCP-frontend", - "createdByType": "Application", - "lastModifiedBy": "Unknown-ARO-HCP-frontend", - "lastModifiedByType": "Application" - } - }, - "internalState": { - "internalAPI": { - "location": "fake-location", - "properties": { - "autoRepair": true, - "autoScaling": { - "max": 5, - "min": 1 - }, - "labels": { - "label-ky": "label-value" - }, - "nodeDrainTimeoutMinutes": 2, - "platform": { - "enableEncryptionAtHost": false, - "osDisk": { - "diskStorageAccountType": "Premium_LRS", - "sizeGiB": 64 - }, - "vmSize": "large" - }, - "taints": [ - { - "effect": "NoExecute", - "key": "foo.com/key", - "value": "valid" - } - ], - "version": { - "channelGroup": "stable" - } + "id": "/subscriptions/a433a095-1277-44f1-8453-8d61a4d848c2/resourceGroups/unimportantpostponement/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/monstrousprecinct/nodePools/basic", + "location": "fake-location", + "name": "basic", + "properties": { + "autoRepair": true, + "autoScaling": { + "max": 5, + "min": 1 + }, + "labels": { + "label-ky": "label-value" + }, + "nodeDrainTimeoutMinutes": 2, + "platform": { + "enableEncryptionAtHost": false, + "osDisk": { + "diskStorageAccountType": "Premium_LRS", + "sizeGiB": 64 }, - "serviceProviderProperties": { - "clusterServiceID": "" + "vmSize": "large" + }, + "provisioningState": "Accepted", + "taints": [ + { + "effect": "NoExecute", + "key": "foo.com/key", + "value": "valid" } + ], + "version": { + "channelGroup": "stable" } - } + }, + "serviceProviderProperties": { + "activeOperationId": "a7b69c90-242b-4a85-8187-0b3bd4979155", + "clusterServiceID": "/api/clusters_mgmt/v1/clusters/1243e9e9-d150-4ef1-9735-2bbc3cabc7d0/node_pools/k9xp9ghzh2" + }, + "systemData": { + "createdBy": "Unknown-ARO-HCP-frontend", + "createdByType": "Application", + "lastModifiedBy": "Unknown-ARO-HCP-frontend", + "lastModifiedByType": "Application" + }, + "type": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/nodePools" }, "resourceID": "/subscriptions/a433a095-1277-44f1-8453-8d61a4d848c2/resourceGroups/unimportantpostponement/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/monstrousprecinct/nodePools/basic", "resourceType": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/nodePools" diff --git a/test-integration/backend/controllers/mismatches/artifacts/nodepool/present_nodepool/99-cosmosCompare-end-state/nodepool-basic.json b/test-integration/backend/controllers/mismatches/artifacts/nodepool/present_nodepool/99-cosmosCompare-end-state/nodepool-basic.json index ece7640a988..5797dff7322 100644 --- a/test-integration/backend/controllers/mismatches/artifacts/nodepool/present_nodepool/99-cosmosCompare-end-state/nodepool-basic.json +++ b/test-integration/backend/controllers/mismatches/artifacts/nodepool/present_nodepool/99-cosmosCompare-end-state/nodepool-basic.json @@ -7,55 +7,50 @@ "id": "b3b837bb-154f-5f52-8562-96a8c9d2bb05", "partitionKey": "a433a095-1277-44f1-8453-8d61a4d848c2", "properties": { - "intermediateResourceDoc": { - "activeOperationId": "a7b69c90-242b-4a85-8187-0b3bd4979155", - "internalId": "/api/clusters_mgmt/v1/clusters/w9xhwccbjp/node_pools/k9xp9ghzh2", - "provisioningState": "Accepted", - "resourceId": "/subscriptions/a433a095-1277-44f1-8453-8d61a4d848c2/resourceGroups/unimportantpostponement/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/monstrousprecinct/nodePools/basic", - "systemData": { - "createdBy": "Unknown-ARO-HCP-frontend", - "createdByType": "Application", - "lastModifiedBy": "Unknown-ARO-HCP-frontend", - "lastModifiedByType": "Application" - } - }, - "internalState": { - "internalAPI": { - "location": "fake-location", - "properties": { - "autoRepair": true, - "autoScaling": { - "max": 5, - "min": 1 - }, - "labels": { - "label-ky": "label-value" - }, - "nodeDrainTimeoutMinutes": 2, - "platform": { - "enableEncryptionAtHost": false, - "osDisk": { - "diskStorageAccountType": "Premium_LRS", - "sizeGiB": 64 - }, - "vmSize": "large" - }, - "taints": [ - { - "effect": "NoExecute", - "key": "foo.com/key", - "value": "valid" - } - ], - "version": { - "channelGroup": "stable" - } + "id": "/subscriptions/a433a095-1277-44f1-8453-8d61a4d848c2/resourceGroups/unimportantpostponement/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/monstrousprecinct/nodePools/basic", + "location": "fake-location", + "name": "basic", + "properties": { + "autoRepair": true, + "autoScaling": { + "max": 5, + "min": 1 + }, + "labels": { + "label-ky": "label-value" + }, + "nodeDrainTimeoutMinutes": 2, + "platform": { + "enableEncryptionAtHost": false, + "osDisk": { + "diskStorageAccountType": "Premium_LRS", + "sizeGiB": 64 }, - "serviceProviderProperties": { - "clusterServiceID": "" + "vmSize": "large" + }, + "provisioningState": "Accepted", + "taints": [ + { + "effect": "NoExecute", + "key": "foo.com/key", + "value": "valid" } + ], + "version": { + "channelGroup": "stable" } - } + }, + "serviceProviderProperties": { + "activeOperationId": "a7b69c90-242b-4a85-8187-0b3bd4979155", + "clusterServiceID": "/api/clusters_mgmt/v1/clusters/w9xhwccbjp/node_pools/k9xp9ghzh2" + }, + "systemData": { + "createdBy": "Unknown-ARO-HCP-frontend", + "createdByType": "Application", + "lastModifiedBy": "Unknown-ARO-HCP-frontend", + "lastModifiedByType": "Application" + }, + "type": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/nodePools" }, "resourceID": "/subscriptions/a433a095-1277-44f1-8453-8d61a4d848c2/resourceGroups/unimportantpostponement/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/monstrousprecinct/nodePools/basic", "resourceType": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/nodePools" diff --git a/test-integration/backend/controllers/mismatches/artifacts/nodepool/remove_orphaned_nodepool_descendents/00-load-initial-state/nodepool-basic.json b/test-integration/backend/controllers/mismatches/artifacts/nodepool/remove_orphaned_nodepool_descendents/00-load-initial-state/nodepool-basic.json index ece7640a988..5797dff7322 100644 --- a/test-integration/backend/controllers/mismatches/artifacts/nodepool/remove_orphaned_nodepool_descendents/00-load-initial-state/nodepool-basic.json +++ b/test-integration/backend/controllers/mismatches/artifacts/nodepool/remove_orphaned_nodepool_descendents/00-load-initial-state/nodepool-basic.json @@ -7,55 +7,50 @@ "id": "b3b837bb-154f-5f52-8562-96a8c9d2bb05", "partitionKey": "a433a095-1277-44f1-8453-8d61a4d848c2", "properties": { - "intermediateResourceDoc": { - "activeOperationId": "a7b69c90-242b-4a85-8187-0b3bd4979155", - "internalId": "/api/clusters_mgmt/v1/clusters/w9xhwccbjp/node_pools/k9xp9ghzh2", - "provisioningState": "Accepted", - "resourceId": "/subscriptions/a433a095-1277-44f1-8453-8d61a4d848c2/resourceGroups/unimportantpostponement/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/monstrousprecinct/nodePools/basic", - "systemData": { - "createdBy": "Unknown-ARO-HCP-frontend", - "createdByType": "Application", - "lastModifiedBy": "Unknown-ARO-HCP-frontend", - "lastModifiedByType": "Application" - } - }, - "internalState": { - "internalAPI": { - "location": "fake-location", - "properties": { - "autoRepair": true, - "autoScaling": { - "max": 5, - "min": 1 - }, - "labels": { - "label-ky": "label-value" - }, - "nodeDrainTimeoutMinutes": 2, - "platform": { - "enableEncryptionAtHost": false, - "osDisk": { - "diskStorageAccountType": "Premium_LRS", - "sizeGiB": 64 - }, - "vmSize": "large" - }, - "taints": [ - { - "effect": "NoExecute", - "key": "foo.com/key", - "value": "valid" - } - ], - "version": { - "channelGroup": "stable" - } + "id": "/subscriptions/a433a095-1277-44f1-8453-8d61a4d848c2/resourceGroups/unimportantpostponement/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/monstrousprecinct/nodePools/basic", + "location": "fake-location", + "name": "basic", + "properties": { + "autoRepair": true, + "autoScaling": { + "max": 5, + "min": 1 + }, + "labels": { + "label-ky": "label-value" + }, + "nodeDrainTimeoutMinutes": 2, + "platform": { + "enableEncryptionAtHost": false, + "osDisk": { + "diskStorageAccountType": "Premium_LRS", + "sizeGiB": 64 }, - "serviceProviderProperties": { - "clusterServiceID": "" + "vmSize": "large" + }, + "provisioningState": "Accepted", + "taints": [ + { + "effect": "NoExecute", + "key": "foo.com/key", + "value": "valid" } + ], + "version": { + "channelGroup": "stable" } - } + }, + "serviceProviderProperties": { + "activeOperationId": "a7b69c90-242b-4a85-8187-0b3bd4979155", + "clusterServiceID": "/api/clusters_mgmt/v1/clusters/w9xhwccbjp/node_pools/k9xp9ghzh2" + }, + "systemData": { + "createdBy": "Unknown-ARO-HCP-frontend", + "createdByType": "Application", + "lastModifiedBy": "Unknown-ARO-HCP-frontend", + "lastModifiedByType": "Application" + }, + "type": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/nodePools" }, "resourceID": "/subscriptions/a433a095-1277-44f1-8453-8d61a4d848c2/resourceGroups/unimportantpostponement/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/monstrousprecinct/nodePools/basic", "resourceType": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/nodePools" diff --git a/test-integration/frontend/artifacts/DatabaseCRUD/UntypedCRUD/basic/01-load-initial/immutability-np.json b/test-integration/frontend/artifacts/DatabaseCRUD/UntypedCRUD/basic/01-load-initial/immutability-np.json index c58a82e8754..591500eab56 100644 --- a/test-integration/frontend/artifacts/DatabaseCRUD/UntypedCRUD/basic/01-load-initial/immutability-np.json +++ b/test-integration/frontend/artifacts/DatabaseCRUD/UntypedCRUD/basic/01-load-initial/immutability-np.json @@ -8,28 +8,6 @@ "partitionKey": "f52dfea2-47ee-4396-8006-4a27d47d59c5", "properties": { "internalId": "/api/aro_hcp/v1alpha1/clusters/cs-immutability/node_pools/4nd28q7n8q", - "internalState": { - "internalAPI": { - "location": "fake-location", - "properties": { - "autoRepair": true, - "platform": { - "enableEncryptionAtHost": false, - "osDisk": { - "diskStorageAccountType": "Premium_LRS", - "sizeGiB": 64 - }, - "vmSize": "large" - }, - "version": { - "channelGroup": "stable" - } - }, - "serviceProviderProperties": { - "clusterServiceID": "" - } - } - }, "provisioningState": "Succeeded", "resourceId": "/subscriptions/f52dfea2-47ee-4396-8006-4a27d47d59c5/resourceGroups/some-resource-group/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/immutability/nodePools/immutability-np", "systemData": { diff --git a/test-integration/frontend/artifacts/DatabaseCRUD/UntypedCRUD/basic/02-untypedListRecursive-immutability/immutability-np.json b/test-integration/frontend/artifacts/DatabaseCRUD/UntypedCRUD/basic/02-untypedListRecursive-immutability/immutability-np.json index 73f0aed64fe..2b192996d64 100644 --- a/test-integration/frontend/artifacts/DatabaseCRUD/UntypedCRUD/basic/02-untypedListRecursive-immutability/immutability-np.json +++ b/test-integration/frontend/artifacts/DatabaseCRUD/UntypedCRUD/basic/02-untypedListRecursive-immutability/immutability-np.json @@ -3,28 +3,6 @@ "partitionKey": "f52dfea2-47ee-4396-8006-4a27d47d59c5", "properties": { "internalId": "/api/aro_hcp/v1alpha1/clusters/cs-immutability/node_pools/4nd28q7n8q", - "internalState": { - "internalAPI": { - "location": "fake-location", - "properties": { - "autoRepair": true, - "platform": { - "enableEncryptionAtHost": false, - "osDisk": { - "diskStorageAccountType": "Premium_LRS", - "sizeGiB": 64 - }, - "vmSize": "large" - }, - "version": { - "channelGroup": "stable" - } - }, - "serviceProviderProperties": { - "clusterServiceID": "" - } - } - }, "provisioningState": "Succeeded", "resourceId": "/subscriptions/f52dfea2-47ee-4396-8006-4a27d47d59c5/resourceGroups/some-resource-group/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/immutability/nodePools/immutability-np", "systemData": { diff --git a/test-integration/frontend/artifacts/DatabaseCRUD/UntypedCRUD/basic/04-untypedListRecursive-resourcegroup/immutability-np.json b/test-integration/frontend/artifacts/DatabaseCRUD/UntypedCRUD/basic/04-untypedListRecursive-resourcegroup/immutability-np.json index 73f0aed64fe..2b192996d64 100644 --- a/test-integration/frontend/artifacts/DatabaseCRUD/UntypedCRUD/basic/04-untypedListRecursive-resourcegroup/immutability-np.json +++ b/test-integration/frontend/artifacts/DatabaseCRUD/UntypedCRUD/basic/04-untypedListRecursive-resourcegroup/immutability-np.json @@ -3,28 +3,6 @@ "partitionKey": "f52dfea2-47ee-4396-8006-4a27d47d59c5", "properties": { "internalId": "/api/aro_hcp/v1alpha1/clusters/cs-immutability/node_pools/4nd28q7n8q", - "internalState": { - "internalAPI": { - "location": "fake-location", - "properties": { - "autoRepair": true, - "platform": { - "enableEncryptionAtHost": false, - "osDisk": { - "diskStorageAccountType": "Premium_LRS", - "sizeGiB": 64 - }, - "vmSize": "large" - }, - "version": { - "channelGroup": "stable" - } - }, - "serviceProviderProperties": { - "clusterServiceID": "" - } - } - }, "provisioningState": "Succeeded", "resourceId": "/subscriptions/f52dfea2-47ee-4396-8006-4a27d47d59c5/resourceGroups/some-resource-group/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/immutability/nodePools/immutability-np", "systemData": { diff --git a/test-integration/frontend/artifacts/DatabaseCRUD/UntypedCRUD/basic/05-untypedListRecursive-subscription/immutability-np.json b/test-integration/frontend/artifacts/DatabaseCRUD/UntypedCRUD/basic/05-untypedListRecursive-subscription/immutability-np.json index 73f0aed64fe..2b192996d64 100644 --- a/test-integration/frontend/artifacts/DatabaseCRUD/UntypedCRUD/basic/05-untypedListRecursive-subscription/immutability-np.json +++ b/test-integration/frontend/artifacts/DatabaseCRUD/UntypedCRUD/basic/05-untypedListRecursive-subscription/immutability-np.json @@ -3,28 +3,6 @@ "partitionKey": "f52dfea2-47ee-4396-8006-4a27d47d59c5", "properties": { "internalId": "/api/aro_hcp/v1alpha1/clusters/cs-immutability/node_pools/4nd28q7n8q", - "internalState": { - "internalAPI": { - "location": "fake-location", - "properties": { - "autoRepair": true, - "platform": { - "enableEncryptionAtHost": false, - "osDisk": { - "diskStorageAccountType": "Premium_LRS", - "sizeGiB": 64 - }, - "vmSize": "large" - }, - "version": { - "channelGroup": "stable" - } - }, - "serviceProviderProperties": { - "clusterServiceID": "" - } - } - }, "provisioningState": "Succeeded", "resourceId": "/subscriptions/f52dfea2-47ee-4396-8006-4a27d47d59c5/resourceGroups/some-resource-group/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/immutability/nodePools/immutability-np", "systemData": { diff --git a/test-integration/frontend/artifacts/DatabaseCRUD/UntypedCRUD/basic/07-untypedListRecursive-resourcegroup-via-child/immutability-np.json b/test-integration/frontend/artifacts/DatabaseCRUD/UntypedCRUD/basic/07-untypedListRecursive-resourcegroup-via-child/immutability-np.json index 73f0aed64fe..2b192996d64 100644 --- a/test-integration/frontend/artifacts/DatabaseCRUD/UntypedCRUD/basic/07-untypedListRecursive-resourcegroup-via-child/immutability-np.json +++ b/test-integration/frontend/artifacts/DatabaseCRUD/UntypedCRUD/basic/07-untypedListRecursive-resourcegroup-via-child/immutability-np.json @@ -3,28 +3,6 @@ "partitionKey": "f52dfea2-47ee-4396-8006-4a27d47d59c5", "properties": { "internalId": "/api/aro_hcp/v1alpha1/clusters/cs-immutability/node_pools/4nd28q7n8q", - "internalState": { - "internalAPI": { - "location": "fake-location", - "properties": { - "autoRepair": true, - "platform": { - "enableEncryptionAtHost": false, - "osDisk": { - "diskStorageAccountType": "Premium_LRS", - "sizeGiB": 64 - }, - "vmSize": "large" - }, - "version": { - "channelGroup": "stable" - } - }, - "serviceProviderProperties": { - "clusterServiceID": "" - } - } - }, "provisioningState": "Succeeded", "resourceId": "/subscriptions/f52dfea2-47ee-4396-8006-4a27d47d59c5/resourceGroups/some-resource-group/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/immutability/nodePools/immutability-np", "systemData": { diff --git a/test-integration/frontend/artifacts/DatabaseCRUD/UntypedCRUD/basic/08-untypedListRecursive-immutability-cluster/immutability-np.json b/test-integration/frontend/artifacts/DatabaseCRUD/UntypedCRUD/basic/08-untypedListRecursive-immutability-cluster/immutability-np.json index 73f0aed64fe..2b192996d64 100644 --- a/test-integration/frontend/artifacts/DatabaseCRUD/UntypedCRUD/basic/08-untypedListRecursive-immutability-cluster/immutability-np.json +++ b/test-integration/frontend/artifacts/DatabaseCRUD/UntypedCRUD/basic/08-untypedListRecursive-immutability-cluster/immutability-np.json @@ -3,28 +3,6 @@ "partitionKey": "f52dfea2-47ee-4396-8006-4a27d47d59c5", "properties": { "internalId": "/api/aro_hcp/v1alpha1/clusters/cs-immutability/node_pools/4nd28q7n8q", - "internalState": { - "internalAPI": { - "location": "fake-location", - "properties": { - "autoRepair": true, - "platform": { - "enableEncryptionAtHost": false, - "osDisk": { - "diskStorageAccountType": "Premium_LRS", - "sizeGiB": 64 - }, - "vmSize": "large" - }, - "version": { - "channelGroup": "stable" - } - }, - "serviceProviderProperties": { - "clusterServiceID": "" - } - } - }, "provisioningState": "Succeeded", "resourceId": "/subscriptions/f52dfea2-47ee-4396-8006-4a27d47d59c5/resourceGroups/some-resource-group/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/immutability/nodePools/immutability-np", "systemData": { diff --git a/test-integration/frontend/artifacts/DatabaseCRUD/UntypedCRUD/basic/09-untypedList-immutability-cluster/immutability-np.json b/test-integration/frontend/artifacts/DatabaseCRUD/UntypedCRUD/basic/09-untypedList-immutability-cluster/immutability-np.json index 73f0aed64fe..2b192996d64 100644 --- a/test-integration/frontend/artifacts/DatabaseCRUD/UntypedCRUD/basic/09-untypedList-immutability-cluster/immutability-np.json +++ b/test-integration/frontend/artifacts/DatabaseCRUD/UntypedCRUD/basic/09-untypedList-immutability-cluster/immutability-np.json @@ -3,28 +3,6 @@ "partitionKey": "f52dfea2-47ee-4396-8006-4a27d47d59c5", "properties": { "internalId": "/api/aro_hcp/v1alpha1/clusters/cs-immutability/node_pools/4nd28q7n8q", - "internalState": { - "internalAPI": { - "location": "fake-location", - "properties": { - "autoRepair": true, - "platform": { - "enableEncryptionAtHost": false, - "osDisk": { - "diskStorageAccountType": "Premium_LRS", - "sizeGiB": 64 - }, - "vmSize": "large" - }, - "version": { - "channelGroup": "stable" - } - }, - "serviceProviderProperties": { - "clusterServiceID": "" - } - } - }, "provisioningState": "Succeeded", "resourceId": "/subscriptions/f52dfea2-47ee-4396-8006-4a27d47d59c5/resourceGroups/some-resource-group/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/immutability/nodePools/immutability-np", "systemData": { diff --git a/test-integration/frontend/artifacts/FrontendCRUD/Cluster/delete-with-pending-nodepool-operation/05-cosmosCompare-final-state/nodepool-test-nodepool.json b/test-integration/frontend/artifacts/FrontendCRUD/Cluster/delete-with-pending-nodepool-operation/05-cosmosCompare-final-state/nodepool-test-nodepool.json index da466fe3dd9..9351f871f22 100644 --- a/test-integration/frontend/artifacts/FrontendCRUD/Cluster/delete-with-pending-nodepool-operation/05-cosmosCompare-final-state/nodepool-test-nodepool.json +++ b/test-integration/frontend/artifacts/FrontendCRUD/Cluster/delete-with-pending-nodepool-operation/05-cosmosCompare-final-state/nodepool-test-nodepool.json @@ -5,56 +5,50 @@ "cosmosMetadata": { "resourceID": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/test-cluster/nodePools/test-nodepool" }, - "intermediateResourceDoc": { - "provisioningState": "Deleting", - "resourceId": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/test-cluster/nodePools/test-nodepool", - "systemData": { - "createdBy": "Unknown-ARO-HCP-frontend", - "createdByType": "Application", - "lastModifiedBy": "Unknown-ARO-HCP-frontend", - "lastModifiedByType": "Application" - } - }, - "internalState": { - "internalAPI": { - "location": "fake-location", - "properties": { - "autoRepair": true, - "autoScaling": { - "max": 5, - "min": 1 - }, - "labels": { - "label-key": "label-value" - }, - "nodeDrainTimeoutMinutes": 2, - "platform": { - "enableEncryptionAtHost": false, - "osDisk": { - "diskStorageAccountType": "Premium_LRS", - "diskType": "Managed", - "sizeGiB": 64 - }, - "subnetId": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/bar/providers/Microsoft.Network/virtualNetworks/vnet/subnets/subnet", - "vmSize": "large" - }, - "taints": [ - { - "effect": "NoExecute", - "key": "foo.com/key", - "value": "valid" - } - ], - "version": { - "channelGroup": "stable", - "id": "4.20.8" - } + "id": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/test-cluster/nodePools/test-nodepool", + "location": "fake-location", + "name": "test-nodepool", + "properties": { + "autoRepair": true, + "autoScaling": { + "max": 5, + "min": 1 + }, + "labels": { + "label-key": "label-value" + }, + "nodeDrainTimeoutMinutes": 2, + "platform": { + "enableEncryptionAtHost": false, + "osDisk": { + "diskStorageAccountType": "Premium_LRS", + "diskType": "Managed", + "sizeGiB": 64 }, - "serviceProviderProperties": { - "clusterServiceID": "" + "subnetId": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/bar/providers/Microsoft.Network/virtualNetworks/vnet/subnets/subnet", + "vmSize": "large" + }, + "provisioningState": "Deleting", + "taints": [ + { + "effect": "NoExecute", + "key": "foo.com/key", + "value": "valid" } + ], + "version": { + "channelGroup": "stable", + "id": "4.20.8" } - } + }, + "serviceProviderProperties": {}, + "systemData": { + "createdBy": "Unknown-ARO-HCP-frontend", + "createdByType": "Application", + "lastModifiedBy": "Unknown-ARO-HCP-frontend", + "lastModifiedByType": "Application" + }, + "type": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/nodePools" }, "resourceID": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/test-cluster/nodePools/test-nodepool", "resourceType": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/nodePools" diff --git a/test-integration/frontend/artifacts/FrontendCRUD/Migration/migrate-old-data/01-load-old-data/nodepool-basic-node-pool.json b/test-integration/frontend/artifacts/FrontendCRUD/Migration/migrate-old-data/01-load-old-data/nodepool-basic-node-pool.json index ae414a7a65a..058e1f3d1a0 100644 --- a/test-integration/frontend/artifacts/FrontendCRUD/Migration/migrate-old-data/01-load-old-data/nodepool-basic-node-pool.json +++ b/test-integration/frontend/artifacts/FrontendCRUD/Migration/migrate-old-data/01-load-old-data/nodepool-basic-node-pool.json @@ -7,55 +7,50 @@ "id": "2b834a28-7e5b-50e2-9fb9-b6679cdd6a1b", "partitionKey": "6b690bec-0c16-4ecb-8f67-781caf40bba7", "properties": { - "intermediateResourceDoc": { - "activeOperationId": "cdfb496e-6e70-4022-9f8d-b0dacf6d2ff5", - "internalId": "/api/clusters_mgmt/v1/clusters/9p2sk955gj/node_pools/59mkgdzg9s", - "provisioningState": "Accepted", - "resourceId": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/nodePools/basic-node-pool", - "systemData": { - "createdBy": "Unknown-ARO-HCP-frontend", - "createdByType": "Application", - "lastModifiedBy": "Unknown-ARO-HCP-frontend", - "lastModifiedByType": "Application" - } - }, - "internalState": { - "internalAPI": { - "location": "fake-location", - "properties": { - "autoRepair": true, - "autoScaling": { - "max": 5, - "min": 1 - }, - "labels": { - "label-ky": "label-value" - }, - "nodeDrainTimeoutMinutes": 2, - "platform": { - "enableEncryptionAtHost": false, - "osDisk": { - "diskStorageAccountType": "Premium_LRS", - "sizeGiB": 64 - }, - "vmSize": "large" - }, - "taints": [ - { - "effect": "NoExecute", - "key": "foo.com/key", - "value": "valid" - } - ], - "version": { - "channelGroup": "stable" - } + "id": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/nodePools/basic-node-pool", + "location": "fake-location", + "name": "basic-node-pool", + "properties": { + "autoRepair": true, + "autoScaling": { + "max": 5, + "min": 1 + }, + "labels": { + "label-ky": "label-value" + }, + "nodeDrainTimeoutMinutes": 2, + "platform": { + "enableEncryptionAtHost": false, + "osDisk": { + "diskStorageAccountType": "Premium_LRS", + "sizeGiB": 64 }, - "serviceProviderProperties": { - "clusterServiceID": "" + "vmSize": "large" + }, + "provisioningState": "Accepted", + "taints": [ + { + "effect": "NoExecute", + "key": "foo.com/key", + "value": "valid" } + ], + "version": { + "channelGroup": "stable" } - } + }, + "serviceProviderProperties": { + "activeOperationId": "cdfb496e-6e70-4022-9f8d-b0dacf6d2ff5", + "clusterServiceID": "/api/clusters_mgmt/v1/clusters/9p2sk955gj/node_pools/59mkgdzg9s" + }, + "systemData": { + "createdBy": "Unknown-ARO-HCP-frontend", + "createdByType": "Application", + "lastModifiedBy": "Unknown-ARO-HCP-frontend", + "lastModifiedByType": "Application" + }, + "type": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/nodePools" }, "resourceID": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/nodePools/basic-node-pool", "resourceType": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/nodePools" diff --git a/test-integration/frontend/artifacts/FrontendCRUD/Migration/migrate-old-data/01-load-old-data/nodepool-node-pool-02.json b/test-integration/frontend/artifacts/FrontendCRUD/Migration/migrate-old-data/01-load-old-data/nodepool-node-pool-02.json index 8be207227b0..dbb2c7839c1 100644 --- a/test-integration/frontend/artifacts/FrontendCRUD/Migration/migrate-old-data/01-load-old-data/nodepool-node-pool-02.json +++ b/test-integration/frontend/artifacts/FrontendCRUD/Migration/migrate-old-data/01-load-old-data/nodepool-node-pool-02.json @@ -7,55 +7,50 @@ "id": "9b74accf-0661-53d8-9741-b3aa39f9a53c", "partitionKey": "6b690bec-0c16-4ecb-8f67-781caf40bba7", "properties": { - "intermediateResourceDoc": { - "activeOperationId": "4067756a-fcc1-4732-a211-d785d888203c", - "internalId": "/api/clusters_mgmt/v1/clusters/9p2sk955gj/node_pools/v4lx7rv2r4", - "provisioningState": "Accepted", - "resourceId": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/nodePools/node-pool-02", - "systemData": { - "createdBy": "Unknown-ARO-HCP-frontend", - "createdByType": "Application", - "lastModifiedBy": "Unknown-ARO-HCP-frontend", - "lastModifiedByType": "Application" - } - }, - "internalState": { - "internalAPI": { - "location": "fake-location", - "properties": { - "autoRepair": true, - "autoScaling": { - "max": 5, - "min": 1 - }, - "labels": { - "label-ky": "label-value" - }, - "nodeDrainTimeoutMinutes": 2, - "platform": { - "enableEncryptionAtHost": false, - "osDisk": { - "diskStorageAccountType": "Premium_LRS", - "sizeGiB": 64 - }, - "vmSize": "large" - }, - "taints": [ - { - "effect": "NoExecute", - "key": "foo.com/key", - "value": "valid" - } - ], - "version": { - "channelGroup": "stable" - } + "id": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/nodePools/node-pool-02", + "location": "fake-location", + "name": "node-pool-02", + "properties": { + "autoRepair": true, + "autoScaling": { + "max": 5, + "min": 1 + }, + "labels": { + "label-ky": "label-value" + }, + "nodeDrainTimeoutMinutes": 2, + "platform": { + "enableEncryptionAtHost": false, + "osDisk": { + "diskStorageAccountType": "Premium_LRS", + "sizeGiB": 64 }, - "serviceProviderProperties": { - "clusterServiceID": "" + "vmSize": "large" + }, + "provisioningState": "Accepted", + "taints": [ + { + "effect": "NoExecute", + "key": "foo.com/key", + "value": "valid" } + ], + "version": { + "channelGroup": "stable" } - } + }, + "serviceProviderProperties": { + "activeOperationId": "4067756a-fcc1-4732-a211-d785d888203c", + "clusterServiceID": "/api/clusters_mgmt/v1/clusters/9p2sk955gj/node_pools/v4lx7rv2r4" + }, + "systemData": { + "createdBy": "Unknown-ARO-HCP-frontend", + "createdByType": "Application", + "lastModifiedBy": "Unknown-ARO-HCP-frontend", + "lastModifiedByType": "Application" + }, + "type": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/nodePools" }, "resourceID": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/nodePools/node-pool-02", "resourceType": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/nodePools" diff --git a/test-integration/frontend/artifacts/FrontendCRUD/Migration/migrate-old-data/99-cosmosCompare-confirm-migration/nodepool-basic-node-pool.json b/test-integration/frontend/artifacts/FrontendCRUD/Migration/migrate-old-data/99-cosmosCompare-confirm-migration/nodepool-basic-node-pool.json index 6a33a0092f6..59e47b3fc94 100644 --- a/test-integration/frontend/artifacts/FrontendCRUD/Migration/migrate-old-data/99-cosmosCompare-confirm-migration/nodepool-basic-node-pool.json +++ b/test-integration/frontend/artifacts/FrontendCRUD/Migration/migrate-old-data/99-cosmosCompare-confirm-migration/nodepool-basic-node-pool.json @@ -10,56 +10,51 @@ "cosmosMetadata": { "resourceID": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/nodePools/basic-node-pool" }, - "intermediateResourceDoc": { - "activeOperationId": "cdfb496e-6e70-4022-9f8d-b0dacf6d2ff5", - "internalId": "/api/clusters_mgmt/v1/clusters/9p2sk955gj/node_pools/59mkgdzg9s", - "provisioningState": "Accepted", - "resourceId": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/nodePools/basic-node-pool", - "systemData": { - "createdBy": "Unknown-ARO-HCP-frontend", - "createdByType": "Application", - "lastModifiedBy": "Unknown-ARO-HCP-frontend", - "lastModifiedByType": "Application" - } - }, - "internalState": { - "internalAPI": { - "location": "fake-location", - "properties": { - "autoRepair": true, - "autoScaling": { - "max": 5, - "min": 1 - }, - "labels": { - "label-ky": "label-value" - }, - "nodeDrainTimeoutMinutes": 2, - "platform": { - "enableEncryptionAtHost": false, - "osDisk": { - "diskStorageAccountType": "Premium_LRS", - "diskType": "Managed", - "sizeGiB": 64 - }, - "vmSize": "large" - }, - "taints": [ - { - "effect": "NoExecute", - "key": "foo.com/key", - "value": "valid" - } - ], - "version": { - "channelGroup": "stable" - } + "id": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/nodePools/basic-node-pool", + "location": "fake-location", + "name": "basic-node-pool", + "properties": { + "autoRepair": true, + "autoScaling": { + "max": 5, + "min": 1 + }, + "labels": { + "label-ky": "label-value" + }, + "nodeDrainTimeoutMinutes": 2, + "platform": { + "enableEncryptionAtHost": false, + "osDisk": { + "diskStorageAccountType": "Premium_LRS", + "diskType": "Managed", + "sizeGiB": 64 }, - "serviceProviderProperties": { - "clusterServiceID": "" + "vmSize": "large" + }, + "provisioningState": "Accepted", + "taints": [ + { + "effect": "NoExecute", + "key": "foo.com/key", + "value": "valid" } + ], + "version": { + "channelGroup": "stable" } - } + }, + "serviceProviderProperties": { + "activeOperationId": "cdfb496e-6e70-4022-9f8d-b0dacf6d2ff5", + "clusterServiceID": "/api/clusters_mgmt/v1/clusters/9p2sk955gj/node_pools/59mkgdzg9s" + }, + "systemData": { + "createdBy": "Unknown-ARO-HCP-frontend", + "createdByType": "Application", + "lastModifiedBy": "Unknown-ARO-HCP-frontend", + "lastModifiedByType": "Application" + }, + "type": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/nodePools" }, "resourceID": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/nodePools/basic-node-pool", "resourceType": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/nodePools" diff --git a/test-integration/frontend/artifacts/FrontendCRUD/Migration/migrate-old-data/99-cosmosCompare-confirm-migration/nodepool-node-pool-02.json b/test-integration/frontend/artifacts/FrontendCRUD/Migration/migrate-old-data/99-cosmosCompare-confirm-migration/nodepool-node-pool-02.json index 6d0c3319335..db57966770a 100644 --- a/test-integration/frontend/artifacts/FrontendCRUD/Migration/migrate-old-data/99-cosmosCompare-confirm-migration/nodepool-node-pool-02.json +++ b/test-integration/frontend/artifacts/FrontendCRUD/Migration/migrate-old-data/99-cosmosCompare-confirm-migration/nodepool-node-pool-02.json @@ -10,56 +10,51 @@ "cosmosMetadata": { "resourceID": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/nodePools/node-pool-02" }, - "intermediateResourceDoc": { - "activeOperationId": "4067756a-fcc1-4732-a211-d785d888203c", - "internalId": "/api/clusters_mgmt/v1/clusters/9p2sk955gj/node_pools/v4lx7rv2r4", - "provisioningState": "Accepted", - "resourceId": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/nodePools/node-pool-02", - "systemData": { - "createdBy": "Unknown-ARO-HCP-frontend", - "createdByType": "Application", - "lastModifiedBy": "Unknown-ARO-HCP-frontend", - "lastModifiedByType": "Application" - } - }, - "internalState": { - "internalAPI": { - "location": "fake-location", - "properties": { - "autoRepair": true, - "autoScaling": { - "max": 5, - "min": 1 - }, - "labels": { - "label-ky": "label-value" - }, - "nodeDrainTimeoutMinutes": 2, - "platform": { - "enableEncryptionAtHost": false, - "osDisk": { - "diskStorageAccountType": "Premium_LRS", - "diskType": "Managed", - "sizeGiB": 64 - }, - "vmSize": "large" - }, - "taints": [ - { - "effect": "NoExecute", - "key": "foo.com/key", - "value": "valid" - } - ], - "version": { - "channelGroup": "stable" - } + "id": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/nodePools/node-pool-02", + "location": "fake-location", + "name": "node-pool-02", + "properties": { + "autoRepair": true, + "autoScaling": { + "max": 5, + "min": 1 + }, + "labels": { + "label-ky": "label-value" + }, + "nodeDrainTimeoutMinutes": 2, + "platform": { + "enableEncryptionAtHost": false, + "osDisk": { + "diskStorageAccountType": "Premium_LRS", + "diskType": "Managed", + "sizeGiB": 64 }, - "serviceProviderProperties": { - "clusterServiceID": "" + "vmSize": "large" + }, + "provisioningState": "Accepted", + "taints": [ + { + "effect": "NoExecute", + "key": "foo.com/key", + "value": "valid" } + ], + "version": { + "channelGroup": "stable" } - } + }, + "serviceProviderProperties": { + "activeOperationId": "4067756a-fcc1-4732-a211-d785d888203c", + "clusterServiceID": "/api/clusters_mgmt/v1/clusters/9p2sk955gj/node_pools/v4lx7rv2r4" + }, + "systemData": { + "createdBy": "Unknown-ARO-HCP-frontend", + "createdByType": "Application", + "lastModifiedBy": "Unknown-ARO-HCP-frontend", + "lastModifiedByType": "Application" + }, + "type": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/nodePools" }, "resourceID": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/nodePools/node-pool-02", "resourceType": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/nodePools" diff --git a/test-integration/frontend/artifacts/FrontendCRUD/Migration/read-new-data/01-load-old-data/nodepool-basic-node-pool.json b/test-integration/frontend/artifacts/FrontendCRUD/Migration/read-new-data/01-load-old-data/nodepool-basic-node-pool.json index ae414a7a65a..058e1f3d1a0 100644 --- a/test-integration/frontend/artifacts/FrontendCRUD/Migration/read-new-data/01-load-old-data/nodepool-basic-node-pool.json +++ b/test-integration/frontend/artifacts/FrontendCRUD/Migration/read-new-data/01-load-old-data/nodepool-basic-node-pool.json @@ -7,55 +7,50 @@ "id": "2b834a28-7e5b-50e2-9fb9-b6679cdd6a1b", "partitionKey": "6b690bec-0c16-4ecb-8f67-781caf40bba7", "properties": { - "intermediateResourceDoc": { - "activeOperationId": "cdfb496e-6e70-4022-9f8d-b0dacf6d2ff5", - "internalId": "/api/clusters_mgmt/v1/clusters/9p2sk955gj/node_pools/59mkgdzg9s", - "provisioningState": "Accepted", - "resourceId": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/nodePools/basic-node-pool", - "systemData": { - "createdBy": "Unknown-ARO-HCP-frontend", - "createdByType": "Application", - "lastModifiedBy": "Unknown-ARO-HCP-frontend", - "lastModifiedByType": "Application" - } - }, - "internalState": { - "internalAPI": { - "location": "fake-location", - "properties": { - "autoRepair": true, - "autoScaling": { - "max": 5, - "min": 1 - }, - "labels": { - "label-ky": "label-value" - }, - "nodeDrainTimeoutMinutes": 2, - "platform": { - "enableEncryptionAtHost": false, - "osDisk": { - "diskStorageAccountType": "Premium_LRS", - "sizeGiB": 64 - }, - "vmSize": "large" - }, - "taints": [ - { - "effect": "NoExecute", - "key": "foo.com/key", - "value": "valid" - } - ], - "version": { - "channelGroup": "stable" - } + "id": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/nodePools/basic-node-pool", + "location": "fake-location", + "name": "basic-node-pool", + "properties": { + "autoRepair": true, + "autoScaling": { + "max": 5, + "min": 1 + }, + "labels": { + "label-ky": "label-value" + }, + "nodeDrainTimeoutMinutes": 2, + "platform": { + "enableEncryptionAtHost": false, + "osDisk": { + "diskStorageAccountType": "Premium_LRS", + "sizeGiB": 64 }, - "serviceProviderProperties": { - "clusterServiceID": "" + "vmSize": "large" + }, + "provisioningState": "Accepted", + "taints": [ + { + "effect": "NoExecute", + "key": "foo.com/key", + "value": "valid" } + ], + "version": { + "channelGroup": "stable" } - } + }, + "serviceProviderProperties": { + "activeOperationId": "cdfb496e-6e70-4022-9f8d-b0dacf6d2ff5", + "clusterServiceID": "/api/clusters_mgmt/v1/clusters/9p2sk955gj/node_pools/59mkgdzg9s" + }, + "systemData": { + "createdBy": "Unknown-ARO-HCP-frontend", + "createdByType": "Application", + "lastModifiedBy": "Unknown-ARO-HCP-frontend", + "lastModifiedByType": "Application" + }, + "type": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/nodePools" }, "resourceID": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/nodePools/basic-node-pool", "resourceType": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/nodePools" diff --git a/test-integration/frontend/artifacts/FrontendCRUD/Migration/read-new-data/01-load-old-data/nodepool-node-pool-02.json b/test-integration/frontend/artifacts/FrontendCRUD/Migration/read-new-data/01-load-old-data/nodepool-node-pool-02.json index 8be207227b0..dbb2c7839c1 100644 --- a/test-integration/frontend/artifacts/FrontendCRUD/Migration/read-new-data/01-load-old-data/nodepool-node-pool-02.json +++ b/test-integration/frontend/artifacts/FrontendCRUD/Migration/read-new-data/01-load-old-data/nodepool-node-pool-02.json @@ -7,55 +7,50 @@ "id": "9b74accf-0661-53d8-9741-b3aa39f9a53c", "partitionKey": "6b690bec-0c16-4ecb-8f67-781caf40bba7", "properties": { - "intermediateResourceDoc": { - "activeOperationId": "4067756a-fcc1-4732-a211-d785d888203c", - "internalId": "/api/clusters_mgmt/v1/clusters/9p2sk955gj/node_pools/v4lx7rv2r4", - "provisioningState": "Accepted", - "resourceId": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/nodePools/node-pool-02", - "systemData": { - "createdBy": "Unknown-ARO-HCP-frontend", - "createdByType": "Application", - "lastModifiedBy": "Unknown-ARO-HCP-frontend", - "lastModifiedByType": "Application" - } - }, - "internalState": { - "internalAPI": { - "location": "fake-location", - "properties": { - "autoRepair": true, - "autoScaling": { - "max": 5, - "min": 1 - }, - "labels": { - "label-ky": "label-value" - }, - "nodeDrainTimeoutMinutes": 2, - "platform": { - "enableEncryptionAtHost": false, - "osDisk": { - "diskStorageAccountType": "Premium_LRS", - "sizeGiB": 64 - }, - "vmSize": "large" - }, - "taints": [ - { - "effect": "NoExecute", - "key": "foo.com/key", - "value": "valid" - } - ], - "version": { - "channelGroup": "stable" - } + "id": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/nodePools/node-pool-02", + "location": "fake-location", + "name": "node-pool-02", + "properties": { + "autoRepair": true, + "autoScaling": { + "max": 5, + "min": 1 + }, + "labels": { + "label-ky": "label-value" + }, + "nodeDrainTimeoutMinutes": 2, + "platform": { + "enableEncryptionAtHost": false, + "osDisk": { + "diskStorageAccountType": "Premium_LRS", + "sizeGiB": 64 }, - "serviceProviderProperties": { - "clusterServiceID": "" + "vmSize": "large" + }, + "provisioningState": "Accepted", + "taints": [ + { + "effect": "NoExecute", + "key": "foo.com/key", + "value": "valid" } + ], + "version": { + "channelGroup": "stable" } - } + }, + "serviceProviderProperties": { + "activeOperationId": "4067756a-fcc1-4732-a211-d785d888203c", + "clusterServiceID": "/api/clusters_mgmt/v1/clusters/9p2sk955gj/node_pools/v4lx7rv2r4" + }, + "systemData": { + "createdBy": "Unknown-ARO-HCP-frontend", + "createdByType": "Application", + "lastModifiedBy": "Unknown-ARO-HCP-frontend", + "lastModifiedByType": "Application" + }, + "type": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/nodePools" }, "resourceID": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/nodePools/node-pool-02", "resourceType": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/nodePools" diff --git a/test-integration/frontend/artifacts/FrontendCRUD/Migration/read-new-data/18-cosmosCompare-confirm/nodepool-basic-node-pool.json b/test-integration/frontend/artifacts/FrontendCRUD/Migration/read-new-data/18-cosmosCompare-confirm/nodepool-basic-node-pool.json index ae414a7a65a..058e1f3d1a0 100644 --- a/test-integration/frontend/artifacts/FrontendCRUD/Migration/read-new-data/18-cosmosCompare-confirm/nodepool-basic-node-pool.json +++ b/test-integration/frontend/artifacts/FrontendCRUD/Migration/read-new-data/18-cosmosCompare-confirm/nodepool-basic-node-pool.json @@ -7,55 +7,50 @@ "id": "2b834a28-7e5b-50e2-9fb9-b6679cdd6a1b", "partitionKey": "6b690bec-0c16-4ecb-8f67-781caf40bba7", "properties": { - "intermediateResourceDoc": { - "activeOperationId": "cdfb496e-6e70-4022-9f8d-b0dacf6d2ff5", - "internalId": "/api/clusters_mgmt/v1/clusters/9p2sk955gj/node_pools/59mkgdzg9s", - "provisioningState": "Accepted", - "resourceId": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/nodePools/basic-node-pool", - "systemData": { - "createdBy": "Unknown-ARO-HCP-frontend", - "createdByType": "Application", - "lastModifiedBy": "Unknown-ARO-HCP-frontend", - "lastModifiedByType": "Application" - } - }, - "internalState": { - "internalAPI": { - "location": "fake-location", - "properties": { - "autoRepair": true, - "autoScaling": { - "max": 5, - "min": 1 - }, - "labels": { - "label-ky": "label-value" - }, - "nodeDrainTimeoutMinutes": 2, - "platform": { - "enableEncryptionAtHost": false, - "osDisk": { - "diskStorageAccountType": "Premium_LRS", - "sizeGiB": 64 - }, - "vmSize": "large" - }, - "taints": [ - { - "effect": "NoExecute", - "key": "foo.com/key", - "value": "valid" - } - ], - "version": { - "channelGroup": "stable" - } + "id": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/nodePools/basic-node-pool", + "location": "fake-location", + "name": "basic-node-pool", + "properties": { + "autoRepair": true, + "autoScaling": { + "max": 5, + "min": 1 + }, + "labels": { + "label-ky": "label-value" + }, + "nodeDrainTimeoutMinutes": 2, + "platform": { + "enableEncryptionAtHost": false, + "osDisk": { + "diskStorageAccountType": "Premium_LRS", + "sizeGiB": 64 }, - "serviceProviderProperties": { - "clusterServiceID": "" + "vmSize": "large" + }, + "provisioningState": "Accepted", + "taints": [ + { + "effect": "NoExecute", + "key": "foo.com/key", + "value": "valid" } + ], + "version": { + "channelGroup": "stable" } - } + }, + "serviceProviderProperties": { + "activeOperationId": "cdfb496e-6e70-4022-9f8d-b0dacf6d2ff5", + "clusterServiceID": "/api/clusters_mgmt/v1/clusters/9p2sk955gj/node_pools/59mkgdzg9s" + }, + "systemData": { + "createdBy": "Unknown-ARO-HCP-frontend", + "createdByType": "Application", + "lastModifiedBy": "Unknown-ARO-HCP-frontend", + "lastModifiedByType": "Application" + }, + "type": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/nodePools" }, "resourceID": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/nodePools/basic-node-pool", "resourceType": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/nodePools" diff --git a/test-integration/frontend/artifacts/FrontendCRUD/Migration/read-new-data/18-cosmosCompare-confirm/nodepool-node-pool-02.json b/test-integration/frontend/artifacts/FrontendCRUD/Migration/read-new-data/18-cosmosCompare-confirm/nodepool-node-pool-02.json index 5a743b89303..0bd3b967259 100644 --- a/test-integration/frontend/artifacts/FrontendCRUD/Migration/read-new-data/18-cosmosCompare-confirm/nodepool-node-pool-02.json +++ b/test-integration/frontend/artifacts/FrontendCRUD/Migration/read-new-data/18-cosmosCompare-confirm/nodepool-node-pool-02.json @@ -6,55 +6,50 @@ "cosmosMetadata": { "resourceID": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/nodePools/node-pool-02" }, - "intermediateResourceDoc": { - "internalId": "/api/clusters_mgmt/v1/clusters/9p2sk955gj/node_pools/v4lx7rv2r4", - "provisioningState": "Succeeded", - "resourceId": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/nodePools/node-pool-02", - "systemData": { - "createdBy": "Unknown-ARO-HCP-frontend", - "createdByType": "Application", - "lastModifiedBy": "Unknown-ARO-HCP-frontend", - "lastModifiedByType": "Application" - } - }, - "internalState": { - "internalAPI": { - "location": "fake-location", - "properties": { - "autoRepair": true, - "autoScaling": { - "max": 5, - "min": 1 - }, - "labels": { - "label-ky": "label-value" - }, - "nodeDrainTimeoutMinutes": 2, - "platform": { - "enableEncryptionAtHost": false, - "osDisk": { - "diskStorageAccountType": "Premium_LRS", - "diskType": "Managed", - "sizeGiB": 64 - }, - "vmSize": "large" - }, - "taints": [ - { - "effect": "NoExecute", - "key": "foo.com/key", - "value": "valid" - } - ], - "version": { - "channelGroup": "stable" - } + "id": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/nodePools/node-pool-02", + "location": "fake-location", + "name": "node-pool-02", + "properties": { + "autoRepair": true, + "autoScaling": { + "max": 5, + "min": 1 + }, + "labels": { + "label-ky": "label-value" + }, + "nodeDrainTimeoutMinutes": 2, + "platform": { + "enableEncryptionAtHost": false, + "osDisk": { + "diskStorageAccountType": "Premium_LRS", + "diskType": "Managed", + "sizeGiB": 64 }, - "serviceProviderProperties": { - "clusterServiceID": "" + "vmSize": "large" + }, + "provisioningState": "Succeeded", + "taints": [ + { + "effect": "NoExecute", + "key": "foo.com/key", + "value": "valid" } + ], + "version": { + "channelGroup": "stable" } - } + }, + "serviceProviderProperties": { + "clusterServiceID": "/api/clusters_mgmt/v1/clusters/9p2sk955gj/node_pools/v4lx7rv2r4" + }, + "systemData": { + "createdBy": "Unknown-ARO-HCP-frontend", + "createdByType": "Application", + "lastModifiedBy": "Unknown-ARO-HCP-frontend", + "lastModifiedByType": "Application" + }, + "type": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/nodePools" }, "resourceID": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/nodePools/node-pool-02", "resourceType": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/nodePools" diff --git a/test-integration/frontend/artifacts/FrontendCRUD/NodePool/create-current/06-cosmosCompare-confirm-content/nodepool-basic-node-pool.json b/test-integration/frontend/artifacts/FrontendCRUD/NodePool/create-current/06-cosmosCompare-confirm-content/nodepool-basic-node-pool.json index 0cd1c299412..34689da6f0e 100644 --- a/test-integration/frontend/artifacts/FrontendCRUD/NodePool/create-current/06-cosmosCompare-confirm-content/nodepool-basic-node-pool.json +++ b/test-integration/frontend/artifacts/FrontendCRUD/NodePool/create-current/06-cosmosCompare-confirm-content/nodepool-basic-node-pool.json @@ -10,58 +10,53 @@ "cosmosMetadata": { "resourceID": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/nodePools/basic-node-pool" }, - "intermediateResourceDoc": { - "activeOperationId": "bf643e76-55fe-48a0-a752-f5c5a2db72ad", - "internalId": "/api/clusters_mgmt/v1/clusters/dl7f9px2f2/node_pools/82npf9hxmk", - "provisioningState": "Accepted", - "resourceId": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/nodePools/basic-node-pool", - "systemData": { - "createdBy": "Unknown-ARO-HCP-frontend", - "createdByType": "Application", - "lastModifiedBy": "Unknown-ARO-HCP-frontend", - "lastModifiedByType": "Application" - } - }, - "internalState": { - "internalAPI": { - "location": "fake-location", - "properties": { - "autoRepair": true, - "autoScaling": { - "max": 5, - "min": 1 - }, - "labels": { - "label-ky": "label-value" - }, - "nodeDrainTimeoutMinutes": 2, - "platform": { - "enableEncryptionAtHost": false, - "osDisk": { - "diskStorageAccountType": "Premium_LRS", - "diskType": "Managed", - "sizeGiB": 64 - }, - "subnetId": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/bar/providers/Microsoft.Network/virtualNetworks/vnet/subnets/subnet", - "vmSize": "large" - }, - "taints": [ - { - "effect": "NoExecute", - "key": "foo.com/key", - "value": "valid" - } - ], - "version": { - "channelGroup": "stable", - "id": "4.20.8" - } + "id": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/nodePools/basic-node-pool", + "location": "fake-location", + "name": "basic-node-pool", + "properties": { + "autoRepair": true, + "autoScaling": { + "max": 5, + "min": 1 + }, + "labels": { + "label-ky": "label-value" + }, + "nodeDrainTimeoutMinutes": 2, + "platform": { + "enableEncryptionAtHost": false, + "osDisk": { + "diskStorageAccountType": "Premium_LRS", + "diskType": "Managed", + "sizeGiB": 64 }, - "serviceProviderProperties": { - "clusterServiceID": "" + "subnetId": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/bar/providers/Microsoft.Network/virtualNetworks/vnet/subnets/subnet", + "vmSize": "large" + }, + "provisioningState": "Accepted", + "taints": [ + { + "effect": "NoExecute", + "key": "foo.com/key", + "value": "valid" } + ], + "version": { + "channelGroup": "stable", + "id": "4.20.8" } - } + }, + "serviceProviderProperties": { + "activeOperationId": "bf643e76-55fe-48a0-a752-f5c5a2db72ad", + "clusterServiceID": "/api/clusters_mgmt/v1/clusters/dl7f9px2f2/node_pools/82npf9hxmk" + }, + "systemData": { + "createdBy": "Unknown-ARO-HCP-frontend", + "createdByType": "Application", + "lastModifiedBy": "Unknown-ARO-HCP-frontend", + "lastModifiedByType": "Application" + }, + "type": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/nodePools" }, "resourceID": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/nodePools/basic-node-pool", "resourceType": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/nodePools" diff --git a/test-integration/frontend/artifacts/FrontendCRUD/NodePool/create-current/06-cosmosCompare-confirm-content/nodepool-node-pool-02.json b/test-integration/frontend/artifacts/FrontendCRUD/NodePool/create-current/06-cosmosCompare-confirm-content/nodepool-node-pool-02.json index f760e9d42ad..59c142a27f5 100644 --- a/test-integration/frontend/artifacts/FrontendCRUD/NodePool/create-current/06-cosmosCompare-confirm-content/nodepool-node-pool-02.json +++ b/test-integration/frontend/artifacts/FrontendCRUD/NodePool/create-current/06-cosmosCompare-confirm-content/nodepool-node-pool-02.json @@ -10,58 +10,53 @@ "cosmosMetadata": { "resourceID": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/nodePools/node-pool-02" }, - "intermediateResourceDoc": { - "activeOperationId": "25e4713b-44b5-4799-9e60-894a132c6674", - "internalId": "/api/clusters_mgmt/v1/clusters/dl7f9px2f2/node_pools/5zdc9grtvf", - "provisioningState": "Accepted", - "resourceId": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/nodePools/node-pool-02", - "systemData": { - "createdBy": "Unknown-ARO-HCP-frontend", - "createdByType": "Application", - "lastModifiedBy": "Unknown-ARO-HCP-frontend", - "lastModifiedByType": "Application" - } - }, - "internalState": { - "internalAPI": { - "location": "fake-location", - "properties": { - "autoRepair": true, - "autoScaling": { - "max": 5, - "min": 1 - }, - "labels": { - "label-ky": "label-value" - }, - "nodeDrainTimeoutMinutes": 2, - "platform": { - "enableEncryptionAtHost": false, - "osDisk": { - "diskStorageAccountType": "Premium_LRS", - "diskType": "Managed", - "sizeGiB": 64 - }, - "subnetId": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/bar/providers/Microsoft.Network/virtualNetworks/vnet/subnets/subnet", - "vmSize": "large" - }, - "taints": [ - { - "effect": "NoExecute", - "key": "foo.com/key", - "value": "valid" - } - ], - "version": { - "channelGroup": "stable", - "id": "4.20.8" - } + "id": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/nodePools/node-pool-02", + "location": "fake-location", + "name": "node-pool-02", + "properties": { + "autoRepair": true, + "autoScaling": { + "max": 5, + "min": 1 + }, + "labels": { + "label-ky": "label-value" + }, + "nodeDrainTimeoutMinutes": 2, + "platform": { + "enableEncryptionAtHost": false, + "osDisk": { + "diskStorageAccountType": "Premium_LRS", + "diskType": "Managed", + "sizeGiB": 64 }, - "serviceProviderProperties": { - "clusterServiceID": "" + "subnetId": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/bar/providers/Microsoft.Network/virtualNetworks/vnet/subnets/subnet", + "vmSize": "large" + }, + "provisioningState": "Accepted", + "taints": [ + { + "effect": "NoExecute", + "key": "foo.com/key", + "value": "valid" } + ], + "version": { + "channelGroup": "stable", + "id": "4.20.8" } - } + }, + "serviceProviderProperties": { + "activeOperationId": "25e4713b-44b5-4799-9e60-894a132c6674", + "clusterServiceID": "/api/clusters_mgmt/v1/clusters/dl7f9px2f2/node_pools/5zdc9grtvf" + }, + "systemData": { + "createdBy": "Unknown-ARO-HCP-frontend", + "createdByType": "Application", + "lastModifiedBy": "Unknown-ARO-HCP-frontend", + "lastModifiedByType": "Application" + }, + "type": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/nodePools" }, "resourceID": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/nodePools/node-pool-02", "resourceType": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/nodePools" diff --git a/test-integration/frontend/artifacts/FrontendCRUD/NodePool/read-old-data/01-load-old-data/nodepool-basic-node-pool.json b/test-integration/frontend/artifacts/FrontendCRUD/NodePool/read-old-data/01-load-old-data/nodepool-basic-node-pool.json index ae414a7a65a..058e1f3d1a0 100644 --- a/test-integration/frontend/artifacts/FrontendCRUD/NodePool/read-old-data/01-load-old-data/nodepool-basic-node-pool.json +++ b/test-integration/frontend/artifacts/FrontendCRUD/NodePool/read-old-data/01-load-old-data/nodepool-basic-node-pool.json @@ -7,55 +7,50 @@ "id": "2b834a28-7e5b-50e2-9fb9-b6679cdd6a1b", "partitionKey": "6b690bec-0c16-4ecb-8f67-781caf40bba7", "properties": { - "intermediateResourceDoc": { - "activeOperationId": "cdfb496e-6e70-4022-9f8d-b0dacf6d2ff5", - "internalId": "/api/clusters_mgmt/v1/clusters/9p2sk955gj/node_pools/59mkgdzg9s", - "provisioningState": "Accepted", - "resourceId": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/nodePools/basic-node-pool", - "systemData": { - "createdBy": "Unknown-ARO-HCP-frontend", - "createdByType": "Application", - "lastModifiedBy": "Unknown-ARO-HCP-frontend", - "lastModifiedByType": "Application" - } - }, - "internalState": { - "internalAPI": { - "location": "fake-location", - "properties": { - "autoRepair": true, - "autoScaling": { - "max": 5, - "min": 1 - }, - "labels": { - "label-ky": "label-value" - }, - "nodeDrainTimeoutMinutes": 2, - "platform": { - "enableEncryptionAtHost": false, - "osDisk": { - "diskStorageAccountType": "Premium_LRS", - "sizeGiB": 64 - }, - "vmSize": "large" - }, - "taints": [ - { - "effect": "NoExecute", - "key": "foo.com/key", - "value": "valid" - } - ], - "version": { - "channelGroup": "stable" - } + "id": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/nodePools/basic-node-pool", + "location": "fake-location", + "name": "basic-node-pool", + "properties": { + "autoRepair": true, + "autoScaling": { + "max": 5, + "min": 1 + }, + "labels": { + "label-ky": "label-value" + }, + "nodeDrainTimeoutMinutes": 2, + "platform": { + "enableEncryptionAtHost": false, + "osDisk": { + "diskStorageAccountType": "Premium_LRS", + "sizeGiB": 64 }, - "serviceProviderProperties": { - "clusterServiceID": "" + "vmSize": "large" + }, + "provisioningState": "Accepted", + "taints": [ + { + "effect": "NoExecute", + "key": "foo.com/key", + "value": "valid" } + ], + "version": { + "channelGroup": "stable" } - } + }, + "serviceProviderProperties": { + "activeOperationId": "cdfb496e-6e70-4022-9f8d-b0dacf6d2ff5", + "clusterServiceID": "/api/clusters_mgmt/v1/clusters/9p2sk955gj/node_pools/59mkgdzg9s" + }, + "systemData": { + "createdBy": "Unknown-ARO-HCP-frontend", + "createdByType": "Application", + "lastModifiedBy": "Unknown-ARO-HCP-frontend", + "lastModifiedByType": "Application" + }, + "type": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/nodePools" }, "resourceID": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/nodePools/basic-node-pool", "resourceType": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/nodePools" diff --git a/test-integration/frontend/artifacts/FrontendCRUD/NodePool/read-old-data/01-load-old-data/nodepool-node-pool-02.json b/test-integration/frontend/artifacts/FrontendCRUD/NodePool/read-old-data/01-load-old-data/nodepool-node-pool-02.json index 8be207227b0..dbb2c7839c1 100644 --- a/test-integration/frontend/artifacts/FrontendCRUD/NodePool/read-old-data/01-load-old-data/nodepool-node-pool-02.json +++ b/test-integration/frontend/artifacts/FrontendCRUD/NodePool/read-old-data/01-load-old-data/nodepool-node-pool-02.json @@ -7,55 +7,50 @@ "id": "9b74accf-0661-53d8-9741-b3aa39f9a53c", "partitionKey": "6b690bec-0c16-4ecb-8f67-781caf40bba7", "properties": { - "intermediateResourceDoc": { - "activeOperationId": "4067756a-fcc1-4732-a211-d785d888203c", - "internalId": "/api/clusters_mgmt/v1/clusters/9p2sk955gj/node_pools/v4lx7rv2r4", - "provisioningState": "Accepted", - "resourceId": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/nodePools/node-pool-02", - "systemData": { - "createdBy": "Unknown-ARO-HCP-frontend", - "createdByType": "Application", - "lastModifiedBy": "Unknown-ARO-HCP-frontend", - "lastModifiedByType": "Application" - } - }, - "internalState": { - "internalAPI": { - "location": "fake-location", - "properties": { - "autoRepair": true, - "autoScaling": { - "max": 5, - "min": 1 - }, - "labels": { - "label-ky": "label-value" - }, - "nodeDrainTimeoutMinutes": 2, - "platform": { - "enableEncryptionAtHost": false, - "osDisk": { - "diskStorageAccountType": "Premium_LRS", - "sizeGiB": 64 - }, - "vmSize": "large" - }, - "taints": [ - { - "effect": "NoExecute", - "key": "foo.com/key", - "value": "valid" - } - ], - "version": { - "channelGroup": "stable" - } + "id": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/nodePools/node-pool-02", + "location": "fake-location", + "name": "node-pool-02", + "properties": { + "autoRepair": true, + "autoScaling": { + "max": 5, + "min": 1 + }, + "labels": { + "label-ky": "label-value" + }, + "nodeDrainTimeoutMinutes": 2, + "platform": { + "enableEncryptionAtHost": false, + "osDisk": { + "diskStorageAccountType": "Premium_LRS", + "sizeGiB": 64 }, - "serviceProviderProperties": { - "clusterServiceID": "" + "vmSize": "large" + }, + "provisioningState": "Accepted", + "taints": [ + { + "effect": "NoExecute", + "key": "foo.com/key", + "value": "valid" } + ], + "version": { + "channelGroup": "stable" } - } + }, + "serviceProviderProperties": { + "activeOperationId": "4067756a-fcc1-4732-a211-d785d888203c", + "clusterServiceID": "/api/clusters_mgmt/v1/clusters/9p2sk955gj/node_pools/v4lx7rv2r4" + }, + "systemData": { + "createdBy": "Unknown-ARO-HCP-frontend", + "createdByType": "Application", + "lastModifiedBy": "Unknown-ARO-HCP-frontend", + "lastModifiedByType": "Application" + }, + "type": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/nodePools" }, "resourceID": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/nodePools/node-pool-02", "resourceType": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/nodePools" diff --git a/test-integration/frontend/artifacts/FrontendCRUD/NodePool/read-old-data/09-cosmosCompare-confirm-update/nodepool-02.json b/test-integration/frontend/artifacts/FrontendCRUD/NodePool/read-old-data/09-cosmosCompare-confirm-update/nodepool-02.json index 29619708433..645c7087a70 100644 --- a/test-integration/frontend/artifacts/FrontendCRUD/NodePool/read-old-data/09-cosmosCompare-confirm-update/nodepool-02.json +++ b/test-integration/frontend/artifacts/FrontendCRUD/NodePool/read-old-data/09-cosmosCompare-confirm-update/nodepool-02.json @@ -7,55 +7,50 @@ "id": "9b74accf-0661-53d8-9741-b3aa39f9a53c", "partitionKey": "6b690bec-0c16-4ecb-8f67-781caf40bba7", "properties": { - "intermediateResourceDoc": { - "activeOperationId": "4067756a-fcc1-4732-a211-d785d888203c", - "internalId": "/api/clusters_mgmt/v1/clusters/9p2sk955gj/node_pools/v4lx7rv2r4", - "provisioningState": "Accepted", - "resourceId": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/nodePools/node-pool-02", - "systemData": { - "createdBy": "Unknown-ARO-HCP-frontend", - "createdByType": "Application", - "lastModifiedBy": "Unknown-ARO-HCP-frontend", - "lastModifiedByType": "Application" - } - }, - "internalState": { - "internalAPI": { - "location": "fake-location", - "properties": { - "autoRepair": true, - "autoScaling": { - "max": 5, - "min": 1 - }, - "labels": { - "label-ky": "label-value" - }, - "nodeDrainTimeoutMinutes": 2, - "platform": { - "enableEncryptionAtHost": false, - "osDisk": { - "diskStorageAccountType": "Premium_LRS", - "sizeGiB": 64 - }, - "vmSize": "large" - }, - "taints": [ - { - "effect": "NoExecute", - "key": "foo.com/key", - "value": "valid" - } - ], - "version": { - "channelGroup": "stable" - } + "id": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/nodePools/node-pool-02", + "location": "fake-location", + "name": "node-pool-02", + "properties": { + "autoRepair": true, + "autoScaling": { + "max": 5, + "min": 1 + }, + "labels": { + "label-ky": "label-value" + }, + "nodeDrainTimeoutMinutes": 2, + "platform": { + "enableEncryptionAtHost": false, + "osDisk": { + "diskStorageAccountType": "Premium_LRS", + "sizeGiB": 64 }, - "serviceProviderProperties": { - "clusterServiceID": "" + "vmSize": "large" + }, + "provisioningState": "Accepted", + "taints": [ + { + "effect": "NoExecute", + "key": "foo.com/key", + "value": "valid" } + ], + "version": { + "channelGroup": "stable" } - } + }, + "serviceProviderProperties": { + "activeOperationId": "4067756a-fcc1-4732-a211-d785d888203c", + "clusterServiceID": "/api/clusters_mgmt/v1/clusters/9p2sk955gj/node_pools/v4lx7rv2r4" + }, + "systemData": { + "createdBy": "Unknown-ARO-HCP-frontend", + "createdByType": "Application", + "lastModifiedBy": "Unknown-ARO-HCP-frontend", + "lastModifiedByType": "Application" + }, + "type": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/nodePools" }, "resourceID": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/nodePools/node-pool-02", "resourceType": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/nodePools" diff --git a/test-integration/frontend/artifacts/FrontendCRUD/NodePool/read-old-data/09-cosmosCompare-confirm-update/nodepool-basic-node-pool.json b/test-integration/frontend/artifacts/FrontendCRUD/NodePool/read-old-data/09-cosmosCompare-confirm-update/nodepool-basic-node-pool.json index d5e4d6f942a..7dfe3005490 100644 --- a/test-integration/frontend/artifacts/FrontendCRUD/NodePool/read-old-data/09-cosmosCompare-confirm-update/nodepool-basic-node-pool.json +++ b/test-integration/frontend/artifacts/FrontendCRUD/NodePool/read-old-data/09-cosmosCompare-confirm-update/nodepool-basic-node-pool.json @@ -10,56 +10,51 @@ "cosmosMetadata": { "resourceID": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/nodePools/basic-node-pool" }, - "intermediateResourceDoc": { - "activeOperationId": "9e244879-591b-4693-823a-4412b4200f4d", - "internalId": "/api/clusters_mgmt/v1/clusters/9p2sk955gj/node_pools/59mkgdzg9s", - "provisioningState": "Accepted", - "resourceId": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/nodePools/basic-node-pool", - "systemData": { - "createdBy": "Unknown-ARO-HCP-frontend", - "createdByType": "Application", - "lastModifiedBy": "Unknown-ARO-HCP-frontend", - "lastModifiedByType": "Application" - } - }, - "internalState": { - "internalAPI": { - "location": "fake-location", - "properties": { - "autoRepair": true, - "autoScaling": { - "max": 5, - "min": 1 - }, - "labels": { - "label-ky": "label-value" - }, - "nodeDrainTimeoutMinutes": 2, - "platform": { - "enableEncryptionAtHost": false, - "osDisk": { - "diskStorageAccountType": "Premium_LRS", - "diskType": "Managed", - "sizeGiB": 64 - }, - "vmSize": "large" - }, - "taints": [ - { - "effect": "NoExecute", - "key": "foo.com/key", - "value": "other" - } - ], - "version": { - "channelGroup": "stable" - } + "id": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/nodePools/basic-node-pool", + "location": "fake-location", + "name": "basic-node-pool", + "properties": { + "autoRepair": true, + "autoScaling": { + "max": 5, + "min": 1 + }, + "labels": { + "label-ky": "label-value" + }, + "nodeDrainTimeoutMinutes": 2, + "platform": { + "enableEncryptionAtHost": false, + "osDisk": { + "diskStorageAccountType": "Premium_LRS", + "diskType": "Managed", + "sizeGiB": 64 }, - "serviceProviderProperties": { - "clusterServiceID": "" + "vmSize": "large" + }, + "provisioningState": "Accepted", + "taints": [ + { + "effect": "NoExecute", + "key": "foo.com/key", + "value": "other" } + ], + "version": { + "channelGroup": "stable" } - } + }, + "serviceProviderProperties": { + "activeOperationId": "9e244879-591b-4693-823a-4412b4200f4d", + "clusterServiceID": "/api/clusters_mgmt/v1/clusters/9p2sk955gj/node_pools/59mkgdzg9s" + }, + "systemData": { + "createdBy": "Unknown-ARO-HCP-frontend", + "createdByType": "Application", + "lastModifiedBy": "Unknown-ARO-HCP-frontend", + "lastModifiedByType": "Application" + }, + "type": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/nodePools" }, "resourceID": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/nodePools/basic-node-pool", "resourceType": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/nodePools" diff --git a/test-integration/frontend/informer_test.go b/test-integration/frontend/informer_test.go index 47433454dba..daa0817a62b 100644 --- a/test-integration/frontend/informer_test.go +++ b/test-integration/frontend/informer_test.go @@ -457,6 +457,7 @@ func nodePoolInformerIntegrationTestCase() informerIntegrationTestCase { internalID, err := api.NewInternalID("/api/clusters_mgmt/v1/clusters/" + clusterName) require.NoError(t, err) return &api.HCPOpenShiftClusterNodePool{ + CosmosMetadata: arm.CosmosMetadata{ResourceID: npResourceID}, TrackedResource: arm.TrackedResource{ Resource: arm.Resource{ ID: npResourceID, diff --git a/test-integration/utils/databasemutationhelpers/per_resource_comparer.go b/test-integration/utils/databasemutationhelpers/per_resource_comparer.go index a4cda450c59..7e89c0b373d 100644 --- a/test-integration/utils/databasemutationhelpers/per_resource_comparer.go +++ b/test-integration/utils/databasemutationhelpers/per_resource_comparer.go @@ -120,6 +120,7 @@ func ResourceInstanceEquals(t *testing.T, expected, actual any) (string, bool) { unstructured.RemoveNestedField(currMap, prepend(possiblePrepend, "internalState", "internalAPI", "serviceProviderProperties", "clusterServiceID")...) // cluster - randomly generated by cluster-service mock unstructured.RemoveNestedField(currMap, prepend(possiblePrepend, "internalState", "internalAPI", "systemData", "createdAt")...) // cluster - varies on every run unstructured.RemoveNestedField(currMap, prepend(possiblePrepend, "internalState", "internalAPI", "systemData", "lastModifiedAt")...) // cluster - varies on every run + unstructured.RemoveNestedField(currMap, prepend(possiblePrepend, "internalState", "internalAPI", "cosmosMetadata")...) // cluster, nodepool - redundant copy of inline cosmosMetadata unstructured.RemoveNestedField(currMap, prepend(possiblePrepend, "cosmosMetadata", "etag")...) // inline serialization on cluster also exposes these UUID-generated / variable fields directly under properties