From 29e870d2f2b266feabfa408102b50710425c6a07 Mon Sep 17 00:00:00 2001 From: David Eads Date: Mon, 11 May 2026 10:57:20 -0400 Subject: [PATCH 1/3] add genericdocument compatible serialization of externalauths Co-Authored-By: Claude Opus 4.7 (1M context) --- internal/database/convert_externalauth.go | 14 +--- internal/database/types_externalauth.go | 8 +- .../externalauth-default.json | 73 ++++++++++++++++++- .../externalauth-default.json | 73 ++++++++++++++++++- .../externalauth-default.json | 73 ++++++++++++++++++- .../externalauth-default.json | 73 ++++++++++++++++++- .../externalauth-default.json | 73 ++++++++++++++++++- .../externalauth-default.json | 73 ++++++++++++++++++- .../externalauth-default.json | 73 ++++++++++++++++++- .../externalauth-default.json | 73 ++++++++++++++++++- .../externalauth-default.json | 73 ++++++++++++++++++- .../externalauth-default.json | 73 ++++++++++++++++++- .../externalauth-default.json | 73 ++++++++++++++++++- .../externalauth-default.json | 73 ++++++++++++++++++- .../externalauth-default.json | 73 ++++++++++++++++++- .../per_resource_comparer.go | 16 ++-- 16 files changed, 927 insertions(+), 60 deletions(-) diff --git a/internal/database/convert_externalauth.go b/internal/database/convert_externalauth.go index 1517ec541f6..7e95683e76e 100644 --- a/internal/database/convert_externalauth.go +++ b/internal/database/convert_externalauth.go @@ -22,7 +22,6 @@ import ( "github.com/Azure/ARO-HCP/internal/api" "github.com/Azure/ARO-HCP/internal/api/arm" - "github.com/Azure/ARO-HCP/internal/ocm" ) func InternalToCosmosExternalAuth(internalObj *api.HCPOpenShiftClusterExternalAuth) (*ExternalAuth, error) { @@ -40,6 +39,7 @@ func InternalToCosmosExternalAuth(internalObj *api.HCPOpenShiftClusterExternalAu ResourceType: internalObj.ID.ResourceType.String(), }, ExternalAuthProperties: ExternalAuthProperties{ + HCPOpenShiftClusterExternalAuth: *internalObj, CosmosMetadata: api.CosmosMetadata{ ResourceID: internalObj.ID, }, @@ -59,16 +59,6 @@ func InternalToCosmosExternalAuth(internalObj *api.HCPOpenShiftClusterExternalAu }, } - // some pieces of data in the internalExternalAuth conflict with ResourceDocument fields. We may evolve over time, but for - // now avoid persisting those. - cosmosObj.InternalState.InternalAPI.ProxyResource = arm.ProxyResource{} - cosmosObj.InternalState.InternalAPI.Properties.ProvisioningState = "" - cosmosObj.InternalState.InternalAPI.SystemData = nil - // we do this to keep serialization the same so that we can go to n-1 where this field isn't a pointer. - // on the reading side, we handle the pointer as expected. - cosmosObj.InternalState.InternalAPI.ServiceProviderProperties.ClusterServiceID = &ocm.InternalID{} - cosmosObj.InternalState.InternalAPI.ServiceProviderProperties.ActiveOperationID = "" - return cosmosObj, nil } @@ -96,7 +86,7 @@ func CosmosToInternalExternalAuth(cosmosObj *ExternalAuth) (*api.HCPOpenShiftClu // 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 // HCPOpenShiftClusterExternalAuth. - internalObj.CosmosETag = cosmosObj.CosmosETag + internalObj.CosmosETag = cosmosObj.BaseDocument.CosmosETag internalObj.Properties.ProvisioningState = resourceDoc.ProvisioningState internalObj.SystemData = resourceDoc.SystemData internalObj.ServiceProviderProperties.ExistingCosmosUID = cosmosObj.ID diff --git a/internal/database/types_externalauth.go b/internal/database/types_externalauth.go index 99ae661b0ee..acda4f2338a 100644 --- a/internal/database/types_externalauth.go +++ b/internal/database/types_externalauth.go @@ -25,8 +25,14 @@ type ExternalAuth struct { } type ExternalAuthProperties struct { + // HCPOpenShiftClusterExternalAuth is where we're migrating to. It is compatible with a GenericDocument[api.HCPOpenShiftClusterExternalAuth] + // which is where we want to end up. + // * to be compatible with prior versions, we must continue writing all previous fields and this new field + // * to be compatible with prior versions, we must continue reading only from previous fields + api.HCPOpenShiftClusterExternalAuth `json:",inline"` + // 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 + // queries to select on cosmosMetadata.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 diff --git a/test-integration/backend/controllers/mismatches/artifacts/cluster/remove_orphaned_cluster_descendents/00-load-initial-state/externalauth-default.json b/test-integration/backend/controllers/mismatches/artifacts/cluster/remove_orphaned_cluster_descendents/00-load-initial-state/externalauth-default.json index 2028d2455f5..afced65a6d4 100644 --- a/test-integration/backend/controllers/mismatches/artifacts/cluster/remove_orphaned_cluster_descendents/00-load-initial-state/externalauth-default.json +++ b/test-integration/backend/controllers/mismatches/artifacts/cluster/remove_orphaned_cluster_descendents/00-load-initial-state/externalauth-default.json @@ -7,6 +7,7 @@ "id": "9a361107-eb97-5b1b-bc2e-b9cfa961b5bc", "partitionKey": "a433a095-1277-44f1-8453-8d61a4d848c2", "properties": { + "id": "/subscriptions/a433a095-1277-44f1-8453-8d61a4d848c2/resourceGroups/unimportantpostponement/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/monstrousprecinct/externalAuths/default", "intermediateResourceDoc": { "activeOperationId": "ea807c13-7e15-43d4-b760-69ef7e31d273", "internalId": "/api/clusters_mgmt/v1/clusters/swzpxg6nxn/external_auth_config/external_auths/5fghjjqxvd", @@ -21,6 +22,8 @@ }, "internalState": { "internalAPI": { + "id": "/subscriptions/a433a095-1277-44f1-8453-8d61a4d848c2/resourceGroups/unimportantpostponement/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/monstrousprecinct/externalAuths/default", + "name": "default", "properties": { "claim": { "mappings": { @@ -63,13 +66,77 @@ "ca": "", "url": "https://login.microsoftonline.com/12345678-1234-1234-1234-123456789abc/v2.0" }, - "provisioningState": "" + "provisioningState": "Accepted" }, "serviceProviderProperties": { + "activeOperationId": "ea807c13-7e15-43d4-b760-69ef7e31d273", "clusterServiceID": "" - } + }, + "systemData": { + "createdBy": "Unknown-ARO-HCP-frontend", + "createdByType": "Application", + "lastModifiedBy": "Unknown-ARO-HCP-frontend", + "lastModifiedByType": "Application" + }, + "type": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/externalAuths" } - } + }, + "name": "default", + "properties": { + "claim": { + "mappings": { + "groups": { + "claim": "groups", + "prefix": "" + }, + "username": { + "claim": "sub", + "prefix": "prefix-", + "prefixPolicy": "Prefix" + } + }, + "validationRules": [] + }, + "clients": [ + { + "clientId": "87654321-4321-4321-4321-abcdefghijkl", + "component": { + "authClientNamespace": "openshift-console", + "name": "console" + }, + "extraScopes": [], + "type": "Confidential" + }, + { + "clientId": "87654321-4321-4321-4321-abcdefghijkl", + "component": { + "authClientNamespace": "openshift-console", + "name": "cli" + }, + "extraScopes": [], + "type": "Public" + } + ], + "issuer": { + "audiences": [ + "87654321-4321-4321-4321-abcdefghijkl" + ], + "ca": "", + "url": "https://login.microsoftonline.com/12345678-1234-1234-1234-123456789abc/v2.0" + }, + "provisioningState": "Accepted" + }, + "serviceProviderProperties": { + "activeOperationId": "ea807c13-7e15-43d4-b760-69ef7e31d273", + "clusterServiceID": "/api/clusters_mgmt/v1/clusters/swzpxg6nxn/external_auth_config/external_auths/5fghjjqxvd" + }, + "systemData": { + "createdBy": "Unknown-ARO-HCP-frontend", + "createdByType": "Application", + "lastModifiedBy": "Unknown-ARO-HCP-frontend", + "lastModifiedByType": "Application" + }, + "type": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/externalAuths" }, "resourceID": "/subscriptions/a433a095-1277-44f1-8453-8d61a4d848c2/resourceGroups/unimportantpostponement/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/monstrousprecinct/externalAuths/default", "resourceType": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/externalAuths" diff --git a/test-integration/backend/controllers/mismatches/artifacts/externalauth/present_externalauth/00-load-initial-state/externalauth-default.json b/test-integration/backend/controllers/mismatches/artifacts/externalauth/present_externalauth/00-load-initial-state/externalauth-default.json index d36c110084f..8ee62566da9 100644 --- a/test-integration/backend/controllers/mismatches/artifacts/externalauth/present_externalauth/00-load-initial-state/externalauth-default.json +++ b/test-integration/backend/controllers/mismatches/artifacts/externalauth/present_externalauth/00-load-initial-state/externalauth-default.json @@ -7,6 +7,7 @@ "id": "9a361107-eb97-5b1b-bc2e-b9cfa961b5bc", "partitionKey": "a433a095-1277-44f1-8453-8d61a4d848c2", "properties": { + "id": "/subscriptions/a433a095-1277-44f1-8453-8d61a4d848c2/resourceGroups/unimportantpostponement/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/monstrousprecinct/externalAuths/default", "intermediateResourceDoc": { "activeOperationId": "ea807c13-7e15-43d4-b760-69ef7e31d273", "internalId": "/api/clusters_mgmt/v1/clusters/1243e9e9-d150-4ef1-9735-2bbc3cabc7d0/external_auth_config/external_auths/5fghjjqxvd", @@ -21,6 +22,8 @@ }, "internalState": { "internalAPI": { + "id": "/subscriptions/a433a095-1277-44f1-8453-8d61a4d848c2/resourceGroups/unimportantpostponement/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/monstrousprecinct/externalAuths/default", + "name": "default", "properties": { "claim": { "mappings": { @@ -63,13 +66,77 @@ "ca": "", "url": "https://login.microsoftonline.com/12345678-1234-1234-1234-123456789abc/v2.0" }, - "provisioningState": "" + "provisioningState": "Accepted" }, "serviceProviderProperties": { + "activeOperationId": "ea807c13-7e15-43d4-b760-69ef7e31d273", "clusterServiceID": "" - } + }, + "systemData": { + "createdBy": "Unknown-ARO-HCP-frontend", + "createdByType": "Application", + "lastModifiedBy": "Unknown-ARO-HCP-frontend", + "lastModifiedByType": "Application" + }, + "type": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/externalAuths" } - } + }, + "name": "default", + "properties": { + "claim": { + "mappings": { + "groups": { + "claim": "groups", + "prefix": "" + }, + "username": { + "claim": "sub", + "prefix": "prefix-", + "prefixPolicy": "Prefix" + } + }, + "validationRules": [] + }, + "clients": [ + { + "clientId": "87654321-4321-4321-4321-abcdefghijkl", + "component": { + "authClientNamespace": "openshift-console", + "name": "console" + }, + "extraScopes": [], + "type": "Confidential" + }, + { + "clientId": "87654321-4321-4321-4321-abcdefghijkl", + "component": { + "authClientNamespace": "openshift-console", + "name": "cli" + }, + "extraScopes": [], + "type": "Public" + } + ], + "issuer": { + "audiences": [ + "87654321-4321-4321-4321-abcdefghijkl" + ], + "ca": "", + "url": "https://login.microsoftonline.com/12345678-1234-1234-1234-123456789abc/v2.0" + }, + "provisioningState": "Accepted" + }, + "serviceProviderProperties": { + "activeOperationId": "ea807c13-7e15-43d4-b760-69ef7e31d273", + "clusterServiceID": "/api/clusters_mgmt/v1/clusters/1243e9e9-d150-4ef1-9735-2bbc3cabc7d0/external_auth_config/external_auths/5fghjjqxvd" + }, + "systemData": { + "createdBy": "Unknown-ARO-HCP-frontend", + "createdByType": "Application", + "lastModifiedBy": "Unknown-ARO-HCP-frontend", + "lastModifiedByType": "Application" + }, + "type": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/externalAuths" }, "resourceID": "/subscriptions/a433a095-1277-44f1-8453-8d61a4d848c2/resourceGroups/unimportantpostponement/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/monstrousprecinct/externalAuths/default", "resourceType": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/externalAuths" diff --git a/test-integration/backend/controllers/mismatches/artifacts/externalauth/present_externalauth/99-cosmosCompare-end-state/externalauth-default.json b/test-integration/backend/controllers/mismatches/artifacts/externalauth/present_externalauth/99-cosmosCompare-end-state/externalauth-default.json index d36c110084f..8ee62566da9 100644 --- a/test-integration/backend/controllers/mismatches/artifacts/externalauth/present_externalauth/99-cosmosCompare-end-state/externalauth-default.json +++ b/test-integration/backend/controllers/mismatches/artifacts/externalauth/present_externalauth/99-cosmosCompare-end-state/externalauth-default.json @@ -7,6 +7,7 @@ "id": "9a361107-eb97-5b1b-bc2e-b9cfa961b5bc", "partitionKey": "a433a095-1277-44f1-8453-8d61a4d848c2", "properties": { + "id": "/subscriptions/a433a095-1277-44f1-8453-8d61a4d848c2/resourceGroups/unimportantpostponement/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/monstrousprecinct/externalAuths/default", "intermediateResourceDoc": { "activeOperationId": "ea807c13-7e15-43d4-b760-69ef7e31d273", "internalId": "/api/clusters_mgmt/v1/clusters/1243e9e9-d150-4ef1-9735-2bbc3cabc7d0/external_auth_config/external_auths/5fghjjqxvd", @@ -21,6 +22,8 @@ }, "internalState": { "internalAPI": { + "id": "/subscriptions/a433a095-1277-44f1-8453-8d61a4d848c2/resourceGroups/unimportantpostponement/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/monstrousprecinct/externalAuths/default", + "name": "default", "properties": { "claim": { "mappings": { @@ -63,13 +66,77 @@ "ca": "", "url": "https://login.microsoftonline.com/12345678-1234-1234-1234-123456789abc/v2.0" }, - "provisioningState": "" + "provisioningState": "Accepted" }, "serviceProviderProperties": { + "activeOperationId": "ea807c13-7e15-43d4-b760-69ef7e31d273", "clusterServiceID": "" - } + }, + "systemData": { + "createdBy": "Unknown-ARO-HCP-frontend", + "createdByType": "Application", + "lastModifiedBy": "Unknown-ARO-HCP-frontend", + "lastModifiedByType": "Application" + }, + "type": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/externalAuths" } - } + }, + "name": "default", + "properties": { + "claim": { + "mappings": { + "groups": { + "claim": "groups", + "prefix": "" + }, + "username": { + "claim": "sub", + "prefix": "prefix-", + "prefixPolicy": "Prefix" + } + }, + "validationRules": [] + }, + "clients": [ + { + "clientId": "87654321-4321-4321-4321-abcdefghijkl", + "component": { + "authClientNamespace": "openshift-console", + "name": "console" + }, + "extraScopes": [], + "type": "Confidential" + }, + { + "clientId": "87654321-4321-4321-4321-abcdefghijkl", + "component": { + "authClientNamespace": "openshift-console", + "name": "cli" + }, + "extraScopes": [], + "type": "Public" + } + ], + "issuer": { + "audiences": [ + "87654321-4321-4321-4321-abcdefghijkl" + ], + "ca": "", + "url": "https://login.microsoftonline.com/12345678-1234-1234-1234-123456789abc/v2.0" + }, + "provisioningState": "Accepted" + }, + "serviceProviderProperties": { + "activeOperationId": "ea807c13-7e15-43d4-b760-69ef7e31d273", + "clusterServiceID": "/api/clusters_mgmt/v1/clusters/1243e9e9-d150-4ef1-9735-2bbc3cabc7d0/external_auth_config/external_auths/5fghjjqxvd" + }, + "systemData": { + "createdBy": "Unknown-ARO-HCP-frontend", + "createdByType": "Application", + "lastModifiedBy": "Unknown-ARO-HCP-frontend", + "lastModifiedByType": "Application" + }, + "type": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/externalAuths" }, "resourceID": "/subscriptions/a433a095-1277-44f1-8453-8d61a4d848c2/resourceGroups/unimportantpostponement/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/monstrousprecinct/externalAuths/default", "resourceType": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/externalAuths" diff --git a/test-integration/backend/controllers/mismatches/artifacts/externalauth/remove_orphaned_externalauth_descendents/00-load-initial-state/externalauth-default.json b/test-integration/backend/controllers/mismatches/artifacts/externalauth/remove_orphaned_externalauth_descendents/00-load-initial-state/externalauth-default.json index d36c110084f..8ee62566da9 100644 --- a/test-integration/backend/controllers/mismatches/artifacts/externalauth/remove_orphaned_externalauth_descendents/00-load-initial-state/externalauth-default.json +++ b/test-integration/backend/controllers/mismatches/artifacts/externalauth/remove_orphaned_externalauth_descendents/00-load-initial-state/externalauth-default.json @@ -7,6 +7,7 @@ "id": "9a361107-eb97-5b1b-bc2e-b9cfa961b5bc", "partitionKey": "a433a095-1277-44f1-8453-8d61a4d848c2", "properties": { + "id": "/subscriptions/a433a095-1277-44f1-8453-8d61a4d848c2/resourceGroups/unimportantpostponement/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/monstrousprecinct/externalAuths/default", "intermediateResourceDoc": { "activeOperationId": "ea807c13-7e15-43d4-b760-69ef7e31d273", "internalId": "/api/clusters_mgmt/v1/clusters/1243e9e9-d150-4ef1-9735-2bbc3cabc7d0/external_auth_config/external_auths/5fghjjqxvd", @@ -21,6 +22,8 @@ }, "internalState": { "internalAPI": { + "id": "/subscriptions/a433a095-1277-44f1-8453-8d61a4d848c2/resourceGroups/unimportantpostponement/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/monstrousprecinct/externalAuths/default", + "name": "default", "properties": { "claim": { "mappings": { @@ -63,13 +66,77 @@ "ca": "", "url": "https://login.microsoftonline.com/12345678-1234-1234-1234-123456789abc/v2.0" }, - "provisioningState": "" + "provisioningState": "Accepted" }, "serviceProviderProperties": { + "activeOperationId": "ea807c13-7e15-43d4-b760-69ef7e31d273", "clusterServiceID": "" - } + }, + "systemData": { + "createdBy": "Unknown-ARO-HCP-frontend", + "createdByType": "Application", + "lastModifiedBy": "Unknown-ARO-HCP-frontend", + "lastModifiedByType": "Application" + }, + "type": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/externalAuths" } - } + }, + "name": "default", + "properties": { + "claim": { + "mappings": { + "groups": { + "claim": "groups", + "prefix": "" + }, + "username": { + "claim": "sub", + "prefix": "prefix-", + "prefixPolicy": "Prefix" + } + }, + "validationRules": [] + }, + "clients": [ + { + "clientId": "87654321-4321-4321-4321-abcdefghijkl", + "component": { + "authClientNamespace": "openshift-console", + "name": "console" + }, + "extraScopes": [], + "type": "Confidential" + }, + { + "clientId": "87654321-4321-4321-4321-abcdefghijkl", + "component": { + "authClientNamespace": "openshift-console", + "name": "cli" + }, + "extraScopes": [], + "type": "Public" + } + ], + "issuer": { + "audiences": [ + "87654321-4321-4321-4321-abcdefghijkl" + ], + "ca": "", + "url": "https://login.microsoftonline.com/12345678-1234-1234-1234-123456789abc/v2.0" + }, + "provisioningState": "Accepted" + }, + "serviceProviderProperties": { + "activeOperationId": "ea807c13-7e15-43d4-b760-69ef7e31d273", + "clusterServiceID": "/api/clusters_mgmt/v1/clusters/1243e9e9-d150-4ef1-9735-2bbc3cabc7d0/external_auth_config/external_auths/5fghjjqxvd" + }, + "systemData": { + "createdBy": "Unknown-ARO-HCP-frontend", + "createdByType": "Application", + "lastModifiedBy": "Unknown-ARO-HCP-frontend", + "lastModifiedByType": "Application" + }, + "type": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/externalAuths" }, "resourceID": "/subscriptions/a433a095-1277-44f1-8453-8d61a4d848c2/resourceGroups/unimportantpostponement/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/monstrousprecinct/externalAuths/default", "resourceType": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/externalAuths" diff --git a/test-integration/backend/controllers/mismatches/artifacts/nodepool/remove_orphaned_nodepool_descendents/00-load-initial-state/externalauth-default.json b/test-integration/backend/controllers/mismatches/artifacts/nodepool/remove_orphaned_nodepool_descendents/00-load-initial-state/externalauth-default.json index 2028d2455f5..afced65a6d4 100644 --- a/test-integration/backend/controllers/mismatches/artifacts/nodepool/remove_orphaned_nodepool_descendents/00-load-initial-state/externalauth-default.json +++ b/test-integration/backend/controllers/mismatches/artifacts/nodepool/remove_orphaned_nodepool_descendents/00-load-initial-state/externalauth-default.json @@ -7,6 +7,7 @@ "id": "9a361107-eb97-5b1b-bc2e-b9cfa961b5bc", "partitionKey": "a433a095-1277-44f1-8453-8d61a4d848c2", "properties": { + "id": "/subscriptions/a433a095-1277-44f1-8453-8d61a4d848c2/resourceGroups/unimportantpostponement/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/monstrousprecinct/externalAuths/default", "intermediateResourceDoc": { "activeOperationId": "ea807c13-7e15-43d4-b760-69ef7e31d273", "internalId": "/api/clusters_mgmt/v1/clusters/swzpxg6nxn/external_auth_config/external_auths/5fghjjqxvd", @@ -21,6 +22,8 @@ }, "internalState": { "internalAPI": { + "id": "/subscriptions/a433a095-1277-44f1-8453-8d61a4d848c2/resourceGroups/unimportantpostponement/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/monstrousprecinct/externalAuths/default", + "name": "default", "properties": { "claim": { "mappings": { @@ -63,13 +66,77 @@ "ca": "", "url": "https://login.microsoftonline.com/12345678-1234-1234-1234-123456789abc/v2.0" }, - "provisioningState": "" + "provisioningState": "Accepted" }, "serviceProviderProperties": { + "activeOperationId": "ea807c13-7e15-43d4-b760-69ef7e31d273", "clusterServiceID": "" - } + }, + "systemData": { + "createdBy": "Unknown-ARO-HCP-frontend", + "createdByType": "Application", + "lastModifiedBy": "Unknown-ARO-HCP-frontend", + "lastModifiedByType": "Application" + }, + "type": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/externalAuths" } - } + }, + "name": "default", + "properties": { + "claim": { + "mappings": { + "groups": { + "claim": "groups", + "prefix": "" + }, + "username": { + "claim": "sub", + "prefix": "prefix-", + "prefixPolicy": "Prefix" + } + }, + "validationRules": [] + }, + "clients": [ + { + "clientId": "87654321-4321-4321-4321-abcdefghijkl", + "component": { + "authClientNamespace": "openshift-console", + "name": "console" + }, + "extraScopes": [], + "type": "Confidential" + }, + { + "clientId": "87654321-4321-4321-4321-abcdefghijkl", + "component": { + "authClientNamespace": "openshift-console", + "name": "cli" + }, + "extraScopes": [], + "type": "Public" + } + ], + "issuer": { + "audiences": [ + "87654321-4321-4321-4321-abcdefghijkl" + ], + "ca": "", + "url": "https://login.microsoftonline.com/12345678-1234-1234-1234-123456789abc/v2.0" + }, + "provisioningState": "Accepted" + }, + "serviceProviderProperties": { + "activeOperationId": "ea807c13-7e15-43d4-b760-69ef7e31d273", + "clusterServiceID": "/api/clusters_mgmt/v1/clusters/swzpxg6nxn/external_auth_config/external_auths/5fghjjqxvd" + }, + "systemData": { + "createdBy": "Unknown-ARO-HCP-frontend", + "createdByType": "Application", + "lastModifiedBy": "Unknown-ARO-HCP-frontend", + "lastModifiedByType": "Application" + }, + "type": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/externalAuths" }, "resourceID": "/subscriptions/a433a095-1277-44f1-8453-8d61a4d848c2/resourceGroups/unimportantpostponement/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/monstrousprecinct/externalAuths/default", "resourceType": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/externalAuths" diff --git a/test-integration/backend/controllers/mismatches/artifacts/nodepool/remove_orphaned_nodepool_descendents/99-cosmosCompare-end-state/externalauth-default.json b/test-integration/backend/controllers/mismatches/artifacts/nodepool/remove_orphaned_nodepool_descendents/99-cosmosCompare-end-state/externalauth-default.json index 2028d2455f5..afced65a6d4 100644 --- a/test-integration/backend/controllers/mismatches/artifacts/nodepool/remove_orphaned_nodepool_descendents/99-cosmosCompare-end-state/externalauth-default.json +++ b/test-integration/backend/controllers/mismatches/artifacts/nodepool/remove_orphaned_nodepool_descendents/99-cosmosCompare-end-state/externalauth-default.json @@ -7,6 +7,7 @@ "id": "9a361107-eb97-5b1b-bc2e-b9cfa961b5bc", "partitionKey": "a433a095-1277-44f1-8453-8d61a4d848c2", "properties": { + "id": "/subscriptions/a433a095-1277-44f1-8453-8d61a4d848c2/resourceGroups/unimportantpostponement/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/monstrousprecinct/externalAuths/default", "intermediateResourceDoc": { "activeOperationId": "ea807c13-7e15-43d4-b760-69ef7e31d273", "internalId": "/api/clusters_mgmt/v1/clusters/swzpxg6nxn/external_auth_config/external_auths/5fghjjqxvd", @@ -21,6 +22,8 @@ }, "internalState": { "internalAPI": { + "id": "/subscriptions/a433a095-1277-44f1-8453-8d61a4d848c2/resourceGroups/unimportantpostponement/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/monstrousprecinct/externalAuths/default", + "name": "default", "properties": { "claim": { "mappings": { @@ -63,13 +66,77 @@ "ca": "", "url": "https://login.microsoftonline.com/12345678-1234-1234-1234-123456789abc/v2.0" }, - "provisioningState": "" + "provisioningState": "Accepted" }, "serviceProviderProperties": { + "activeOperationId": "ea807c13-7e15-43d4-b760-69ef7e31d273", "clusterServiceID": "" - } + }, + "systemData": { + "createdBy": "Unknown-ARO-HCP-frontend", + "createdByType": "Application", + "lastModifiedBy": "Unknown-ARO-HCP-frontend", + "lastModifiedByType": "Application" + }, + "type": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/externalAuths" } - } + }, + "name": "default", + "properties": { + "claim": { + "mappings": { + "groups": { + "claim": "groups", + "prefix": "" + }, + "username": { + "claim": "sub", + "prefix": "prefix-", + "prefixPolicy": "Prefix" + } + }, + "validationRules": [] + }, + "clients": [ + { + "clientId": "87654321-4321-4321-4321-abcdefghijkl", + "component": { + "authClientNamespace": "openshift-console", + "name": "console" + }, + "extraScopes": [], + "type": "Confidential" + }, + { + "clientId": "87654321-4321-4321-4321-abcdefghijkl", + "component": { + "authClientNamespace": "openshift-console", + "name": "cli" + }, + "extraScopes": [], + "type": "Public" + } + ], + "issuer": { + "audiences": [ + "87654321-4321-4321-4321-abcdefghijkl" + ], + "ca": "", + "url": "https://login.microsoftonline.com/12345678-1234-1234-1234-123456789abc/v2.0" + }, + "provisioningState": "Accepted" + }, + "serviceProviderProperties": { + "activeOperationId": "ea807c13-7e15-43d4-b760-69ef7e31d273", + "clusterServiceID": "/api/clusters_mgmt/v1/clusters/swzpxg6nxn/external_auth_config/external_auths/5fghjjqxvd" + }, + "systemData": { + "createdBy": "Unknown-ARO-HCP-frontend", + "createdByType": "Application", + "lastModifiedBy": "Unknown-ARO-HCP-frontend", + "lastModifiedByType": "Application" + }, + "type": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/externalAuths" }, "resourceID": "/subscriptions/a433a095-1277-44f1-8453-8d61a4d848c2/resourceGroups/unimportantpostponement/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/monstrousprecinct/externalAuths/default", "resourceType": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/externalAuths" diff --git a/test-integration/frontend/artifacts/FrontendCRUD/ExternalAuth/create-current/06-cosmosCompare-ending-content/externalauth-default.json b/test-integration/frontend/artifacts/FrontendCRUD/ExternalAuth/create-current/06-cosmosCompare-ending-content/externalauth-default.json index d099655f0db..dece86301f3 100644 --- a/test-integration/frontend/artifacts/FrontendCRUD/ExternalAuth/create-current/06-cosmosCompare-ending-content/externalauth-default.json +++ b/test-integration/frontend/artifacts/FrontendCRUD/ExternalAuth/create-current/06-cosmosCompare-ending-content/externalauth-default.json @@ -10,6 +10,7 @@ "cosmosMetadata": { "resourceID": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/externalAuths/default" }, + "id": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/externalAuths/default", "intermediateResourceDoc": { "activeOperationId": "60df392c-42ba-4384-95b4-5e4601df2f3e", "internalId": "/api/clusters_mgmt/v1/clusters/tqqtpctbpj/external_auth_config/external_auths/88m6lb2bbv", @@ -24,6 +25,8 @@ }, "internalState": { "internalAPI": { + "id": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/externalAuths/default", + "name": "default", "properties": { "claim": { "mappings": { @@ -66,13 +69,77 @@ "ca": "", "url": "https://login.microsoftonline.com/12345678-1234-1234-1234-123456789abc/v2.0" }, - "provisioningState": "" + "provisioningState": "Accepted" }, "serviceProviderProperties": { + "activeOperationId": "60df392c-42ba-4384-95b4-5e4601df2f3e", "clusterServiceID": "" - } + }, + "systemData": { + "createdBy": "Unknown-ARO-HCP-frontend", + "createdByType": "Application", + "lastModifiedBy": "Unknown-ARO-HCP-frontend", + "lastModifiedByType": "Application" + }, + "type": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/externalAuths" } - } + }, + "name": "default", + "properties": { + "claim": { + "mappings": { + "groups": { + "claim": "groups", + "prefix": "" + }, + "username": { + "claim": "sub", + "prefix": "prefix-", + "prefixPolicy": "Prefix" + } + }, + "validationRules": [] + }, + "clients": [ + { + "clientId": "87654321-4321-4321-4321-abcdefghijkl", + "component": { + "authClientNamespace": "openshift-console", + "name": "console" + }, + "extraScopes": [], + "type": "Confidential" + }, + { + "clientId": "87654321-4321-4321-4321-abcdefghijkl", + "component": { + "authClientNamespace": "openshift-console", + "name": "cli" + }, + "extraScopes": [], + "type": "Public" + } + ], + "issuer": { + "audiences": [ + "87654321-4321-4321-4321-abcdefghijkl" + ], + "ca": "", + "url": "https://login.microsoftonline.com/12345678-1234-1234-1234-123456789abc/v2.0" + }, + "provisioningState": "Accepted" + }, + "serviceProviderProperties": { + "activeOperationId": "60df392c-42ba-4384-95b4-5e4601df2f3e", + "clusterServiceID": "/api/clusters_mgmt/v1/clusters/tqqtpctbpj/external_auth_config/external_auths/88m6lb2bbv" + }, + "systemData": { + "createdBy": "Unknown-ARO-HCP-frontend", + "createdByType": "Application", + "lastModifiedBy": "Unknown-ARO-HCP-frontend", + "lastModifiedByType": "Application" + }, + "type": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/externalAuths" }, "resourceID": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/externalAuths/default", "resourceType": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/externalAuths" diff --git a/test-integration/frontend/artifacts/FrontendCRUD/ExternalAuth/read-old-data/01-load-old-data/externalauth-default.json b/test-integration/frontend/artifacts/FrontendCRUD/ExternalAuth/read-old-data/01-load-old-data/externalauth-default.json index cec1fea74bc..4ae11fedb73 100644 --- a/test-integration/frontend/artifacts/FrontendCRUD/ExternalAuth/read-old-data/01-load-old-data/externalauth-default.json +++ b/test-integration/frontend/artifacts/FrontendCRUD/ExternalAuth/read-old-data/01-load-old-data/externalauth-default.json @@ -7,6 +7,7 @@ "id": "85dada74-03ca-5abf-9adc-218fbd0090c7", "partitionKey": "6b690bec-0c16-4ecb-8f67-781caf40bba7", "properties": { + "id": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/externalAuths/default", "intermediateResourceDoc": { "activeOperationId": "5dce3cac-e09b-4ef5-803c-cb8f17b3a552", "internalId": "/api/clusters_mgmt/v1/clusters/m6bpjxtlqf/external_auth_config/external_auths/zt59xrx22b", @@ -21,6 +22,8 @@ }, "internalState": { "internalAPI": { + "id": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/externalAuths/default", + "name": "default", "properties": { "claim": { "mappings": { @@ -63,13 +66,77 @@ "ca": "", "url": "https://login.microsoftonline.com/12345678-1234-1234-1234-123456789abc/v2.0" }, - "provisioningState": "" + "provisioningState": "Accepted" }, "serviceProviderProperties": { + "activeOperationId": "5dce3cac-e09b-4ef5-803c-cb8f17b3a552", "clusterServiceID": "" - } + }, + "systemData": { + "createdBy": "Unknown-ARO-HCP-frontend", + "createdByType": "Application", + "lastModifiedBy": "Unknown-ARO-HCP-frontend", + "lastModifiedByType": "Application" + }, + "type": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/externalAuths" } - } + }, + "name": "default", + "properties": { + "claim": { + "mappings": { + "groups": { + "claim": "groups", + "prefix": "" + }, + "username": { + "claim": "sub", + "prefix": "prefix-", + "prefixPolicy": "Prefix" + } + }, + "validationRules": [] + }, + "clients": [ + { + "clientId": "87654321-4321-4321-4321-abcdefghijkl", + "component": { + "authClientNamespace": "openshift-console", + "name": "console" + }, + "extraScopes": [], + "type": "Confidential" + }, + { + "clientId": "87654321-4321-4321-4321-abcdefghijkl", + "component": { + "authClientNamespace": "openshift-console", + "name": "cli" + }, + "extraScopes": [], + "type": "Public" + } + ], + "issuer": { + "audiences": [ + "87654321-4321-4321-4321-abcdefghijkl" + ], + "ca": "", + "url": "https://login.microsoftonline.com/12345678-1234-1234-1234-123456789abc/v2.0" + }, + "provisioningState": "Accepted" + }, + "serviceProviderProperties": { + "activeOperationId": "5dce3cac-e09b-4ef5-803c-cb8f17b3a552", + "clusterServiceID": "/api/clusters_mgmt/v1/clusters/m6bpjxtlqf/external_auth_config/external_auths/zt59xrx22b" + }, + "systemData": { + "createdBy": "Unknown-ARO-HCP-frontend", + "createdByType": "Application", + "lastModifiedBy": "Unknown-ARO-HCP-frontend", + "lastModifiedByType": "Application" + }, + "type": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/externalAuths" }, "resourceID": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/externalAuths/default", "resourceType": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/externalAuths" diff --git a/test-integration/frontend/artifacts/FrontendCRUD/ExternalAuth/read-old-data/09-cosmosCompare-confirm-update/externalauth-default.json b/test-integration/frontend/artifacts/FrontendCRUD/ExternalAuth/read-old-data/09-cosmosCompare-confirm-update/externalauth-default.json index 889d1977174..eb944ebbc24 100644 --- a/test-integration/frontend/artifacts/FrontendCRUD/ExternalAuth/read-old-data/09-cosmosCompare-confirm-update/externalauth-default.json +++ b/test-integration/frontend/artifacts/FrontendCRUD/ExternalAuth/read-old-data/09-cosmosCompare-confirm-update/externalauth-default.json @@ -10,6 +10,7 @@ "cosmosMetadata": { "resourceID": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/externalAuths/default" }, + "id": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/externalAuths/default", "intermediateResourceDoc": { "activeOperationId": "d99a71e0-9237-4ae2-8617-e76035e2bcd4", "internalId": "/api/clusters_mgmt/v1/clusters/m6bpjxtlqf/external_auth_config/external_auths/zt59xrx22b", @@ -24,6 +25,8 @@ }, "internalState": { "internalAPI": { + "id": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/externalAuths/default", + "name": "default", "properties": { "claim": { "mappings": { @@ -66,13 +69,77 @@ "ca": "", "url": "https://login.microsoftonline.com/12345678-1234-1234-1234-123456789abc/v2.0" }, - "provisioningState": "" + "provisioningState": "Accepted" }, "serviceProviderProperties": { + "activeOperationId": "d99a71e0-9237-4ae2-8617-e76035e2bcd4", "clusterServiceID": "" - } + }, + "systemData": { + "createdBy": "Unknown-ARO-HCP-frontend", + "createdByType": "Application", + "lastModifiedBy": "Unknown-ARO-HCP-frontend", + "lastModifiedByType": "Application" + }, + "type": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/externalAuths" } - } + }, + "name": "default", + "properties": { + "claim": { + "mappings": { + "groups": { + "claim": "groups2", + "prefix": "" + }, + "username": { + "claim": "sub", + "prefix": "prefix-", + "prefixPolicy": "Prefix" + } + }, + "validationRules": [] + }, + "clients": [ + { + "clientId": "87654321-4321-4321-4321-abcdefghijkl", + "component": { + "authClientNamespace": "openshift-console", + "name": "console" + }, + "extraScopes": [], + "type": "Confidential" + }, + { + "clientId": "87654321-4321-4321-4321-abcdefghijkl", + "component": { + "authClientNamespace": "openshift-console", + "name": "cli" + }, + "extraScopes": [], + "type": "Public" + } + ], + "issuer": { + "audiences": [ + "87654321-4321-4321-4321-abcdefghijkl" + ], + "ca": "", + "url": "https://login.microsoftonline.com/12345678-1234-1234-1234-123456789abc/v2.0" + }, + "provisioningState": "Accepted" + }, + "serviceProviderProperties": { + "activeOperationId": "d99a71e0-9237-4ae2-8617-e76035e2bcd4", + "clusterServiceID": "/api/clusters_mgmt/v1/clusters/m6bpjxtlqf/external_auth_config/external_auths/zt59xrx22b" + }, + "systemData": { + "createdBy": "Unknown-ARO-HCP-frontend", + "createdByType": "Application", + "lastModifiedBy": "Unknown-ARO-HCP-frontend", + "lastModifiedByType": "Application" + }, + "type": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/externalAuths" }, "resourceID": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/externalAuths/default", "resourceType": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/externalAuths" diff --git a/test-integration/frontend/artifacts/FrontendCRUD/Migration/migrate-old-data/01-load-old-data/externalauth-default.json b/test-integration/frontend/artifacts/FrontendCRUD/Migration/migrate-old-data/01-load-old-data/externalauth-default.json index cec1fea74bc..4ae11fedb73 100644 --- a/test-integration/frontend/artifacts/FrontendCRUD/Migration/migrate-old-data/01-load-old-data/externalauth-default.json +++ b/test-integration/frontend/artifacts/FrontendCRUD/Migration/migrate-old-data/01-load-old-data/externalauth-default.json @@ -7,6 +7,7 @@ "id": "85dada74-03ca-5abf-9adc-218fbd0090c7", "partitionKey": "6b690bec-0c16-4ecb-8f67-781caf40bba7", "properties": { + "id": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/externalAuths/default", "intermediateResourceDoc": { "activeOperationId": "5dce3cac-e09b-4ef5-803c-cb8f17b3a552", "internalId": "/api/clusters_mgmt/v1/clusters/m6bpjxtlqf/external_auth_config/external_auths/zt59xrx22b", @@ -21,6 +22,8 @@ }, "internalState": { "internalAPI": { + "id": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/externalAuths/default", + "name": "default", "properties": { "claim": { "mappings": { @@ -63,13 +66,77 @@ "ca": "", "url": "https://login.microsoftonline.com/12345678-1234-1234-1234-123456789abc/v2.0" }, - "provisioningState": "" + "provisioningState": "Accepted" }, "serviceProviderProperties": { + "activeOperationId": "5dce3cac-e09b-4ef5-803c-cb8f17b3a552", "clusterServiceID": "" - } + }, + "systemData": { + "createdBy": "Unknown-ARO-HCP-frontend", + "createdByType": "Application", + "lastModifiedBy": "Unknown-ARO-HCP-frontend", + "lastModifiedByType": "Application" + }, + "type": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/externalAuths" } - } + }, + "name": "default", + "properties": { + "claim": { + "mappings": { + "groups": { + "claim": "groups", + "prefix": "" + }, + "username": { + "claim": "sub", + "prefix": "prefix-", + "prefixPolicy": "Prefix" + } + }, + "validationRules": [] + }, + "clients": [ + { + "clientId": "87654321-4321-4321-4321-abcdefghijkl", + "component": { + "authClientNamespace": "openshift-console", + "name": "console" + }, + "extraScopes": [], + "type": "Confidential" + }, + { + "clientId": "87654321-4321-4321-4321-abcdefghijkl", + "component": { + "authClientNamespace": "openshift-console", + "name": "cli" + }, + "extraScopes": [], + "type": "Public" + } + ], + "issuer": { + "audiences": [ + "87654321-4321-4321-4321-abcdefghijkl" + ], + "ca": "", + "url": "https://login.microsoftonline.com/12345678-1234-1234-1234-123456789abc/v2.0" + }, + "provisioningState": "Accepted" + }, + "serviceProviderProperties": { + "activeOperationId": "5dce3cac-e09b-4ef5-803c-cb8f17b3a552", + "clusterServiceID": "/api/clusters_mgmt/v1/clusters/m6bpjxtlqf/external_auth_config/external_auths/zt59xrx22b" + }, + "systemData": { + "createdBy": "Unknown-ARO-HCP-frontend", + "createdByType": "Application", + "lastModifiedBy": "Unknown-ARO-HCP-frontend", + "lastModifiedByType": "Application" + }, + "type": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/externalAuths" }, "resourceID": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/externalAuths/default", "resourceType": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/externalAuths" diff --git a/test-integration/frontend/artifacts/FrontendCRUD/Migration/migrate-old-data/99-cosmosCompare-confirm-migration/externalauth-default.json b/test-integration/frontend/artifacts/FrontendCRUD/Migration/migrate-old-data/99-cosmosCompare-confirm-migration/externalauth-default.json index d6abe18e73d..f960101bf36 100644 --- a/test-integration/frontend/artifacts/FrontendCRUD/Migration/migrate-old-data/99-cosmosCompare-confirm-migration/externalauth-default.json +++ b/test-integration/frontend/artifacts/FrontendCRUD/Migration/migrate-old-data/99-cosmosCompare-confirm-migration/externalauth-default.json @@ -10,6 +10,7 @@ "cosmosMetadata": { "resourceID": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/externalAuths/default" }, + "id": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/externalAuths/default", "intermediateResourceDoc": { "activeOperationId": "5dce3cac-e09b-4ef5-803c-cb8f17b3a552", "internalId": "/api/clusters_mgmt/v1/clusters/m6bpjxtlqf/external_auth_config/external_auths/zt59xrx22b", @@ -24,6 +25,8 @@ }, "internalState": { "internalAPI": { + "id": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/externalAuths/default", + "name": "default", "properties": { "claim": { "mappings": { @@ -66,13 +69,77 @@ "ca": "", "url": "https://login.microsoftonline.com/12345678-1234-1234-1234-123456789abc/v2.0" }, - "provisioningState": "" + "provisioningState": "Accepted" }, "serviceProviderProperties": { + "activeOperationId": "5dce3cac-e09b-4ef5-803c-cb8f17b3a552", "clusterServiceID": "" - } + }, + "systemData": { + "createdBy": "Unknown-ARO-HCP-frontend", + "createdByType": "Application", + "lastModifiedBy": "Unknown-ARO-HCP-frontend", + "lastModifiedByType": "Application" + }, + "type": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/externalAuths" } - } + }, + "name": "default", + "properties": { + "claim": { + "mappings": { + "groups": { + "claim": "groups", + "prefix": "" + }, + "username": { + "claim": "sub", + "prefix": "prefix-", + "prefixPolicy": "Prefix" + } + }, + "validationRules": [] + }, + "clients": [ + { + "clientId": "87654321-4321-4321-4321-abcdefghijkl", + "component": { + "authClientNamespace": "openshift-console", + "name": "console" + }, + "extraScopes": [], + "type": "Confidential" + }, + { + "clientId": "87654321-4321-4321-4321-abcdefghijkl", + "component": { + "authClientNamespace": "openshift-console", + "name": "cli" + }, + "extraScopes": [], + "type": "Public" + } + ], + "issuer": { + "audiences": [ + "87654321-4321-4321-4321-abcdefghijkl" + ], + "ca": "", + "url": "https://login.microsoftonline.com/12345678-1234-1234-1234-123456789abc/v2.0" + }, + "provisioningState": "Accepted" + }, + "serviceProviderProperties": { + "activeOperationId": "5dce3cac-e09b-4ef5-803c-cb8f17b3a552", + "clusterServiceID": "/api/clusters_mgmt/v1/clusters/m6bpjxtlqf/external_auth_config/external_auths/zt59xrx22b" + }, + "systemData": { + "createdBy": "Unknown-ARO-HCP-frontend", + "createdByType": "Application", + "lastModifiedBy": "Unknown-ARO-HCP-frontend", + "lastModifiedByType": "Application" + }, + "type": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/externalAuths" }, "resourceID": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/externalAuths/default", "resourceType": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/externalAuths" diff --git a/test-integration/frontend/artifacts/FrontendCRUD/Migration/read-new-data/01-load-old-data/externalauth-default.json b/test-integration/frontend/artifacts/FrontendCRUD/Migration/read-new-data/01-load-old-data/externalauth-default.json index 7fb1bbe06cf..fb851ea0692 100644 --- a/test-integration/frontend/artifacts/FrontendCRUD/Migration/read-new-data/01-load-old-data/externalauth-default.json +++ b/test-integration/frontend/artifacts/FrontendCRUD/Migration/read-new-data/01-load-old-data/externalauth-default.json @@ -7,6 +7,7 @@ "id": "85dada74-03ca-5abf-9adc-218fbd0090c7", "partitionKey": "6b690bec-0c16-4ecb-8f67-781caf40bba7", "properties": { + "id": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/externalAuths/default", "intermediateResourceDoc": { "activeOperationId": "5dce3cac-e09b-4ef5-803c-cb8f17b3a552", "internalId": "/api/clusters_mgmt/v1/clusters/9p2sk955gj/external_auth_config/external_auths/zt59xrx22b", @@ -21,6 +22,8 @@ }, "internalState": { "internalAPI": { + "id": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/externalAuths/default", + "name": "default", "properties": { "claim": { "mappings": { @@ -63,13 +66,77 @@ "ca": "", "url": "https://login.microsoftonline.com/12345678-1234-1234-1234-123456789abc/v2.0" }, - "provisioningState": "" + "provisioningState": "Accepted" }, "serviceProviderProperties": { + "activeOperationId": "5dce3cac-e09b-4ef5-803c-cb8f17b3a552", "clusterServiceID": "" - } + }, + "systemData": { + "createdBy": "Unknown-ARO-HCP-frontend", + "createdByType": "Application", + "lastModifiedBy": "Unknown-ARO-HCP-frontend", + "lastModifiedByType": "Application" + }, + "type": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/externalAuths" } - } + }, + "name": "default", + "properties": { + "claim": { + "mappings": { + "groups": { + "claim": "groups", + "prefix": "" + }, + "username": { + "claim": "sub", + "prefix": "prefix-", + "prefixPolicy": "Prefix" + } + }, + "validationRules": [] + }, + "clients": [ + { + "clientId": "87654321-4321-4321-4321-abcdefghijkl", + "component": { + "authClientNamespace": "openshift-console", + "name": "console" + }, + "extraScopes": [], + "type": "Confidential" + }, + { + "clientId": "87654321-4321-4321-4321-abcdefghijkl", + "component": { + "authClientNamespace": "openshift-console", + "name": "cli" + }, + "extraScopes": [], + "type": "Public" + } + ], + "issuer": { + "audiences": [ + "87654321-4321-4321-4321-abcdefghijkl" + ], + "ca": "", + "url": "https://login.microsoftonline.com/12345678-1234-1234-1234-123456789abc/v2.0" + }, + "provisioningState": "Accepted" + }, + "serviceProviderProperties": { + "activeOperationId": "5dce3cac-e09b-4ef5-803c-cb8f17b3a552", + "clusterServiceID": "/api/clusters_mgmt/v1/clusters/9p2sk955gj/external_auth_config/external_auths/zt59xrx22b" + }, + "systemData": { + "createdBy": "Unknown-ARO-HCP-frontend", + "createdByType": "Application", + "lastModifiedBy": "Unknown-ARO-HCP-frontend", + "lastModifiedByType": "Application" + }, + "type": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/externalAuths" }, "resourceID": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/externalAuths/default", "resourceType": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/externalAuths" diff --git a/test-integration/frontend/artifacts/FrontendCRUD/Migration/read-new-data/18-cosmosCompare-confirm/externalauth-default.json b/test-integration/frontend/artifacts/FrontendCRUD/Migration/read-new-data/18-cosmosCompare-confirm/externalauth-default.json index 5b43dc25a70..e92736865ec 100644 --- a/test-integration/frontend/artifacts/FrontendCRUD/Migration/read-new-data/18-cosmosCompare-confirm/externalauth-default.json +++ b/test-integration/frontend/artifacts/FrontendCRUD/Migration/read-new-data/18-cosmosCompare-confirm/externalauth-default.json @@ -6,6 +6,7 @@ "cosmosMetadata": { "resourceID": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/externalAuths/default" }, + "id": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/externalAuths/default", "intermediateResourceDoc": { "activeOperationId": "117a9956-c10f-493d-a435-fcc43ab90896", "internalId": "/api/clusters_mgmt/v1/clusters/9p2sk955gj/external_auth_config/external_auths/zt59xrx22b", @@ -20,6 +21,8 @@ }, "internalState": { "internalAPI": { + "id": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/externalAuths/default", + "name": "default", "properties": { "claim": { "mappings": { @@ -62,13 +65,77 @@ "ca": "", "url": "https://login.microsoftonline.com/12345678-1234-1234-1234-123456789abc/v2.0" }, - "provisioningState": "" + "provisioningState": "Accepted" }, "serviceProviderProperties": { + "activeOperationId": "117a9956-c10f-493d-a435-fcc43ab90896", "clusterServiceID": "" - } + }, + "systemData": { + "createdBy": "Unknown-ARO-HCP-frontend", + "createdByType": "Application", + "lastModifiedBy": "Unknown-ARO-HCP-frontend", + "lastModifiedByType": "Application" + }, + "type": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/externalAuths" } - } + }, + "name": "default", + "properties": { + "claim": { + "mappings": { + "groups": { + "claim": "groups2", + "prefix": "" + }, + "username": { + "claim": "sub", + "prefix": "prefix-", + "prefixPolicy": "Prefix" + } + }, + "validationRules": [] + }, + "clients": [ + { + "clientId": "87654321-4321-4321-4321-abcdefghijkl", + "component": { + "authClientNamespace": "openshift-console", + "name": "console" + }, + "extraScopes": [], + "type": "Confidential" + }, + { + "clientId": "87654321-4321-4321-4321-abcdefghijkl", + "component": { + "authClientNamespace": "openshift-console", + "name": "cli" + }, + "extraScopes": [], + "type": "Public" + } + ], + "issuer": { + "audiences": [ + "87654321-4321-4321-4321-abcdefghijkl" + ], + "ca": "", + "url": "https://login.microsoftonline.com/12345678-1234-1234-1234-123456789abc/v2.0" + }, + "provisioningState": "Accepted" + }, + "serviceProviderProperties": { + "activeOperationId": "117a9956-c10f-493d-a435-fcc43ab90896", + "clusterServiceID": "/api/clusters_mgmt/v1/clusters/9p2sk955gj/external_auth_config/external_auths/zt59xrx22b" + }, + "systemData": { + "createdBy": "Unknown-ARO-HCP-frontend", + "createdByType": "Application", + "lastModifiedBy": "Unknown-ARO-HCP-frontend", + "lastModifiedByType": "Application" + }, + "type": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/externalAuths" }, "resourceID": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/externalAuths/default", "resourceType": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/externalAuths" diff --git a/test-integration/utils/databasemutationhelpers/per_resource_comparer.go b/test-integration/utils/databasemutationhelpers/per_resource_comparer.go index a4cda450c59..579174dd6c2 100644 --- a/test-integration/utils/databasemutationhelpers/per_resource_comparer.go +++ b/test-integration/utils/databasemutationhelpers/per_resource_comparer.go @@ -116,16 +116,16 @@ func ResourceInstanceEquals(t *testing.T, expected, actual any) (string, bool) { unstructured.RemoveNestedField(currMap, prepend(possiblePrepend, "startTime")...) // operations unstructured.RemoveNestedField(currMap, prepend(possiblePrepend, "operationId")...) // operations unstructured.RemoveNestedField(currMap, prepend(possiblePrepend, "internalState", "internalAPI", "serviceProviderProperties", "clusterUID")...) // cluster - UUID generated - unstructured.RemoveNestedField(currMap, prepend(possiblePrepend, "internalState", "internalAPI", "serviceProviderProperties", "activeOperationId")...) // cluster - UUID generated - 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", "serviceProviderProperties", "activeOperationId")...) // cluster, nodepool, externalauth - UUID generated + unstructured.RemoveNestedField(currMap, prepend(possiblePrepend, "internalState", "internalAPI", "serviceProviderProperties", "clusterServiceID")...) // cluster, nodepool, externalauth - randomly generated by cluster-service mock + unstructured.RemoveNestedField(currMap, prepend(possiblePrepend, "internalState", "internalAPI", "systemData", "createdAt")...) // cluster, nodepool, externalauth - varies on every run + unstructured.RemoveNestedField(currMap, prepend(possiblePrepend, "internalState", "internalAPI", "systemData", "lastModifiedAt")...) // cluster, nodepool, externalauth - varies on every run unstructured.RemoveNestedField(currMap, prepend(possiblePrepend, "cosmosMetadata", "etag")...) - // inline serialization on cluster also exposes these UUID-generated / variable fields directly under properties - unstructured.RemoveNestedField(currMap, prepend(possiblePrepend, "serviceProviderProperties", "clusterUID")...) // UUID generated - unstructured.RemoveNestedField(currMap, prepend(possiblePrepend, "serviceProviderProperties", "activeOperationId")...) // UUID generated - unstructured.RemoveNestedField(currMap, prepend(possiblePrepend, "serviceProviderProperties", "clusterServiceID")...) // randomly generated by cluster-service mock + // inline serialization (cluster, nodepool, externalauth) also exposes these UUID-generated / variable fields directly under properties + unstructured.RemoveNestedField(currMap, prepend(possiblePrepend, "serviceProviderProperties", "clusterUID")...) // cluster - UUID generated + unstructured.RemoveNestedField(currMap, prepend(possiblePrepend, "serviceProviderProperties", "activeOperationId")...) // cluster, nodepool, externalauth - UUID generated + unstructured.RemoveNestedField(currMap, prepend(possiblePrepend, "serviceProviderProperties", "clusterServiceID")...) // cluster, nodepool, externalauth - randomly generated by cluster-service mock unstructured.RemoveNestedField(currMap, prepend(possiblePrepend, "systemData", "createdAt")...) unstructured.RemoveNestedField(currMap, prepend(possiblePrepend, "systemData", "lastModifiedAt")...) From 610d7cdbb2140f11432fbc3a48706cd9d51d9efb Mon Sep 17 00:00:00 2001 From: David Eads Date: Mon, 11 May 2026 11:31:38 -0400 Subject: [PATCH 2/3] read new externalauth content Co-Authored-By: Claude Opus 4.7 (1M context) --- .../resource_metrics_controller_test.go | 1 + .../operationcontrollers/test_helpers_test.go | 1 + backend/pkg/informers/informers_test.go | 3 +- .../pkg/listertesting/slice_listers_test.go | 3 +- frontend/pkg/frontend/external_auth.go | 8 ++- internal/api/types_externalauth.go | 19 +----- .../v20240610preview/conversion_fuzz_test.go | 9 ++- .../v20240610preview/external_auth_methods.go | 5 +- .../v20251223preview/conversion_fuzz_test.go | 9 ++- .../v20251223preview/external_auth_methods.go | 5 +- internal/api/zz_generated.deepcopy.go | 1 + internal/conversion/readonly_externalauth.go | 5 +- internal/database/convert_cluster_test.go | 2 +- internal/database/convert_externalauth.go | 60 +++++++------------ .../database/convert_externalauth_test.go | 13 +++- internal/database/types_externalauth.go | 12 ++-- ...alidate_externalauth_comprehensive_test.go | 1 + .../per_resource_comparer.go | 1 + 18 files changed, 81 insertions(+), 77 deletions(-) diff --git a/backend/pkg/controllers/metricscontrollers/resource_metrics_controller_test.go b/backend/pkg/controllers/metricscontrollers/resource_metrics_controller_test.go index 73c44690aff..82f51bf1dcc 100644 --- a/backend/pkg/controllers/metricscontrollers/resource_metrics_controller_test.go +++ b/backend/pkg/controllers/metricscontrollers/resource_metrics_controller_test.go @@ -167,6 +167,7 @@ func TestExternalAuthMetricsHandler_SetsMetrics(t *testing.T) { handler := NewExternalAuthMetricsHandler(reg) externalAuth := &api.HCPOpenShiftClusterExternalAuth{ + CosmosMetadata: arm.CosmosMetadata{ResourceID: api.Must(azcorearm.ParseResourceID("/subscriptions/sub-1/resourceGroups/rg/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/cluster-1/externalAuths/ea-1"))}, ProxyResource: arm.ProxyResource{ Resource: arm.Resource{ ID: api.Must(azcorearm.ParseResourceID("/subscriptions/sub-1/resourceGroups/rg/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/cluster-1/externalAuths/ea-1")), diff --git a/backend/pkg/controllers/operationcontrollers/test_helpers_test.go b/backend/pkg/controllers/operationcontrollers/test_helpers_test.go index f84eb625d49..f05bbb712bf 100644 --- a/backend/pkg/controllers/operationcontrollers/test_helpers_test.go +++ b/backend/pkg/controllers/operationcontrollers/test_helpers_test.go @@ -271,6 +271,7 @@ func (f *externalAuthTestFixture) newCluster() *api.HCPOpenShiftCluster { func (f *externalAuthTestFixture) newExternalAuth() *api.HCPOpenShiftClusterExternalAuth { return &api.HCPOpenShiftClusterExternalAuth{ + CosmosMetadata: arm.CosmosMetadata{ResourceID: f.externalAuthResourceID}, ProxyResource: arm.ProxyResource{ Resource: arm.Resource{ ID: f.externalAuthResourceID, diff --git a/backend/pkg/informers/informers_test.go b/backend/pkg/informers/informers_test.go index 66c8d8c02d2..cf19446ad30 100644 --- a/backend/pkg/informers/informers_test.go +++ b/backend/pkg/informers/informers_test.go @@ -751,7 +751,8 @@ func controllerInformerTestCase() informerTestCase { "/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/"+clusterName+ "/externalAuths/"+externalAuthName) ea := &api.HCPOpenShiftClusterExternalAuth{ - ProxyResource: arm.NewProxyResource(eaResourceID), + CosmosMetadata: arm.CosmosMetadata{ResourceID: eaResourceID}, + ProxyResource: arm.NewProxyResource(eaResourceID), } _, err = mockResourcesDBClient.HCPClusters(subscriptionID, resourceGroupName).ExternalAuth(clusterName).Create(ctx, ea, nil) require.NoError(t, err) diff --git a/backend/pkg/listertesting/slice_listers_test.go b/backend/pkg/listertesting/slice_listers_test.go index eb4dd051bac..06771a3ec63 100644 --- a/backend/pkg/listertesting/slice_listers_test.go +++ b/backend/pkg/listertesting/slice_listers_test.go @@ -381,7 +381,8 @@ func newTestExternalAuth(subscriptionID, resourceGroupName, clusterName, externa "/externalAuths/" + externalAuthName, )) return &api.HCPOpenShiftClusterExternalAuth{ - ProxyResource: arm.NewProxyResource(resourceID), + CosmosMetadata: arm.CosmosMetadata{ResourceID: resourceID}, + ProxyResource: arm.NewProxyResource(resourceID), } } diff --git a/frontend/pkg/frontend/external_auth.go b/frontend/pkg/frontend/external_auth.go index bd338954f37..06d4b1a528b 100644 --- a/frontend/pkg/frontend/external_auth.go +++ b/frontend/pkg/frontend/external_auth.go @@ -210,6 +210,7 @@ func decodeDesiredExternalAuthCreate(ctx context.Context) (*api.HCPOpenShiftClus // ProxyResource info doesn't to come from the external resource information conversion.CopyReadOnlyProxyResourceValues(&newInternalExternalAuth.ProxyResource, ptr.To(arm.NewProxyResource(resourceID))) + newInternalExternalAuth.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. @@ -689,8 +690,11 @@ func (f *Frontend) getInternalExternalAuthFromStorage(ctx context.Context, resou // 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(internalExternalAuth.ID.String(), resourceID.String()) { - return nil, fmt.Errorf("unexpected resourceID: %s", internalExternalAuth.ID.String()) + if internalExternalAuth.ResourceID == nil { + return nil, fmt.Errorf("stored externalauth document is missing cosmosMetadata.resourceID") + } + if !strings.EqualFold(internalExternalAuth.ResourceID.String(), resourceID.String()) { + return nil, fmt.Errorf("unexpected resourceID: %s", internalExternalAuth.ResourceID.String()) } internalExternalAuth.ID = resourceID diff --git a/internal/api/types_externalauth.go b/internal/api/types_externalauth.go index 923f30b3d38..6bd1ffaac15 100644 --- a/internal/api/types_externalauth.go +++ b/internal/api/types_externalauth.go @@ -17,7 +17,6 @@ package api import ( "time" - "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" @@ -27,16 +26,11 @@ import ( // OpenShift clusters. // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type HCPOpenShiftClusterExternalAuth struct { + CosmosMetadata `json:"cosmosMetadata"` + arm.ProxyResource Properties HCPOpenShiftClusterExternalAuthProperties `json:"properties"` ServiceProviderProperties HCPOpenShiftClusterExternalAuthServiceProviderProperties `json:"serviceProviderProperties,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 CosmosToInternalExternalAuth() conversion function. - // We carry it across the API boundary between ExternalAuth (the direct cosmos db type) and HCPOpenShiftClusterExternalAuth (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 - // HCPOpenShiftClusterExternalAuth. - CosmosETag azcore.ETag `json:"-"` } // EnsureDefaults fills in default values for fields that may be absent in @@ -55,14 +49,6 @@ func (ea *HCPOpenShiftClusterExternalAuth) EnsureDefaults() { var _ arm.CosmosPersistable = &HCPOpenShiftClusterExternalAuth{} -func (o *HCPOpenShiftClusterExternalAuth) 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 HCPOpenShiftClusterExternalAuthProperties struct { @@ -74,7 +60,6 @@ type HCPOpenShiftClusterExternalAuthProperties struct { } type HCPOpenShiftClusterExternalAuthServiceProviderProperties 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..22b5eb1c297 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. @@ -88,7 +96,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 = nil - j.ExistingCosmosUID = "" }, func(j *api.CustomerPlatformProfile, c randfill.Continue) { c.FillNoCustom(j) diff --git a/internal/api/v20240610preview/external_auth_methods.go b/internal/api/v20240610preview/external_auth_methods.go index 001226ca97f..7408a81d6e7 100644 --- a/internal/api/v20240610preview/external_auth_methods.go +++ b/internal/api/v20240610preview/external_auth_methods.go @@ -64,6 +64,7 @@ func (h *ExternalAuth) ConvertToInternal(existing *api.HCPOpenShiftClusterExtern 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 @@ -327,8 +328,8 @@ func (v version) NewHCPOpenShiftClusterExternalAuth(from *api.HCPOpenShiftCluste } idString := "" - if from.ID != nil { - idString = from.ID.String() + if from.ResourceID != nil { + idString = from.ResourceID.String() } out := &ExternalAuth{ diff --git a/internal/api/v20251223preview/conversion_fuzz_test.go b/internal/api/v20251223preview/conversion_fuzz_test.go index 3940882dedb..b8a78fff56e 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 @@ -79,7 +87,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 = nil - j.ExistingCosmosUID = "" }, func(j *api.CustomerManagedEncryptionProfile, c randfill.Continue) { c.FillNoCustom(j) diff --git a/internal/api/v20251223preview/external_auth_methods.go b/internal/api/v20251223preview/external_auth_methods.go index b7f6824a5f5..3628912ffa4 100644 --- a/internal/api/v20251223preview/external_auth_methods.go +++ b/internal/api/v20251223preview/external_auth_methods.go @@ -64,6 +64,7 @@ func (h *ExternalAuth) ConvertToInternal(existing *api.HCPOpenShiftClusterExtern 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 @@ -315,8 +316,8 @@ func (v version) NewHCPOpenShiftClusterExternalAuth(from *api.HCPOpenShiftCluste } idString := "" - if from.ID != nil { - idString = from.ID.String() + if from.ResourceID != nil { + idString = from.ResourceID.String() } out := &ExternalAuth{ diff --git a/internal/api/zz_generated.deepcopy.go b/internal/api/zz_generated.deepcopy.go index 24c64d0e841..f3d1a968b89 100644 --- a/internal/api/zz_generated.deepcopy.go +++ b/internal/api/zz_generated.deepcopy.go @@ -506,6 +506,7 @@ func (in *HCPOpenShiftClusterCustomerProperties) DeepCopy() *HCPOpenShiftCluster // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *HCPOpenShiftClusterExternalAuth) DeepCopyInto(out *HCPOpenShiftClusterExternalAuth) { *out = *in + in.CosmosMetadata.DeepCopyInto(&out.CosmosMetadata) in.ProxyResource.DeepCopyInto(&out.ProxyResource) in.Properties.DeepCopyInto(&out.Properties) in.ServiceProviderProperties.DeepCopyInto(&out.ServiceProviderProperties) diff --git a/internal/conversion/readonly_externalauth.go b/internal/conversion/readonly_externalauth.go index 25c95740b65..0b85d7d77d2 100644 --- a/internal/conversion/readonly_externalauth.go +++ b/internal/conversion/readonly_externalauth.go @@ -29,8 +29,11 @@ func CopyReadOnlyProxyResourceValues(dest, src *arm.ProxyResource) { func CopyReadOnlyExternalAuthValues(dest, src *api.HCPOpenShiftClusterExternalAuth) { CopyReadOnlyProxyResourceValues(&dest.ProxyResource, &src.ProxyResource) + // 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() + dest.Properties.ProvisioningState = src.Properties.ProvisioningState dest.Properties.Condition = *src.Properties.Condition.DeepCopy() dest.ServiceProviderProperties = *src.ServiceProviderProperties.DeepCopy() - dest.CosmosETag = src.CosmosETag } diff --git a/internal/database/convert_cluster_test.go b/internal/database/convert_cluster_test.go index 2c886285514..3ea47c4a55c 100644 --- a/internal/database/convert_cluster_test.go +++ b/internal/database/convert_cluster_test.go @@ -140,7 +140,7 @@ func roundTripInternalToCosmosToInternal[InternalAPIType, CosmosAPIType any](t * case *api.HCPOpenShiftClusterNodePool: cast.ServiceProviderProperties.ExistingCosmosUID = "" case *api.HCPOpenShiftClusterExternalAuth: - cast.ServiceProviderProperties.ExistingCosmosUID = "" + cast.ExistingCosmosUID = "" } //finalJSON, _ := json.MarshalIndent(final, "", " ") diff --git a/internal/database/convert_externalauth.go b/internal/database/convert_externalauth.go index 7e95683e76e..cc9f027578f 100644 --- a/internal/database/convert_externalauth.go +++ b/internal/database/convert_externalauth.go @@ -21,7 +21,6 @@ import ( "k8s.io/utils/ptr" "github.com/Azure/ARO-HCP/internal/api" - "github.com/Azure/ARO-HCP/internal/api/arm" ) func InternalToCosmosExternalAuth(internalObj *api.HCPOpenShiftClusterExternalAuth) (*ExternalAuth, error) { @@ -29,22 +28,26 @@ func InternalToCosmosExternalAuth(internalObj *api.HCPOpenShiftClusterExternalAu return nil, nil } + // CosmosMetadata.ResourceID is the canonical identifier for cosmos-side + // concerns (partitioning, document UID, resource-type indexing). Use it + // instead of the ProxyResource.ID, which is an ARM-surface concern. + cosmosResourceID := internalObj.GetCosmosData().ResourceID + if cosmosResourceID == nil { + return nil, fmt.Errorf("internalObj is missing CosmosMetadata.ResourceID") + } cosmosObj := &ExternalAuth{ TypedDocument: TypedDocument{ BaseDocument: BaseDocument{ ID: internalObj.GetCosmosData().GetCosmosUID(), }, - PartitionKey: strings.ToLower(internalObj.ID.SubscriptionID), - ResourceID: internalObj.ID, - ResourceType: internalObj.ID.ResourceType.String(), + PartitionKey: strings.ToLower(cosmosResourceID.SubscriptionID), + ResourceID: cosmosResourceID, + ResourceType: cosmosResourceID.ResourceType.String(), }, ExternalAuthProperties: ExternalAuthProperties{ HCPOpenShiftClusterExternalAuth: *internalObj, - CosmosMetadata: api.CosmosMetadata{ - ResourceID: internalObj.ID, - }, IntermediateResourceDoc: &ResourceDocument{ - ResourceID: internalObj.ID, + ResourceID: cosmosResourceID, InternalID: ptr.Deref(internalObj.ServiceProviderProperties.ClusterServiceID, api.InternalID{}), ActiveOperationID: internalObj.ServiceProviderProperties.ActiveOperationID, ProvisioningState: internalObj.Properties.ProvisioningState, @@ -59,6 +62,8 @@ func InternalToCosmosExternalAuth(internalObj *api.HCPOpenShiftClusterExternalAu }, } + cosmosObj.InternalState.InternalAPI.CosmosMetadata = api.CosmosMetadata{} + return cosmosObj, nil } @@ -66,38 +71,17 @@ func CosmosToInternalExternalAuth(cosmosObj *ExternalAuth) (*api.HCPOpenShiftClu 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.ProxyResource = arm.ProxyResource{ - Resource: arm.Resource{ - ID: resourceDoc.ResourceID, - Name: resourceDoc.ResourceID.Name, - Type: resourceDoc.ResourceID.ResourceType.String(), - SystemData: resourceDoc.SystemData, - }, + internalObj := cosmosObj.DeepCopy() + internalObj.ExistingCosmosUID = cosmosObj.ID + internalObj.SetEtag(cosmosObj.CosmosETag) + if internalObj.GetResourceID() == nil { + if cosmosObj.ResourceID != nil { + internalObj.SetResourceID(cosmosObj.ResourceID) + } else { + return nil, fmt.Errorf("internalObj is missing a resourceID: %T: %q", cosmosObj, cosmosObj.ID) + } } - // 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 - // HCPOpenShiftClusterExternalAuth. - internalObj.CosmosETag = cosmosObj.BaseDocument.CosmosETag - internalObj.Properties.ProvisioningState = resourceDoc.ProvisioningState - internalObj.SystemData = resourceDoc.SystemData - internalObj.ServiceProviderProperties.ExistingCosmosUID = cosmosObj.ID - if len(resourceDoc.InternalID.String()) == 0 { - // preserve the nil on read - internalObj.ServiceProviderProperties.ClusterServiceID = nil - } else { - internalObj.ServiceProviderProperties.ClusterServiceID = &resourceDoc.InternalID - } - - internalObj.ServiceProviderProperties.ActiveOperationID = resourceDoc.ActiveOperationID internalObj.EnsureDefaults() diff --git a/internal/database/convert_externalauth_test.go b/internal/database/convert_externalauth_test.go index 57e8683348a..0810a719c52 100644 --- a/internal/database/convert_externalauth_test.go +++ b/internal/database/convert_externalauth_test.go @@ -54,13 +54,17 @@ func TestRoundTripExternalAuthInternalCosmosInternal(t *testing.T) { foo := api.Must(api.NewInternalID("/api/aro_hcp/v1alpha1/clusters/" + clusterID + "/external_auth_config/external_auths/" + externalAuthID)) j.ClusterServiceID = &foo }, + func(j *api.CosmosMetadata, c randfill.Continue) { + c.FillNoCustom(j) + j.ResourceID = api.Must(azcorearm.ParseResourceID("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRg")) + j.ExistingCosmosUID = "" + j.CosmosETag = "" + }, func(j *api.HCPOpenShiftClusterExternalAuth, 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.Claim.Mappings.Username.PrefixPolicy) == 0 { @@ -98,6 +102,11 @@ func TestCosmosToInternalExternalAuthPreservesETag(t *testing.T) { }, }, ExternalAuthProperties: ExternalAuthProperties{ + HCPOpenShiftClusterExternalAuth: api.HCPOpenShiftClusterExternalAuth{ + CosmosMetadata: arm.CosmosMetadata{ + ResourceID: resourceID, + }, + }, IntermediateResourceDoc: &ResourceDocument{ ResourceID: resourceID, }, diff --git a/internal/database/types_externalauth.go b/internal/database/types_externalauth.go index acda4f2338a..e952c06f0b4 100644 --- a/internal/database/types_externalauth.go +++ b/internal/database/types_externalauth.go @@ -25,16 +25,12 @@ type ExternalAuth struct { } type ExternalAuthProperties struct { - // HCPOpenShiftClusterExternalAuth is where we're migrating to. It is compatible with a GenericDocument[api.HCPOpenShiftClusterExternalAuth] - // which is where we want to end up. - // * to be compatible with prior versions, we must continue writing all previous fields and this new field - // * to be compatible with prior versions, we must continue reading only from previous fields + // HCPOpenShiftClusterExternalAuth is the inline serialization that mirrors GenericDocument[api.HCPOpenShiftClusterExternalAuth] + // (the destination shape for externalauth documents). The reading path now uses these inline fields as the + // source of truth; the IntermediateResourceDoc/InternalState siblings are still written for compatibility + // with old readers, but will be removed once all readers have migrated. api.HCPOpenShiftClusterExternalAuth `json:",inline"` - // 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 cosmosMetadata.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"` diff --git a/internal/validation/validate_externalauth_comprehensive_test.go b/internal/validation/validate_externalauth_comprehensive_test.go index a80ef5752d8..26c5e3a89e8 100644 --- a/internal/validation/validate_externalauth_comprehensive_test.go +++ b/internal/validation/validate_externalauth_comprehensive_test.go @@ -718,6 +718,7 @@ func createMinimalExternalAuth() *api.HCPOpenShiftClusterExternalAuth { func createValidExternalAuth() *api.HCPOpenShiftClusterExternalAuth { createdAt := time.Date(2025, 1, 1, 0, 0, 0, 0, time.UTC) return &api.HCPOpenShiftClusterExternalAuth{ + CosmosMetadata: arm.CosmosMetadata{ResourceID: api.Must(azcorearm.ParseResourceID("/subscriptions/test-sub/resourceGroups/test-rg/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/test-cluster/externalAuths/test-auth"))}, ProxyResource: arm.ProxyResource{ Resource: arm.Resource{ ID: api.Must(azcorearm.ParseResourceID("/subscriptions/test-sub/resourceGroups/test-rg/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/test-cluster/externalAuths/test-auth")), diff --git a/test-integration/utils/databasemutationhelpers/per_resource_comparer.go b/test-integration/utils/databasemutationhelpers/per_resource_comparer.go index 579174dd6c2..ecdca7de065 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, nodepool, externalauth - randomly generated by cluster-service mock unstructured.RemoveNestedField(currMap, prepend(possiblePrepend, "internalState", "internalAPI", "systemData", "createdAt")...) // cluster, nodepool, externalauth - varies on every run unstructured.RemoveNestedField(currMap, prepend(possiblePrepend, "internalState", "internalAPI", "systemData", "lastModifiedAt")...) // cluster, nodepool, externalauth - varies on every run + unstructured.RemoveNestedField(currMap, prepend(possiblePrepend, "internalState", "internalAPI", "cosmosMetadata")...) // cluster, nodepool, externalauth - redundant copy of inline cosmosMetadata unstructured.RemoveNestedField(currMap, prepend(possiblePrepend, "cosmosMetadata", "etag")...) // inline serialization (cluster, nodepool, externalauth) also exposes these UUID-generated / variable fields directly under properties From 7291a8eac7bc279163b98e6ab37792739699f31a Mon Sep 17 00:00:00 2001 From: David Eads Date: Mon, 11 May 2026 11:39:38 -0400 Subject: [PATCH 3/3] stop serializing old externalauth fields Co-Authored-By: Claude Opus 4.7 (1M context) --- .../convert_defaults_consistency_test.go | 21 +++--- internal/database/convert_externalauth.go | 17 ----- .../database/convert_externalauth_test.go | 3 - internal/database/types_externalauth.go | 18 +---- .../externalauth-default.json | 73 ------------------- .../externalauth-default.json | 73 ------------------- .../externalauth-default.json | 73 ------------------- .../externalauth-default.json | 73 ------------------- .../externalauth-default.json | 73 ------------------- .../externalauth-default.json | 73 ------------------- .../basic-external-auth-auth.json | 51 ------------- .../basic-external-auth-auth.json | 51 ------------- .../basic-external-auth-auth.json | 51 ------------- .../basic-external-auth-auth.json | 51 ------------- .../externalauth-default.json | 73 ------------------- .../externalauth-default.json | 73 ------------------- .../externalauth-default.json | 73 ------------------- .../externalauth-default.json | 73 ------------------- .../externalauth-default.json | 73 ------------------- .../externalauth-default.json | 73 ------------------- .../externalauth-default.json | 73 ------------------- 21 files changed, 15 insertions(+), 1197 deletions(-) diff --git a/internal/database/convert_defaults_consistency_test.go b/internal/database/convert_defaults_consistency_test.go index 0090a7ebb6b..85b80d6f2b1 100644 --- a/internal/database/convert_defaults_consistency_test.go +++ b/internal/database/convert_defaults_consistency_test.go @@ -585,21 +585,24 @@ func TestPreExistingDataExternalAuth(t *testing.T) { "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/cluster/externalAuths/default", )) + internalID := api.Must(api.NewInternalID("/api/aro_hcp/v1alpha1/clusters/test-cluster/external_auth_config/external_auths/default")) preExistingDoc := &ExternalAuth{ TypedDocument: TypedDocument{ BaseDocument: BaseDocument{ID: "test-doc-id"}, ResourceID: resourceID, }, ExternalAuthProperties: ExternalAuthProperties{ - IntermediateResourceDoc: &ResourceDocument{ - ResourceID: resourceID, - InternalID: api.Must(api.NewInternalID("/api/aro_hcp/v1alpha1/clusters/test-cluster/external_auth_config/external_auths/default")), - ProvisioningState: arm.ProvisioningStateSucceeded, - }, - InternalState: ExternalAuthInternalState{ - InternalAPI: api.HCPOpenShiftClusterExternalAuth{ - // PrefixPolicy is intentionally zero-valued to simulate - // a pre-existing document that predates the field. + HCPOpenShiftClusterExternalAuth: api.HCPOpenShiftClusterExternalAuth{ + // PrefixPolicy is intentionally zero-valued to simulate + // a pre-existing document that predates the field. + CosmosMetadata: arm.CosmosMetadata{ + ResourceID: resourceID, + }, + Properties: api.HCPOpenShiftClusterExternalAuthProperties{ + ProvisioningState: arm.ProvisioningStateSucceeded, + }, + ServiceProviderProperties: api.HCPOpenShiftClusterExternalAuthServiceProviderProperties{ + ClusterServiceID: &internalID, }, }, }, diff --git a/internal/database/convert_externalauth.go b/internal/database/convert_externalauth.go index cc9f027578f..2681e9e885e 100644 --- a/internal/database/convert_externalauth.go +++ b/internal/database/convert_externalauth.go @@ -18,8 +18,6 @@ import ( "fmt" "strings" - "k8s.io/utils/ptr" - "github.com/Azure/ARO-HCP/internal/api" ) @@ -46,24 +44,9 @@ func InternalToCosmosExternalAuth(internalObj *api.HCPOpenShiftClusterExternalAu }, ExternalAuthProperties: ExternalAuthProperties{ HCPOpenShiftClusterExternalAuth: *internalObj, - IntermediateResourceDoc: &ResourceDocument{ - ResourceID: cosmosResourceID, - InternalID: ptr.Deref(internalObj.ServiceProviderProperties.ClusterServiceID, api.InternalID{}), - ActiveOperationID: internalObj.ServiceProviderProperties.ActiveOperationID, - ProvisioningState: internalObj.Properties.ProvisioningState, - Identity: nil, - SystemData: internalObj.SystemData, - Tags: nil, - }, - - InternalState: ExternalAuthInternalState{ - InternalAPI: *internalObj, - }, }, } - cosmosObj.InternalState.InternalAPI.CosmosMetadata = api.CosmosMetadata{} - return cosmosObj, nil } diff --git a/internal/database/convert_externalauth_test.go b/internal/database/convert_externalauth_test.go index 0810a719c52..9d7b21fa805 100644 --- a/internal/database/convert_externalauth_test.go +++ b/internal/database/convert_externalauth_test.go @@ -107,9 +107,6 @@ func TestCosmosToInternalExternalAuthPreservesETag(t *testing.T) { ResourceID: resourceID, }, }, - IntermediateResourceDoc: &ResourceDocument{ - ResourceID: resourceID, - }, }, } diff --git a/internal/database/types_externalauth.go b/internal/database/types_externalauth.go index e952c06f0b4..65ddfcfbfd9 100644 --- a/internal/database/types_externalauth.go +++ b/internal/database/types_externalauth.go @@ -25,22 +25,10 @@ type ExternalAuth struct { } type ExternalAuthProperties struct { - // HCPOpenShiftClusterExternalAuth is the inline serialization that mirrors GenericDocument[api.HCPOpenShiftClusterExternalAuth] - // (the destination shape for externalauth documents). The reading path now uses these inline fields as the - // source of truth; the IntermediateResourceDoc/InternalState siblings are still written for compatibility - // with old readers, but will be removed once all readers have migrated. + // HCPOpenShiftClusterExternalAuth is inlined directly. The on-disk shape now matches + // GenericDocument[api.HCPOpenShiftClusterExternalAuth] and ExternalAuth only exists as a + // distinct type while the migration to that generic surface completes. api.HCPOpenShiftClusterExternalAuth `json:",inline"` - - // 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 ExternalAuthInternalState `json:"internalState"` -} - -type ExternalAuthInternalState struct { - InternalAPI api.HCPOpenShiftClusterExternalAuth `json:"internalAPI"` } func (o *ExternalAuth) GetTypedDocument() *TypedDocument { diff --git a/test-integration/backend/controllers/mismatches/artifacts/cluster/remove_orphaned_cluster_descendents/00-load-initial-state/externalauth-default.json b/test-integration/backend/controllers/mismatches/artifacts/cluster/remove_orphaned_cluster_descendents/00-load-initial-state/externalauth-default.json index afced65a6d4..a770a369e4f 100644 --- a/test-integration/backend/controllers/mismatches/artifacts/cluster/remove_orphaned_cluster_descendents/00-load-initial-state/externalauth-default.json +++ b/test-integration/backend/controllers/mismatches/artifacts/cluster/remove_orphaned_cluster_descendents/00-load-initial-state/externalauth-default.json @@ -8,79 +8,6 @@ "partitionKey": "a433a095-1277-44f1-8453-8d61a4d848c2", "properties": { "id": "/subscriptions/a433a095-1277-44f1-8453-8d61a4d848c2/resourceGroups/unimportantpostponement/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/monstrousprecinct/externalAuths/default", - "intermediateResourceDoc": { - "activeOperationId": "ea807c13-7e15-43d4-b760-69ef7e31d273", - "internalId": "/api/clusters_mgmt/v1/clusters/swzpxg6nxn/external_auth_config/external_auths/5fghjjqxvd", - "provisioningState": "Accepted", - "resourceId": "/subscriptions/a433a095-1277-44f1-8453-8d61a4d848c2/resourceGroups/unimportantpostponement/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/monstrousprecinct/externalAuths/default", - "systemData": { - "createdBy": "Unknown-ARO-HCP-frontend", - "createdByType": "Application", - "lastModifiedBy": "Unknown-ARO-HCP-frontend", - "lastModifiedByType": "Application" - } - }, - "internalState": { - "internalAPI": { - "id": "/subscriptions/a433a095-1277-44f1-8453-8d61a4d848c2/resourceGroups/unimportantpostponement/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/monstrousprecinct/externalAuths/default", - "name": "default", - "properties": { - "claim": { - "mappings": { - "groups": { - "claim": "groups", - "prefix": "" - }, - "username": { - "claim": "sub", - "prefix": "prefix-", - "prefixPolicy": "Prefix" - } - }, - "validationRules": [] - }, - "clients": [ - { - "clientId": "87654321-4321-4321-4321-abcdefghijkl", - "component": { - "authClientNamespace": "openshift-console", - "name": "console" - }, - "extraScopes": [], - "type": "Confidential" - }, - { - "clientId": "87654321-4321-4321-4321-abcdefghijkl", - "component": { - "authClientNamespace": "openshift-console", - "name": "cli" - }, - "extraScopes": [], - "type": "Public" - } - ], - "issuer": { - "audiences": [ - "87654321-4321-4321-4321-abcdefghijkl" - ], - "ca": "", - "url": "https://login.microsoftonline.com/12345678-1234-1234-1234-123456789abc/v2.0" - }, - "provisioningState": "Accepted" - }, - "serviceProviderProperties": { - "activeOperationId": "ea807c13-7e15-43d4-b760-69ef7e31d273", - "clusterServiceID": "" - }, - "systemData": { - "createdBy": "Unknown-ARO-HCP-frontend", - "createdByType": "Application", - "lastModifiedBy": "Unknown-ARO-HCP-frontend", - "lastModifiedByType": "Application" - }, - "type": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/externalAuths" - } - }, "name": "default", "properties": { "claim": { diff --git a/test-integration/backend/controllers/mismatches/artifacts/externalauth/present_externalauth/00-load-initial-state/externalauth-default.json b/test-integration/backend/controllers/mismatches/artifacts/externalauth/present_externalauth/00-load-initial-state/externalauth-default.json index 8ee62566da9..9f13dc4134b 100644 --- a/test-integration/backend/controllers/mismatches/artifacts/externalauth/present_externalauth/00-load-initial-state/externalauth-default.json +++ b/test-integration/backend/controllers/mismatches/artifacts/externalauth/present_externalauth/00-load-initial-state/externalauth-default.json @@ -8,79 +8,6 @@ "partitionKey": "a433a095-1277-44f1-8453-8d61a4d848c2", "properties": { "id": "/subscriptions/a433a095-1277-44f1-8453-8d61a4d848c2/resourceGroups/unimportantpostponement/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/monstrousprecinct/externalAuths/default", - "intermediateResourceDoc": { - "activeOperationId": "ea807c13-7e15-43d4-b760-69ef7e31d273", - "internalId": "/api/clusters_mgmt/v1/clusters/1243e9e9-d150-4ef1-9735-2bbc3cabc7d0/external_auth_config/external_auths/5fghjjqxvd", - "provisioningState": "Accepted", - "resourceId": "/subscriptions/a433a095-1277-44f1-8453-8d61a4d848c2/resourceGroups/unimportantpostponement/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/monstrousprecinct/externalAuths/default", - "systemData": { - "createdBy": "Unknown-ARO-HCP-frontend", - "createdByType": "Application", - "lastModifiedBy": "Unknown-ARO-HCP-frontend", - "lastModifiedByType": "Application" - } - }, - "internalState": { - "internalAPI": { - "id": "/subscriptions/a433a095-1277-44f1-8453-8d61a4d848c2/resourceGroups/unimportantpostponement/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/monstrousprecinct/externalAuths/default", - "name": "default", - "properties": { - "claim": { - "mappings": { - "groups": { - "claim": "groups", - "prefix": "" - }, - "username": { - "claim": "sub", - "prefix": "prefix-", - "prefixPolicy": "Prefix" - } - }, - "validationRules": [] - }, - "clients": [ - { - "clientId": "87654321-4321-4321-4321-abcdefghijkl", - "component": { - "authClientNamespace": "openshift-console", - "name": "console" - }, - "extraScopes": [], - "type": "Confidential" - }, - { - "clientId": "87654321-4321-4321-4321-abcdefghijkl", - "component": { - "authClientNamespace": "openshift-console", - "name": "cli" - }, - "extraScopes": [], - "type": "Public" - } - ], - "issuer": { - "audiences": [ - "87654321-4321-4321-4321-abcdefghijkl" - ], - "ca": "", - "url": "https://login.microsoftonline.com/12345678-1234-1234-1234-123456789abc/v2.0" - }, - "provisioningState": "Accepted" - }, - "serviceProviderProperties": { - "activeOperationId": "ea807c13-7e15-43d4-b760-69ef7e31d273", - "clusterServiceID": "" - }, - "systemData": { - "createdBy": "Unknown-ARO-HCP-frontend", - "createdByType": "Application", - "lastModifiedBy": "Unknown-ARO-HCP-frontend", - "lastModifiedByType": "Application" - }, - "type": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/externalAuths" - } - }, "name": "default", "properties": { "claim": { diff --git a/test-integration/backend/controllers/mismatches/artifacts/externalauth/present_externalauth/99-cosmosCompare-end-state/externalauth-default.json b/test-integration/backend/controllers/mismatches/artifacts/externalauth/present_externalauth/99-cosmosCompare-end-state/externalauth-default.json index 8ee62566da9..9f13dc4134b 100644 --- a/test-integration/backend/controllers/mismatches/artifacts/externalauth/present_externalauth/99-cosmosCompare-end-state/externalauth-default.json +++ b/test-integration/backend/controllers/mismatches/artifacts/externalauth/present_externalauth/99-cosmosCompare-end-state/externalauth-default.json @@ -8,79 +8,6 @@ "partitionKey": "a433a095-1277-44f1-8453-8d61a4d848c2", "properties": { "id": "/subscriptions/a433a095-1277-44f1-8453-8d61a4d848c2/resourceGroups/unimportantpostponement/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/monstrousprecinct/externalAuths/default", - "intermediateResourceDoc": { - "activeOperationId": "ea807c13-7e15-43d4-b760-69ef7e31d273", - "internalId": "/api/clusters_mgmt/v1/clusters/1243e9e9-d150-4ef1-9735-2bbc3cabc7d0/external_auth_config/external_auths/5fghjjqxvd", - "provisioningState": "Accepted", - "resourceId": "/subscriptions/a433a095-1277-44f1-8453-8d61a4d848c2/resourceGroups/unimportantpostponement/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/monstrousprecinct/externalAuths/default", - "systemData": { - "createdBy": "Unknown-ARO-HCP-frontend", - "createdByType": "Application", - "lastModifiedBy": "Unknown-ARO-HCP-frontend", - "lastModifiedByType": "Application" - } - }, - "internalState": { - "internalAPI": { - "id": "/subscriptions/a433a095-1277-44f1-8453-8d61a4d848c2/resourceGroups/unimportantpostponement/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/monstrousprecinct/externalAuths/default", - "name": "default", - "properties": { - "claim": { - "mappings": { - "groups": { - "claim": "groups", - "prefix": "" - }, - "username": { - "claim": "sub", - "prefix": "prefix-", - "prefixPolicy": "Prefix" - } - }, - "validationRules": [] - }, - "clients": [ - { - "clientId": "87654321-4321-4321-4321-abcdefghijkl", - "component": { - "authClientNamespace": "openshift-console", - "name": "console" - }, - "extraScopes": [], - "type": "Confidential" - }, - { - "clientId": "87654321-4321-4321-4321-abcdefghijkl", - "component": { - "authClientNamespace": "openshift-console", - "name": "cli" - }, - "extraScopes": [], - "type": "Public" - } - ], - "issuer": { - "audiences": [ - "87654321-4321-4321-4321-abcdefghijkl" - ], - "ca": "", - "url": "https://login.microsoftonline.com/12345678-1234-1234-1234-123456789abc/v2.0" - }, - "provisioningState": "Accepted" - }, - "serviceProviderProperties": { - "activeOperationId": "ea807c13-7e15-43d4-b760-69ef7e31d273", - "clusterServiceID": "" - }, - "systemData": { - "createdBy": "Unknown-ARO-HCP-frontend", - "createdByType": "Application", - "lastModifiedBy": "Unknown-ARO-HCP-frontend", - "lastModifiedByType": "Application" - }, - "type": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/externalAuths" - } - }, "name": "default", "properties": { "claim": { diff --git a/test-integration/backend/controllers/mismatches/artifacts/externalauth/remove_orphaned_externalauth_descendents/00-load-initial-state/externalauth-default.json b/test-integration/backend/controllers/mismatches/artifacts/externalauth/remove_orphaned_externalauth_descendents/00-load-initial-state/externalauth-default.json index 8ee62566da9..9f13dc4134b 100644 --- a/test-integration/backend/controllers/mismatches/artifacts/externalauth/remove_orphaned_externalauth_descendents/00-load-initial-state/externalauth-default.json +++ b/test-integration/backend/controllers/mismatches/artifacts/externalauth/remove_orphaned_externalauth_descendents/00-load-initial-state/externalauth-default.json @@ -8,79 +8,6 @@ "partitionKey": "a433a095-1277-44f1-8453-8d61a4d848c2", "properties": { "id": "/subscriptions/a433a095-1277-44f1-8453-8d61a4d848c2/resourceGroups/unimportantpostponement/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/monstrousprecinct/externalAuths/default", - "intermediateResourceDoc": { - "activeOperationId": "ea807c13-7e15-43d4-b760-69ef7e31d273", - "internalId": "/api/clusters_mgmt/v1/clusters/1243e9e9-d150-4ef1-9735-2bbc3cabc7d0/external_auth_config/external_auths/5fghjjqxvd", - "provisioningState": "Accepted", - "resourceId": "/subscriptions/a433a095-1277-44f1-8453-8d61a4d848c2/resourceGroups/unimportantpostponement/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/monstrousprecinct/externalAuths/default", - "systemData": { - "createdBy": "Unknown-ARO-HCP-frontend", - "createdByType": "Application", - "lastModifiedBy": "Unknown-ARO-HCP-frontend", - "lastModifiedByType": "Application" - } - }, - "internalState": { - "internalAPI": { - "id": "/subscriptions/a433a095-1277-44f1-8453-8d61a4d848c2/resourceGroups/unimportantpostponement/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/monstrousprecinct/externalAuths/default", - "name": "default", - "properties": { - "claim": { - "mappings": { - "groups": { - "claim": "groups", - "prefix": "" - }, - "username": { - "claim": "sub", - "prefix": "prefix-", - "prefixPolicy": "Prefix" - } - }, - "validationRules": [] - }, - "clients": [ - { - "clientId": "87654321-4321-4321-4321-abcdefghijkl", - "component": { - "authClientNamespace": "openshift-console", - "name": "console" - }, - "extraScopes": [], - "type": "Confidential" - }, - { - "clientId": "87654321-4321-4321-4321-abcdefghijkl", - "component": { - "authClientNamespace": "openshift-console", - "name": "cli" - }, - "extraScopes": [], - "type": "Public" - } - ], - "issuer": { - "audiences": [ - "87654321-4321-4321-4321-abcdefghijkl" - ], - "ca": "", - "url": "https://login.microsoftonline.com/12345678-1234-1234-1234-123456789abc/v2.0" - }, - "provisioningState": "Accepted" - }, - "serviceProviderProperties": { - "activeOperationId": "ea807c13-7e15-43d4-b760-69ef7e31d273", - "clusterServiceID": "" - }, - "systemData": { - "createdBy": "Unknown-ARO-HCP-frontend", - "createdByType": "Application", - "lastModifiedBy": "Unknown-ARO-HCP-frontend", - "lastModifiedByType": "Application" - }, - "type": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/externalAuths" - } - }, "name": "default", "properties": { "claim": { diff --git a/test-integration/backend/controllers/mismatches/artifacts/nodepool/remove_orphaned_nodepool_descendents/00-load-initial-state/externalauth-default.json b/test-integration/backend/controllers/mismatches/artifacts/nodepool/remove_orphaned_nodepool_descendents/00-load-initial-state/externalauth-default.json index afced65a6d4..a770a369e4f 100644 --- a/test-integration/backend/controllers/mismatches/artifacts/nodepool/remove_orphaned_nodepool_descendents/00-load-initial-state/externalauth-default.json +++ b/test-integration/backend/controllers/mismatches/artifacts/nodepool/remove_orphaned_nodepool_descendents/00-load-initial-state/externalauth-default.json @@ -8,79 +8,6 @@ "partitionKey": "a433a095-1277-44f1-8453-8d61a4d848c2", "properties": { "id": "/subscriptions/a433a095-1277-44f1-8453-8d61a4d848c2/resourceGroups/unimportantpostponement/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/monstrousprecinct/externalAuths/default", - "intermediateResourceDoc": { - "activeOperationId": "ea807c13-7e15-43d4-b760-69ef7e31d273", - "internalId": "/api/clusters_mgmt/v1/clusters/swzpxg6nxn/external_auth_config/external_auths/5fghjjqxvd", - "provisioningState": "Accepted", - "resourceId": "/subscriptions/a433a095-1277-44f1-8453-8d61a4d848c2/resourceGroups/unimportantpostponement/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/monstrousprecinct/externalAuths/default", - "systemData": { - "createdBy": "Unknown-ARO-HCP-frontend", - "createdByType": "Application", - "lastModifiedBy": "Unknown-ARO-HCP-frontend", - "lastModifiedByType": "Application" - } - }, - "internalState": { - "internalAPI": { - "id": "/subscriptions/a433a095-1277-44f1-8453-8d61a4d848c2/resourceGroups/unimportantpostponement/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/monstrousprecinct/externalAuths/default", - "name": "default", - "properties": { - "claim": { - "mappings": { - "groups": { - "claim": "groups", - "prefix": "" - }, - "username": { - "claim": "sub", - "prefix": "prefix-", - "prefixPolicy": "Prefix" - } - }, - "validationRules": [] - }, - "clients": [ - { - "clientId": "87654321-4321-4321-4321-abcdefghijkl", - "component": { - "authClientNamespace": "openshift-console", - "name": "console" - }, - "extraScopes": [], - "type": "Confidential" - }, - { - "clientId": "87654321-4321-4321-4321-abcdefghijkl", - "component": { - "authClientNamespace": "openshift-console", - "name": "cli" - }, - "extraScopes": [], - "type": "Public" - } - ], - "issuer": { - "audiences": [ - "87654321-4321-4321-4321-abcdefghijkl" - ], - "ca": "", - "url": "https://login.microsoftonline.com/12345678-1234-1234-1234-123456789abc/v2.0" - }, - "provisioningState": "Accepted" - }, - "serviceProviderProperties": { - "activeOperationId": "ea807c13-7e15-43d4-b760-69ef7e31d273", - "clusterServiceID": "" - }, - "systemData": { - "createdBy": "Unknown-ARO-HCP-frontend", - "createdByType": "Application", - "lastModifiedBy": "Unknown-ARO-HCP-frontend", - "lastModifiedByType": "Application" - }, - "type": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/externalAuths" - } - }, "name": "default", "properties": { "claim": { diff --git a/test-integration/backend/controllers/mismatches/artifacts/nodepool/remove_orphaned_nodepool_descendents/99-cosmosCompare-end-state/externalauth-default.json b/test-integration/backend/controllers/mismatches/artifacts/nodepool/remove_orphaned_nodepool_descendents/99-cosmosCompare-end-state/externalauth-default.json index afced65a6d4..a770a369e4f 100644 --- a/test-integration/backend/controllers/mismatches/artifacts/nodepool/remove_orphaned_nodepool_descendents/99-cosmosCompare-end-state/externalauth-default.json +++ b/test-integration/backend/controllers/mismatches/artifacts/nodepool/remove_orphaned_nodepool_descendents/99-cosmosCompare-end-state/externalauth-default.json @@ -8,79 +8,6 @@ "partitionKey": "a433a095-1277-44f1-8453-8d61a4d848c2", "properties": { "id": "/subscriptions/a433a095-1277-44f1-8453-8d61a4d848c2/resourceGroups/unimportantpostponement/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/monstrousprecinct/externalAuths/default", - "intermediateResourceDoc": { - "activeOperationId": "ea807c13-7e15-43d4-b760-69ef7e31d273", - "internalId": "/api/clusters_mgmt/v1/clusters/swzpxg6nxn/external_auth_config/external_auths/5fghjjqxvd", - "provisioningState": "Accepted", - "resourceId": "/subscriptions/a433a095-1277-44f1-8453-8d61a4d848c2/resourceGroups/unimportantpostponement/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/monstrousprecinct/externalAuths/default", - "systemData": { - "createdBy": "Unknown-ARO-HCP-frontend", - "createdByType": "Application", - "lastModifiedBy": "Unknown-ARO-HCP-frontend", - "lastModifiedByType": "Application" - } - }, - "internalState": { - "internalAPI": { - "id": "/subscriptions/a433a095-1277-44f1-8453-8d61a4d848c2/resourceGroups/unimportantpostponement/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/monstrousprecinct/externalAuths/default", - "name": "default", - "properties": { - "claim": { - "mappings": { - "groups": { - "claim": "groups", - "prefix": "" - }, - "username": { - "claim": "sub", - "prefix": "prefix-", - "prefixPolicy": "Prefix" - } - }, - "validationRules": [] - }, - "clients": [ - { - "clientId": "87654321-4321-4321-4321-abcdefghijkl", - "component": { - "authClientNamespace": "openshift-console", - "name": "console" - }, - "extraScopes": [], - "type": "Confidential" - }, - { - "clientId": "87654321-4321-4321-4321-abcdefghijkl", - "component": { - "authClientNamespace": "openshift-console", - "name": "cli" - }, - "extraScopes": [], - "type": "Public" - } - ], - "issuer": { - "audiences": [ - "87654321-4321-4321-4321-abcdefghijkl" - ], - "ca": "", - "url": "https://login.microsoftonline.com/12345678-1234-1234-1234-123456789abc/v2.0" - }, - "provisioningState": "Accepted" - }, - "serviceProviderProperties": { - "activeOperationId": "ea807c13-7e15-43d4-b760-69ef7e31d273", - "clusterServiceID": "" - }, - "systemData": { - "createdBy": "Unknown-ARO-HCP-frontend", - "createdByType": "Application", - "lastModifiedBy": "Unknown-ARO-HCP-frontend", - "lastModifiedByType": "Application" - }, - "type": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/externalAuths" - } - }, "name": "default", "properties": { "claim": { diff --git a/test-integration/frontend/artifacts/DatabaseCRUD/UntypedCRUD/basic/01-load-initial/basic-external-auth-auth.json b/test-integration/frontend/artifacts/DatabaseCRUD/UntypedCRUD/basic/01-load-initial/basic-external-auth-auth.json index 22b252c00a8..b065f76b829 100644 --- a/test-integration/frontend/artifacts/DatabaseCRUD/UntypedCRUD/basic/01-load-initial/basic-external-auth-auth.json +++ b/test-integration/frontend/artifacts/DatabaseCRUD/UntypedCRUD/basic/01-load-initial/basic-external-auth-auth.json @@ -8,57 +8,6 @@ "partitionKey": "f52dfea2-47ee-4396-8006-4a27d47d59c5", "properties": { "internalId": "/api/aro_hcp/v1alpha1/clusters/cs-basic-external-auth/external_auth_config/external_auths/2wbhxn4qwk", - "internalState": { - "internalAPI": { - "properties": { - "claim": { - "mappings": { - "groups": { - "claim": "groups", - "prefix": "" - }, - "username": { - "claim": "sub", - "prefix": "prefix-", - "prefixPolicy": "Prefix" - } - }, - "validationRules": [] - }, - "clients": [ - { - "clientId": "87654321-4321-4321-4321-abcdefghijkl", - "component": { - "authClientNamespace": "openshift-console", - "name": "console" - }, - "extraScopes": [], - "type": "Confidential" - }, - { - "clientId": "87654321-4321-4321-4321-abcdefghijkl", - "component": { - "authClientNamespace": "openshift-console", - "name": "cli" - }, - "extraScopes": [], - "type": "Public" - } - ], - "issuer": { - "audiences": [ - "87654321-4321-4321-4321-abcdefghijkl" - ], - "ca": "", - "url": "https://login.microsoftonline.com/12345678-1234-1234-1234-123456789abc/v2.0" - }, - "provisioningState": "" - }, - "serviceProviderProperties": { - "clusterServiceID": "" - } - } - }, "provisioningState": "Succeeded", "resourceId": "/subscriptions/f52dfea2-47ee-4396-8006-4a27d47d59c5/resourceGroups/some-resource-group/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/basic-external-auth/externalAuths/basic-external-auth", "systemData": { diff --git a/test-integration/frontend/artifacts/DatabaseCRUD/UntypedCRUD/basic/04-untypedListRecursive-resourcegroup/basic-external-auth-auth.json b/test-integration/frontend/artifacts/DatabaseCRUD/UntypedCRUD/basic/04-untypedListRecursive-resourcegroup/basic-external-auth-auth.json index 732f52ffc2e..02f5d830e9f 100644 --- a/test-integration/frontend/artifacts/DatabaseCRUD/UntypedCRUD/basic/04-untypedListRecursive-resourcegroup/basic-external-auth-auth.json +++ b/test-integration/frontend/artifacts/DatabaseCRUD/UntypedCRUD/basic/04-untypedListRecursive-resourcegroup/basic-external-auth-auth.json @@ -8,57 +8,6 @@ "partitionKey": "f52dfea2-47ee-4396-8006-4a27d47d59c5", "properties": { "internalId": "/api/aro_hcp/v1alpha1/clusters/cs-basic-external-auth/external_auth_config/external_auths/2wbhxn4qwk", - "internalState": { - "internalAPI": { - "properties": { - "claim": { - "mappings": { - "groups": { - "claim": "groups", - "prefix": "" - }, - "username": { - "claim": "sub", - "prefix": "prefix-", - "prefixPolicy": "Prefix" - } - }, - "validationRules": [] - }, - "clients": [ - { - "clientId": "87654321-4321-4321-4321-abcdefghijkl", - "component": { - "authClientNamespace": "openshift-console", - "name": "console" - }, - "extraScopes": [], - "type": "Confidential" - }, - { - "clientId": "87654321-4321-4321-4321-abcdefghijkl", - "component": { - "authClientNamespace": "openshift-console", - "name": "cli" - }, - "extraScopes": [], - "type": "Public" - } - ], - "issuer": { - "audiences": [ - "87654321-4321-4321-4321-abcdefghijkl" - ], - "ca": "", - "url": "https://login.microsoftonline.com/12345678-1234-1234-1234-123456789abc/v2.0" - }, - "provisioningState": "" - }, - "serviceProviderProperties": { - "clusterServiceID": "" - } - } - }, "provisioningState": "Succeeded", "resourceId": "/subscriptions/f52dfea2-47ee-4396-8006-4a27d47d59c5/resourceGroups/some-resource-group/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/basic-external-auth/externalAuths/basic-external-auth", "systemData": { diff --git a/test-integration/frontend/artifacts/DatabaseCRUD/UntypedCRUD/basic/05-untypedListRecursive-subscription/basic-external-auth-auth.json b/test-integration/frontend/artifacts/DatabaseCRUD/UntypedCRUD/basic/05-untypedListRecursive-subscription/basic-external-auth-auth.json index 732f52ffc2e..02f5d830e9f 100644 --- a/test-integration/frontend/artifacts/DatabaseCRUD/UntypedCRUD/basic/05-untypedListRecursive-subscription/basic-external-auth-auth.json +++ b/test-integration/frontend/artifacts/DatabaseCRUD/UntypedCRUD/basic/05-untypedListRecursive-subscription/basic-external-auth-auth.json @@ -8,57 +8,6 @@ "partitionKey": "f52dfea2-47ee-4396-8006-4a27d47d59c5", "properties": { "internalId": "/api/aro_hcp/v1alpha1/clusters/cs-basic-external-auth/external_auth_config/external_auths/2wbhxn4qwk", - "internalState": { - "internalAPI": { - "properties": { - "claim": { - "mappings": { - "groups": { - "claim": "groups", - "prefix": "" - }, - "username": { - "claim": "sub", - "prefix": "prefix-", - "prefixPolicy": "Prefix" - } - }, - "validationRules": [] - }, - "clients": [ - { - "clientId": "87654321-4321-4321-4321-abcdefghijkl", - "component": { - "authClientNamespace": "openshift-console", - "name": "console" - }, - "extraScopes": [], - "type": "Confidential" - }, - { - "clientId": "87654321-4321-4321-4321-abcdefghijkl", - "component": { - "authClientNamespace": "openshift-console", - "name": "cli" - }, - "extraScopes": [], - "type": "Public" - } - ], - "issuer": { - "audiences": [ - "87654321-4321-4321-4321-abcdefghijkl" - ], - "ca": "", - "url": "https://login.microsoftonline.com/12345678-1234-1234-1234-123456789abc/v2.0" - }, - "provisioningState": "" - }, - "serviceProviderProperties": { - "clusterServiceID": "" - } - } - }, "provisioningState": "Succeeded", "resourceId": "/subscriptions/f52dfea2-47ee-4396-8006-4a27d47d59c5/resourceGroups/some-resource-group/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/basic-external-auth/externalAuths/basic-external-auth", "systemData": { diff --git a/test-integration/frontend/artifacts/DatabaseCRUD/UntypedCRUD/basic/07-untypedListRecursive-resourcegroup-via-child/basic-external-auth-auth.json b/test-integration/frontend/artifacts/DatabaseCRUD/UntypedCRUD/basic/07-untypedListRecursive-resourcegroup-via-child/basic-external-auth-auth.json index 732f52ffc2e..02f5d830e9f 100644 --- a/test-integration/frontend/artifacts/DatabaseCRUD/UntypedCRUD/basic/07-untypedListRecursive-resourcegroup-via-child/basic-external-auth-auth.json +++ b/test-integration/frontend/artifacts/DatabaseCRUD/UntypedCRUD/basic/07-untypedListRecursive-resourcegroup-via-child/basic-external-auth-auth.json @@ -8,57 +8,6 @@ "partitionKey": "f52dfea2-47ee-4396-8006-4a27d47d59c5", "properties": { "internalId": "/api/aro_hcp/v1alpha1/clusters/cs-basic-external-auth/external_auth_config/external_auths/2wbhxn4qwk", - "internalState": { - "internalAPI": { - "properties": { - "claim": { - "mappings": { - "groups": { - "claim": "groups", - "prefix": "" - }, - "username": { - "claim": "sub", - "prefix": "prefix-", - "prefixPolicy": "Prefix" - } - }, - "validationRules": [] - }, - "clients": [ - { - "clientId": "87654321-4321-4321-4321-abcdefghijkl", - "component": { - "authClientNamespace": "openshift-console", - "name": "console" - }, - "extraScopes": [], - "type": "Confidential" - }, - { - "clientId": "87654321-4321-4321-4321-abcdefghijkl", - "component": { - "authClientNamespace": "openshift-console", - "name": "cli" - }, - "extraScopes": [], - "type": "Public" - } - ], - "issuer": { - "audiences": [ - "87654321-4321-4321-4321-abcdefghijkl" - ], - "ca": "", - "url": "https://login.microsoftonline.com/12345678-1234-1234-1234-123456789abc/v2.0" - }, - "provisioningState": "" - }, - "serviceProviderProperties": { - "clusterServiceID": "" - } - } - }, "provisioningState": "Succeeded", "resourceId": "/subscriptions/f52dfea2-47ee-4396-8006-4a27d47d59c5/resourceGroups/some-resource-group/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/basic-external-auth/externalAuths/basic-external-auth", "systemData": { diff --git a/test-integration/frontend/artifacts/FrontendCRUD/ExternalAuth/create-current/06-cosmosCompare-ending-content/externalauth-default.json b/test-integration/frontend/artifacts/FrontendCRUD/ExternalAuth/create-current/06-cosmosCompare-ending-content/externalauth-default.json index dece86301f3..a53743afb46 100644 --- a/test-integration/frontend/artifacts/FrontendCRUD/ExternalAuth/create-current/06-cosmosCompare-ending-content/externalauth-default.json +++ b/test-integration/frontend/artifacts/FrontendCRUD/ExternalAuth/create-current/06-cosmosCompare-ending-content/externalauth-default.json @@ -11,79 +11,6 @@ "resourceID": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/externalAuths/default" }, "id": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/externalAuths/default", - "intermediateResourceDoc": { - "activeOperationId": "60df392c-42ba-4384-95b4-5e4601df2f3e", - "internalId": "/api/clusters_mgmt/v1/clusters/tqqtpctbpj/external_auth_config/external_auths/88m6lb2bbv", - "provisioningState": "Accepted", - "resourceId": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/externalAuths/default", - "systemData": { - "createdBy": "Unknown-ARO-HCP-frontend", - "createdByType": "Application", - "lastModifiedBy": "Unknown-ARO-HCP-frontend", - "lastModifiedByType": "Application" - } - }, - "internalState": { - "internalAPI": { - "id": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/externalAuths/default", - "name": "default", - "properties": { - "claim": { - "mappings": { - "groups": { - "claim": "groups", - "prefix": "" - }, - "username": { - "claim": "sub", - "prefix": "prefix-", - "prefixPolicy": "Prefix" - } - }, - "validationRules": [] - }, - "clients": [ - { - "clientId": "87654321-4321-4321-4321-abcdefghijkl", - "component": { - "authClientNamespace": "openshift-console", - "name": "console" - }, - "extraScopes": [], - "type": "Confidential" - }, - { - "clientId": "87654321-4321-4321-4321-abcdefghijkl", - "component": { - "authClientNamespace": "openshift-console", - "name": "cli" - }, - "extraScopes": [], - "type": "Public" - } - ], - "issuer": { - "audiences": [ - "87654321-4321-4321-4321-abcdefghijkl" - ], - "ca": "", - "url": "https://login.microsoftonline.com/12345678-1234-1234-1234-123456789abc/v2.0" - }, - "provisioningState": "Accepted" - }, - "serviceProviderProperties": { - "activeOperationId": "60df392c-42ba-4384-95b4-5e4601df2f3e", - "clusterServiceID": "" - }, - "systemData": { - "createdBy": "Unknown-ARO-HCP-frontend", - "createdByType": "Application", - "lastModifiedBy": "Unknown-ARO-HCP-frontend", - "lastModifiedByType": "Application" - }, - "type": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/externalAuths" - } - }, "name": "default", "properties": { "claim": { diff --git a/test-integration/frontend/artifacts/FrontendCRUD/ExternalAuth/read-old-data/01-load-old-data/externalauth-default.json b/test-integration/frontend/artifacts/FrontendCRUD/ExternalAuth/read-old-data/01-load-old-data/externalauth-default.json index 4ae11fedb73..4e289b5b93c 100644 --- a/test-integration/frontend/artifacts/FrontendCRUD/ExternalAuth/read-old-data/01-load-old-data/externalauth-default.json +++ b/test-integration/frontend/artifacts/FrontendCRUD/ExternalAuth/read-old-data/01-load-old-data/externalauth-default.json @@ -8,79 +8,6 @@ "partitionKey": "6b690bec-0c16-4ecb-8f67-781caf40bba7", "properties": { "id": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/externalAuths/default", - "intermediateResourceDoc": { - "activeOperationId": "5dce3cac-e09b-4ef5-803c-cb8f17b3a552", - "internalId": "/api/clusters_mgmt/v1/clusters/m6bpjxtlqf/external_auth_config/external_auths/zt59xrx22b", - "provisioningState": "Accepted", - "resourceId": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/externalAuths/default", - "systemData": { - "createdBy": "Unknown-ARO-HCP-frontend", - "createdByType": "Application", - "lastModifiedBy": "Unknown-ARO-HCP-frontend", - "lastModifiedByType": "Application" - } - }, - "internalState": { - "internalAPI": { - "id": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/externalAuths/default", - "name": "default", - "properties": { - "claim": { - "mappings": { - "groups": { - "claim": "groups", - "prefix": "" - }, - "username": { - "claim": "sub", - "prefix": "prefix-", - "prefixPolicy": "Prefix" - } - }, - "validationRules": [] - }, - "clients": [ - { - "clientId": "87654321-4321-4321-4321-abcdefghijkl", - "component": { - "authClientNamespace": "openshift-console", - "name": "console" - }, - "extraScopes": [], - "type": "Confidential" - }, - { - "clientId": "87654321-4321-4321-4321-abcdefghijkl", - "component": { - "authClientNamespace": "openshift-console", - "name": "cli" - }, - "extraScopes": [], - "type": "Public" - } - ], - "issuer": { - "audiences": [ - "87654321-4321-4321-4321-abcdefghijkl" - ], - "ca": "", - "url": "https://login.microsoftonline.com/12345678-1234-1234-1234-123456789abc/v2.0" - }, - "provisioningState": "Accepted" - }, - "serviceProviderProperties": { - "activeOperationId": "5dce3cac-e09b-4ef5-803c-cb8f17b3a552", - "clusterServiceID": "" - }, - "systemData": { - "createdBy": "Unknown-ARO-HCP-frontend", - "createdByType": "Application", - "lastModifiedBy": "Unknown-ARO-HCP-frontend", - "lastModifiedByType": "Application" - }, - "type": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/externalAuths" - } - }, "name": "default", "properties": { "claim": { diff --git a/test-integration/frontend/artifacts/FrontendCRUD/ExternalAuth/read-old-data/09-cosmosCompare-confirm-update/externalauth-default.json b/test-integration/frontend/artifacts/FrontendCRUD/ExternalAuth/read-old-data/09-cosmosCompare-confirm-update/externalauth-default.json index eb944ebbc24..64a617d1b17 100644 --- a/test-integration/frontend/artifacts/FrontendCRUD/ExternalAuth/read-old-data/09-cosmosCompare-confirm-update/externalauth-default.json +++ b/test-integration/frontend/artifacts/FrontendCRUD/ExternalAuth/read-old-data/09-cosmosCompare-confirm-update/externalauth-default.json @@ -11,79 +11,6 @@ "resourceID": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/externalAuths/default" }, "id": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/externalAuths/default", - "intermediateResourceDoc": { - "activeOperationId": "d99a71e0-9237-4ae2-8617-e76035e2bcd4", - "internalId": "/api/clusters_mgmt/v1/clusters/m6bpjxtlqf/external_auth_config/external_auths/zt59xrx22b", - "provisioningState": "Accepted", - "resourceId": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/externalAuths/default", - "systemData": { - "createdBy": "Unknown-ARO-HCP-frontend", - "createdByType": "Application", - "lastModifiedBy": "Unknown-ARO-HCP-frontend", - "lastModifiedByType": "Application" - } - }, - "internalState": { - "internalAPI": { - "id": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/externalAuths/default", - "name": "default", - "properties": { - "claim": { - "mappings": { - "groups": { - "claim": "groups2", - "prefix": "" - }, - "username": { - "claim": "sub", - "prefix": "prefix-", - "prefixPolicy": "Prefix" - } - }, - "validationRules": [] - }, - "clients": [ - { - "clientId": "87654321-4321-4321-4321-abcdefghijkl", - "component": { - "authClientNamespace": "openshift-console", - "name": "console" - }, - "extraScopes": [], - "type": "Confidential" - }, - { - "clientId": "87654321-4321-4321-4321-abcdefghijkl", - "component": { - "authClientNamespace": "openshift-console", - "name": "cli" - }, - "extraScopes": [], - "type": "Public" - } - ], - "issuer": { - "audiences": [ - "87654321-4321-4321-4321-abcdefghijkl" - ], - "ca": "", - "url": "https://login.microsoftonline.com/12345678-1234-1234-1234-123456789abc/v2.0" - }, - "provisioningState": "Accepted" - }, - "serviceProviderProperties": { - "activeOperationId": "d99a71e0-9237-4ae2-8617-e76035e2bcd4", - "clusterServiceID": "" - }, - "systemData": { - "createdBy": "Unknown-ARO-HCP-frontend", - "createdByType": "Application", - "lastModifiedBy": "Unknown-ARO-HCP-frontend", - "lastModifiedByType": "Application" - }, - "type": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/externalAuths" - } - }, "name": "default", "properties": { "claim": { diff --git a/test-integration/frontend/artifacts/FrontendCRUD/Migration/migrate-old-data/01-load-old-data/externalauth-default.json b/test-integration/frontend/artifacts/FrontendCRUD/Migration/migrate-old-data/01-load-old-data/externalauth-default.json index 4ae11fedb73..4e289b5b93c 100644 --- a/test-integration/frontend/artifacts/FrontendCRUD/Migration/migrate-old-data/01-load-old-data/externalauth-default.json +++ b/test-integration/frontend/artifacts/FrontendCRUD/Migration/migrate-old-data/01-load-old-data/externalauth-default.json @@ -8,79 +8,6 @@ "partitionKey": "6b690bec-0c16-4ecb-8f67-781caf40bba7", "properties": { "id": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/externalAuths/default", - "intermediateResourceDoc": { - "activeOperationId": "5dce3cac-e09b-4ef5-803c-cb8f17b3a552", - "internalId": "/api/clusters_mgmt/v1/clusters/m6bpjxtlqf/external_auth_config/external_auths/zt59xrx22b", - "provisioningState": "Accepted", - "resourceId": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/externalAuths/default", - "systemData": { - "createdBy": "Unknown-ARO-HCP-frontend", - "createdByType": "Application", - "lastModifiedBy": "Unknown-ARO-HCP-frontend", - "lastModifiedByType": "Application" - } - }, - "internalState": { - "internalAPI": { - "id": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/externalAuths/default", - "name": "default", - "properties": { - "claim": { - "mappings": { - "groups": { - "claim": "groups", - "prefix": "" - }, - "username": { - "claim": "sub", - "prefix": "prefix-", - "prefixPolicy": "Prefix" - } - }, - "validationRules": [] - }, - "clients": [ - { - "clientId": "87654321-4321-4321-4321-abcdefghijkl", - "component": { - "authClientNamespace": "openshift-console", - "name": "console" - }, - "extraScopes": [], - "type": "Confidential" - }, - { - "clientId": "87654321-4321-4321-4321-abcdefghijkl", - "component": { - "authClientNamespace": "openshift-console", - "name": "cli" - }, - "extraScopes": [], - "type": "Public" - } - ], - "issuer": { - "audiences": [ - "87654321-4321-4321-4321-abcdefghijkl" - ], - "ca": "", - "url": "https://login.microsoftonline.com/12345678-1234-1234-1234-123456789abc/v2.0" - }, - "provisioningState": "Accepted" - }, - "serviceProviderProperties": { - "activeOperationId": "5dce3cac-e09b-4ef5-803c-cb8f17b3a552", - "clusterServiceID": "" - }, - "systemData": { - "createdBy": "Unknown-ARO-HCP-frontend", - "createdByType": "Application", - "lastModifiedBy": "Unknown-ARO-HCP-frontend", - "lastModifiedByType": "Application" - }, - "type": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/externalAuths" - } - }, "name": "default", "properties": { "claim": { diff --git a/test-integration/frontend/artifacts/FrontendCRUD/Migration/migrate-old-data/99-cosmosCompare-confirm-migration/externalauth-default.json b/test-integration/frontend/artifacts/FrontendCRUD/Migration/migrate-old-data/99-cosmosCompare-confirm-migration/externalauth-default.json index f960101bf36..e1d943304f7 100644 --- a/test-integration/frontend/artifacts/FrontendCRUD/Migration/migrate-old-data/99-cosmosCompare-confirm-migration/externalauth-default.json +++ b/test-integration/frontend/artifacts/FrontendCRUD/Migration/migrate-old-data/99-cosmosCompare-confirm-migration/externalauth-default.json @@ -11,79 +11,6 @@ "resourceID": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/externalAuths/default" }, "id": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/externalAuths/default", - "intermediateResourceDoc": { - "activeOperationId": "5dce3cac-e09b-4ef5-803c-cb8f17b3a552", - "internalId": "/api/clusters_mgmt/v1/clusters/m6bpjxtlqf/external_auth_config/external_auths/zt59xrx22b", - "provisioningState": "Accepted", - "resourceId": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/externalAuths/default", - "systemData": { - "createdBy": "Unknown-ARO-HCP-frontend", - "createdByType": "Application", - "lastModifiedBy": "Unknown-ARO-HCP-frontend", - "lastModifiedByType": "Application" - } - }, - "internalState": { - "internalAPI": { - "id": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/externalAuths/default", - "name": "default", - "properties": { - "claim": { - "mappings": { - "groups": { - "claim": "groups", - "prefix": "" - }, - "username": { - "claim": "sub", - "prefix": "prefix-", - "prefixPolicy": "Prefix" - } - }, - "validationRules": [] - }, - "clients": [ - { - "clientId": "87654321-4321-4321-4321-abcdefghijkl", - "component": { - "authClientNamespace": "openshift-console", - "name": "console" - }, - "extraScopes": [], - "type": "Confidential" - }, - { - "clientId": "87654321-4321-4321-4321-abcdefghijkl", - "component": { - "authClientNamespace": "openshift-console", - "name": "cli" - }, - "extraScopes": [], - "type": "Public" - } - ], - "issuer": { - "audiences": [ - "87654321-4321-4321-4321-abcdefghijkl" - ], - "ca": "", - "url": "https://login.microsoftonline.com/12345678-1234-1234-1234-123456789abc/v2.0" - }, - "provisioningState": "Accepted" - }, - "serviceProviderProperties": { - "activeOperationId": "5dce3cac-e09b-4ef5-803c-cb8f17b3a552", - "clusterServiceID": "" - }, - "systemData": { - "createdBy": "Unknown-ARO-HCP-frontend", - "createdByType": "Application", - "lastModifiedBy": "Unknown-ARO-HCP-frontend", - "lastModifiedByType": "Application" - }, - "type": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/externalAuths" - } - }, "name": "default", "properties": { "claim": { diff --git a/test-integration/frontend/artifacts/FrontendCRUD/Migration/read-new-data/01-load-old-data/externalauth-default.json b/test-integration/frontend/artifacts/FrontendCRUD/Migration/read-new-data/01-load-old-data/externalauth-default.json index fb851ea0692..a0938db32d3 100644 --- a/test-integration/frontend/artifacts/FrontendCRUD/Migration/read-new-data/01-load-old-data/externalauth-default.json +++ b/test-integration/frontend/artifacts/FrontendCRUD/Migration/read-new-data/01-load-old-data/externalauth-default.json @@ -8,79 +8,6 @@ "partitionKey": "6b690bec-0c16-4ecb-8f67-781caf40bba7", "properties": { "id": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/externalAuths/default", - "intermediateResourceDoc": { - "activeOperationId": "5dce3cac-e09b-4ef5-803c-cb8f17b3a552", - "internalId": "/api/clusters_mgmt/v1/clusters/9p2sk955gj/external_auth_config/external_auths/zt59xrx22b", - "provisioningState": "Accepted", - "resourceId": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/externalAuths/default", - "systemData": { - "createdBy": "Unknown-ARO-HCP-frontend", - "createdByType": "Application", - "lastModifiedBy": "Unknown-ARO-HCP-frontend", - "lastModifiedByType": "Application" - } - }, - "internalState": { - "internalAPI": { - "id": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/externalAuths/default", - "name": "default", - "properties": { - "claim": { - "mappings": { - "groups": { - "claim": "groups", - "prefix": "" - }, - "username": { - "claim": "sub", - "prefix": "prefix-", - "prefixPolicy": "Prefix" - } - }, - "validationRules": [] - }, - "clients": [ - { - "clientId": "87654321-4321-4321-4321-abcdefghijkl", - "component": { - "authClientNamespace": "openshift-console", - "name": "console" - }, - "extraScopes": [], - "type": "Confidential" - }, - { - "clientId": "87654321-4321-4321-4321-abcdefghijkl", - "component": { - "authClientNamespace": "openshift-console", - "name": "cli" - }, - "extraScopes": [], - "type": "Public" - } - ], - "issuer": { - "audiences": [ - "87654321-4321-4321-4321-abcdefghijkl" - ], - "ca": "", - "url": "https://login.microsoftonline.com/12345678-1234-1234-1234-123456789abc/v2.0" - }, - "provisioningState": "Accepted" - }, - "serviceProviderProperties": { - "activeOperationId": "5dce3cac-e09b-4ef5-803c-cb8f17b3a552", - "clusterServiceID": "" - }, - "systemData": { - "createdBy": "Unknown-ARO-HCP-frontend", - "createdByType": "Application", - "lastModifiedBy": "Unknown-ARO-HCP-frontend", - "lastModifiedByType": "Application" - }, - "type": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/externalAuths" - } - }, "name": "default", "properties": { "claim": { diff --git a/test-integration/frontend/artifacts/FrontendCRUD/Migration/read-new-data/18-cosmosCompare-confirm/externalauth-default.json b/test-integration/frontend/artifacts/FrontendCRUD/Migration/read-new-data/18-cosmosCompare-confirm/externalauth-default.json index e92736865ec..d331905a1a3 100644 --- a/test-integration/frontend/artifacts/FrontendCRUD/Migration/read-new-data/18-cosmosCompare-confirm/externalauth-default.json +++ b/test-integration/frontend/artifacts/FrontendCRUD/Migration/read-new-data/18-cosmosCompare-confirm/externalauth-default.json @@ -7,79 +7,6 @@ "resourceID": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/externalAuths/default" }, "id": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/externalAuths/default", - "intermediateResourceDoc": { - "activeOperationId": "117a9956-c10f-493d-a435-fcc43ab90896", - "internalId": "/api/clusters_mgmt/v1/clusters/9p2sk955gj/external_auth_config/external_auths/zt59xrx22b", - "provisioningState": "Accepted", - "resourceId": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/externalAuths/default", - "systemData": { - "createdBy": "Unknown-ARO-HCP-frontend", - "createdByType": "Application", - "lastModifiedBy": "Unknown-ARO-HCP-frontend", - "lastModifiedByType": "Application" - } - }, - "internalState": { - "internalAPI": { - "id": "/subscriptions/6b690bec-0c16-4ecb-8f67-781caf40bba7/resourceGroups/resourceGroupName/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/create-with-tags/externalAuths/default", - "name": "default", - "properties": { - "claim": { - "mappings": { - "groups": { - "claim": "groups2", - "prefix": "" - }, - "username": { - "claim": "sub", - "prefix": "prefix-", - "prefixPolicy": "Prefix" - } - }, - "validationRules": [] - }, - "clients": [ - { - "clientId": "87654321-4321-4321-4321-abcdefghijkl", - "component": { - "authClientNamespace": "openshift-console", - "name": "console" - }, - "extraScopes": [], - "type": "Confidential" - }, - { - "clientId": "87654321-4321-4321-4321-abcdefghijkl", - "component": { - "authClientNamespace": "openshift-console", - "name": "cli" - }, - "extraScopes": [], - "type": "Public" - } - ], - "issuer": { - "audiences": [ - "87654321-4321-4321-4321-abcdefghijkl" - ], - "ca": "", - "url": "https://login.microsoftonline.com/12345678-1234-1234-1234-123456789abc/v2.0" - }, - "provisioningState": "Accepted" - }, - "serviceProviderProperties": { - "activeOperationId": "117a9956-c10f-493d-a435-fcc43ab90896", - "clusterServiceID": "" - }, - "systemData": { - "createdBy": "Unknown-ARO-HCP-frontend", - "createdByType": "Application", - "lastModifiedBy": "Unknown-ARO-HCP-frontend", - "lastModifiedByType": "Application" - }, - "type": "Microsoft.RedHatOpenShift/hcpOpenShiftClusters/externalAuths" - } - }, "name": "default", "properties": { "claim": {