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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions backend/pkg/informers/informers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions backend/pkg/listertesting/slice_listers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
8 changes: 6 additions & 2 deletions frontend/pkg/frontend/node_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions internal/admission/admit_cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down
19 changes: 2 additions & 17 deletions internal/api/types_nodepool.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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 {
Expand All @@ -68,7 +54,6 @@ type HCPOpenShiftClusterNodePoolProperties struct {
}

type HCPOpenShiftClusterNodePoolServiceProviderProperties struct {
ExistingCosmosUID string `json:"-"`
ClusterServiceID InternalID `json:"clusterServiceID,omitempty"`
ActiveOperationID string `json:"activeOperationId,omitempty"`
}
Expand Down
9 changes: 8 additions & 1 deletion internal/api/v20240610preview/conversion_fuzz_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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)
Expand Down
5 changes: 3 additions & 2 deletions internal/api/v20240610preview/nodepools_methods.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
}

Comment on lines 312 to 316
out := &NodePool{
Expand Down
1 change: 1 addition & 0 deletions internal/api/v20240610preview/nodepools_methods_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"))),
Expand Down
9 changes: 8 additions & 1 deletion internal/api/v20251223preview/conversion_fuzz_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
5 changes: 3 additions & 2 deletions internal/api/v20251223preview/nodepools_methods.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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{
Expand Down
1 change: 1 addition & 0 deletions internal/api/v20251223preview/nodepools_methods_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"))),
Expand Down
1 change: 1 addition & 0 deletions internal/api/v20251223preview/zero_value_roundtrip_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"))),
Expand Down
Loading
Loading