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_any.go b/internal/database/convert_any.go index 4feeb355ad1..a10716697c5 100644 --- a/internal/database/convert_any.go +++ b/internal/database/convert_any.go @@ -28,9 +28,6 @@ func CosmosToInternal[InternalAPIType, CosmosAPIType any](obj *CosmosAPIType) (* var internalObj any var err error switch cosmosObj := any(obj).(type) { - case *ExternalAuth: - internalObj, err = CosmosToInternalExternalAuth(cosmosObj) - case *HCPCluster: internalObj, err = CosmosToInternalCluster(cosmosObj) @@ -84,9 +81,6 @@ func InternalToCosmos[InternalAPIType, CosmosAPIType any](obj *InternalAPIType) var cosmosObj any var err error switch internalObj := any(obj).(type) { - case *api.HCPOpenShiftClusterExternalAuth: - cosmosObj, err = InternalToCosmosExternalAuth(internalObj) - case *api.HCPOpenShiftCluster: cosmosObj, err = InternalToCosmosCluster(internalObj) 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_defaults_consistency_test.go b/internal/database/convert_defaults_consistency_test.go index 0090a7ebb6b..831b6759c4e 100644 --- a/internal/database/convert_defaults_consistency_test.go +++ b/internal/database/convert_defaults_consistency_test.go @@ -577,7 +577,7 @@ func TestEnsureDefaultsConsistencyExternalAuth(t *testing.T) { }) } -// TestPreExistingDataExternalAuth verifies that CosmosToInternalExternalAuth +// TestPreExistingDataExternalAuth verifies that CosmosGenericToInternal // applies canonical defaults when reading a Cosmos document that predates the // introduction of the PrefixPolicy field. func TestPreExistingDataExternalAuth(t *testing.T) { @@ -585,29 +585,30 @@ func TestPreExistingDataExternalAuth(t *testing.T) { "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/cluster/externalAuths/default", )) - preExistingDoc := &ExternalAuth{ + internalID := api.Must(api.NewInternalID("/api/aro_hcp/v1alpha1/clusters/test-cluster/external_auth_config/external_auths/default")) + preExistingDoc := &GenericDocument[api.HCPOpenShiftClusterExternalAuth]{ 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")), + Content: 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, }, - InternalState: ExternalAuthInternalState{ - InternalAPI: api.HCPOpenShiftClusterExternalAuth{ - // PrefixPolicy is intentionally zero-valued to simulate - // a pre-existing document that predates the field. - }, + ServiceProviderProperties: api.HCPOpenShiftClusterExternalAuthServiceProviderProperties{ + ClusterServiceID: &internalID, }, }, } - internalExternalAuth, err := CosmosToInternalExternalAuth(preExistingDoc) + internalExternalAuth, err := CosmosGenericToInternal(preExistingDoc) if err != nil { - t.Fatalf("CosmosToInternalExternalAuth failed: %v", err) + t.Fatalf("CosmosGenericToInternal failed: %v", err) } if internalExternalAuth.Properties.Claim.Mappings.Username.PrefixPolicy != api.UsernameClaimPrefixPolicyNone { diff --git a/internal/database/convert_externalauth.go b/internal/database/convert_externalauth.go deleted file mode 100644 index 1517ec541f6..00000000000 --- a/internal/database/convert_externalauth.go +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright 2025 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package database - -import ( - "fmt" - "strings" - - "k8s.io/utils/ptr" - - "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) { - if internalObj == nil { - return nil, nil - } - - cosmosObj := &ExternalAuth{ - TypedDocument: TypedDocument{ - BaseDocument: BaseDocument{ - ID: internalObj.GetCosmosData().GetCosmosUID(), - }, - PartitionKey: strings.ToLower(internalObj.ID.SubscriptionID), - ResourceID: internalObj.ID, - ResourceType: internalObj.ID.ResourceType.String(), - }, - ExternalAuthProperties: ExternalAuthProperties{ - CosmosMetadata: api.CosmosMetadata{ - ResourceID: internalObj.ID, - }, - IntermediateResourceDoc: &ResourceDocument{ - ResourceID: internalObj.ID, - 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, - }, - }, - } - - // 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 -} - -func CosmosToInternalExternalAuth(cosmosObj *ExternalAuth) (*api.HCPOpenShiftClusterExternalAuth, error) { - if cosmosObj == nil { - return nil, nil - } - resourceDoc := cosmosObj.IntermediateResourceDoc - if resourceDoc == nil { - return nil, fmt.Errorf("resource document cannot be nil") - } - - tempInternalAPI := cosmosObj.InternalState.InternalAPI - internalObj := &tempInternalAPI - - // some pieces of data are stored on the ResourceDocument, so we need to restore that data - internalObj.ProxyResource = arm.ProxyResource{ - Resource: arm.Resource{ - ID: resourceDoc.ResourceID, - Name: resourceDoc.ResourceID.Name, - Type: resourceDoc.ResourceID.ResourceType.String(), - SystemData: resourceDoc.SystemData, - }, - } - // 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.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() - - return internalObj, nil -} diff --git a/internal/database/convert_externalauth_test.go b/internal/database/convert_externalauth_test.go deleted file mode 100644 index 57e8683348a..00000000000 --- a/internal/database/convert_externalauth_test.go +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright 2025 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package database - -import ( - "math/rand" - "strings" - "testing" - - "github.com/stretchr/testify/require" - - "sigs.k8s.io/randfill" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - azcorearm "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - - "github.com/Azure/ARO-HCP/internal/api" - "github.com/Azure/ARO-HCP/internal/api/arm" -) - -func TestRoundTripExternalAuthInternalCosmosInternal(t *testing.T) { - seed := rand.Int63() - t.Logf("seed: %d", seed) - - fuzzer := fuzzerFor([]interface{}{ - func(j *azcorearm.ResourceID, c randfill.Continue) { - *j = *api.Must(azcorearm.ParseResourceID("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRg")) - }, - func(j *arm.Resource, c randfill.Continue) { - c.FillNoCustom(j) - j.ID = api.Must(azcorearm.ParseResourceID("/subscriptions/0465bc32-c654-41b8-8d87-9815d7abe8f6/resourceGroups/some-resource-group/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/change-channel")) - j.Name = "change-channel" - j.Type = "Microsoft.RedHatOpenShift/hcpOpenShiftClusters" - }, - func(j *api.HCPOpenShiftClusterExternalAuthServiceProviderProperties, c randfill.Continue) { - c.FillNoCustom(j) - if j == nil { - return - } - clusterID := "r" + strings.ReplaceAll(c.String(10), "/", "-") - externalAuthID := strings.ReplaceAll(c.String(10), "/", "-") - foo := api.Must(api.NewInternalID("/api/aro_hcp/v1alpha1/clusters/" + clusterID + "/external_auth_config/external_auths/" + externalAuthID)) - j.ClusterServiceID = &foo - }, - 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 { - j.Properties.Claim.Mappings.Username.PrefixPolicy = api.UsernameClaimPrefixPolicyNone - } - }, - func(j *arm.ManagedServiceIdentity, c randfill.Continue) { - c.FillNoCustom(j) - - // we only round trip keys, so only fill in keys - if j != nil && j.UserAssignedIdentities != nil { - for k := range j.UserAssignedIdentities { - j.UserAssignedIdentities[k] = nil - } - } - }, - }, rand.NewSource(seed)) - - // Try a few times, since runTest uses random values. - for i := 0; i < 20; i++ { - original := &api.HCPOpenShiftClusterExternalAuth{} - fuzzer.Fill(original) - roundTripInternalToCosmosToInternal[api.HCPOpenShiftClusterExternalAuth, ExternalAuth](t, original) - } -} - -func TestCosmosToInternalExternalAuthPreservesETag(t *testing.T) { - expectedETag := azcore.ETag("test-etag-value-12345") - resourceID := api.Must(azcorearm.ParseResourceID("/subscriptions/0465bc32-c654-41b8-8d87-9815d7abe8f6/resourceGroups/rg/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/my-cluster")) - - cosmosObj := &ExternalAuth{ - TypedDocument: TypedDocument{ - BaseDocument: BaseDocument{ - CosmosETag: expectedETag, - }, - }, - ExternalAuthProperties: ExternalAuthProperties{ - IntermediateResourceDoc: &ResourceDocument{ - ResourceID: resourceID, - }, - }, - } - - internalObj, err := CosmosToInternalExternalAuth(cosmosObj) - require.NoError(t, err) - require.Equal(t, expectedETag, internalObj.GetCosmosData().CosmosETag) -} diff --git a/internal/database/convert_generic.go b/internal/database/convert_generic.go index d3b061ef063..3e01799ff28 100644 --- a/internal/database/convert_generic.go +++ b/internal/database/convert_generic.go @@ -69,6 +69,10 @@ func CosmosGenericToInternal[InternalAPIType any](cosmosObj *GenericDocument[Int cosmosData.ExistingCosmosUID = cosmosObj.ID ret.SetEtag(cosmosObj.CosmosETag) + if defaulter, ok := ret.(Defaulter); ok { + defaulter.EnsureDefaults() + } + // this isn't pretty, but on balance it's a better choice so that we can share all the rest. switch castObj := any(ret).(type) { case *arm.Subscription: @@ -93,3 +97,7 @@ func CosmosGenericToInternal[InternalAPIType any](cosmosObj *GenericDocument[Int return &cosmosObj.Content, nil } + +type Defaulter interface { + EnsureDefaults() +} diff --git a/internal/database/crud_hcpcluster.go b/internal/database/crud_hcpcluster.go index cb6198916aa..c79eac19506 100644 --- a/internal/database/crud_hcpcluster.go +++ b/internal/database/crud_hcpcluster.go @@ -158,7 +158,7 @@ func (h *hcpClusterCRUD) ExternalAuth(hcpClusterName string) ExternalAuthsCRUD { hcpClusterName))) return &externalAuthCRUD{ - nestedCosmosResourceCRUD: NewCosmosResourceCRUD[api.HCPOpenShiftClusterExternalAuth, ExternalAuth]( + nestedCosmosResourceCRUD: NewCosmosResourceCRUD[api.HCPOpenShiftClusterExternalAuth, GenericDocument[api.HCPOpenShiftClusterExternalAuth]]( h.containerClient, parentResourceID, api.ExternalAuthResourceType, @@ -212,7 +212,7 @@ func (h *hcpClusterCRUD) ManagementClusterContents(hcpClusterName string) Manage } type externalAuthCRUD struct { - *nestedCosmosResourceCRUD[api.HCPOpenShiftClusterExternalAuth, ExternalAuth] + *nestedCosmosResourceCRUD[api.HCPOpenShiftClusterExternalAuth, GenericDocument[api.HCPOpenShiftClusterExternalAuth]] } func (h *externalAuthCRUD) Controllers(externalAuthName string) ResourceCRUD[api.Controller] { diff --git a/internal/database/global_lister.go b/internal/database/global_lister.go index f2394c021b0..a64b60c4f07 100644 --- a/internal/database/global_lister.go +++ b/internal/database/global_lister.go @@ -86,7 +86,7 @@ func (g *cosmosResourcesGlobalListers) NodePools() GlobalLister[api.HCPOpenShift } func (g *cosmosResourcesGlobalListers) ExternalAuths() GlobalLister[api.HCPOpenShiftClusterExternalAuth] { - return &cosmosGlobalLister[api.HCPOpenShiftClusterExternalAuth, ExternalAuth]{ + return &cosmosGlobalLister[api.HCPOpenShiftClusterExternalAuth, GenericDocument[api.HCPOpenShiftClusterExternalAuth]]{ containerClient: g.resources, resourceType: api.ExternalAuthResourceType, } diff --git a/internal/database/transaction.go b/internal/database/transaction.go index dbbd713e00d..20b7dc15297 100644 --- a/internal/database/transaction.go +++ b/internal/database/transaction.go @@ -210,7 +210,7 @@ func (r *cosmosDBTransactionResult) GetItem(cosmosUID string) (any, error) { case strings.ToLower(api.NodePoolResourceType.String()): return getCastResult[api.HCPOpenShiftClusterNodePool, NodePool](r, cosmosUID) case strings.ToLower(api.ExternalAuthResourceType.String()): - return getCastResult[api.HCPOpenShiftClusterExternalAuth, ExternalAuth](r, cosmosUID) + return getCastResult[api.HCPOpenShiftClusterExternalAuth, GenericDocument[api.HCPOpenShiftClusterExternalAuth]](r, cosmosUID) default: return nil, fmt.Errorf("unknown resource type '%s'", typedDoc.ResourceType) } diff --git a/internal/database/types_externalauth.go b/internal/database/types_externalauth.go deleted file mode 100644 index 99ae661b0ee..00000000000 --- a/internal/database/types_externalauth.go +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2025 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package database - -import ( - "github.com/Azure/ARO-HCP/internal/api" -) - -type ExternalAuth struct { - TypedDocument `json:",inline"` - - ExternalAuthProperties `json:"properties"` -} - -type ExternalAuthProperties struct { - // when we switch to inlining the internalObj, this will be in the right spot. We add it now so that we can switch our - // queries to select on cosmosMetata.ResourceID instead of resourceId - CosmosMetadata api.CosmosMetadata `json:"cosmosMetadata"` - - // IntermediateResourceDoc exists so that we can stop inlining the resource document so that we can directly - // embed the InternalAPIType which has colliding serialization fields. - IntermediateResourceDoc *ResourceDocument `json:"intermediateResourceDoc"` - - // TODO we may need look-aside data that we want to store in the same place. Build the nesting to allow it - InternalState ExternalAuthInternalState `json:"internalState"` -} - -type ExternalAuthInternalState struct { - InternalAPI api.HCPOpenShiftClusterExternalAuth `json:"internalAPI"` -} - -func (o *ExternalAuth) GetTypedDocument() *TypedDocument { - return &o.TypedDocument -} diff --git a/internal/databasetesting/mock_resources_crud.go b/internal/databasetesting/mock_resources_crud.go index edf10781b34..9e64d9071c0 100644 --- a/internal/databasetesting/mock_resources_crud.go +++ b/internal/databasetesting/mock_resources_crud.go @@ -454,7 +454,7 @@ func (m *mockHCPClusterCRUD) ExternalAuth(hcpClusterName string) database.Extern hcpClusterName))) return &mockExternalAuthCRUD{ - mockResourceCRUD: newMockResourceCRUD[api.HCPOpenShiftClusterExternalAuth, database.ExternalAuth]( + mockResourceCRUD: newMockResourceCRUD[api.HCPOpenShiftClusterExternalAuth, database.GenericDocument[api.HCPOpenShiftClusterExternalAuth]]( m.client, parentResourceID, api.ExternalAuthResourceType, @@ -536,7 +536,7 @@ var _ database.NodePoolsCRUD = &mockNodePoolsCRUD{} // mockExternalAuthCRUD implements database.ExternalAuthsCRUD. type mockExternalAuthCRUD struct { - *mockResourceCRUD[api.HCPOpenShiftClusterExternalAuth, database.ExternalAuth] + *mockResourceCRUD[api.HCPOpenShiftClusterExternalAuth, database.GenericDocument[api.HCPOpenShiftClusterExternalAuth]] } func (m *mockExternalAuthCRUD) Controllers(externalAuthName string) database.ResourceCRUD[api.Controller] { diff --git a/internal/databasetesting/mock_resources_db_client.go b/internal/databasetesting/mock_resources_db_client.go index 9f1e21c324d..18f2af5d8d9 100644 --- a/internal/databasetesting/mock_resources_db_client.go +++ b/internal/databasetesting/mock_resources_db_client.go @@ -371,11 +371,11 @@ func (r *mockTransactionResult) GetItem(cosmosUID string) (any, error) { } return database.CosmosToInternalNodePool(&cosmosObj) case strings.ToLower(api.ExternalAuthResourceType.String()): - var cosmosObj database.ExternalAuth + var cosmosObj database.GenericDocument[api.HCPOpenShiftClusterExternalAuth] if err := json.Unmarshal(data, &cosmosObj); err != nil { return nil, err } - return database.CosmosToInternalExternalAuth(&cosmosObj) + return database.CosmosGenericToInternal(&cosmosObj) default: return nil, fmt.Errorf("unknown resource type '%s'", typedDoc.ResourceType) } diff --git a/internal/databasetesting/mock_resources_global_lister.go b/internal/databasetesting/mock_resources_global_lister.go index 22ed8b7e98e..37468b556c0 100644 --- a/internal/databasetesting/mock_resources_global_lister.go +++ b/internal/databasetesting/mock_resources_global_lister.go @@ -52,7 +52,7 @@ func (g *mockResourcesGlobalListers) NodePools() database.GlobalLister[api.HCPOp } func (g *mockResourcesGlobalListers) ExternalAuths() database.GlobalLister[api.HCPOpenShiftClusterExternalAuth] { - return &mockTypedGlobalLister[api.HCPOpenShiftClusterExternalAuth, database.ExternalAuth]{ + return &mockTypedGlobalLister[api.HCPOpenShiftClusterExternalAuth, database.GenericDocument[api.HCPOpenShiftClusterExternalAuth]]{ client: g.client, resourceType: api.ExternalAuthResourceType, } 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/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..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 @@ -7,69 +7,63 @@ "id": "9a361107-eb97-5b1b-bc2e-b9cfa961b5bc", "partitionKey": "a433a095-1277-44f1-8453-8d61a4d848c2", "properties": { - "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": { - "properties": { - "claim": { - "mappings": { - "groups": { - "claim": "groups", - "prefix": "" - }, - "username": { - "claim": "sub", - "prefix": "prefix-", - "prefixPolicy": "Prefix" - } - }, - "validationRules": [] + "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": "" }, - "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" + "username": { + "claim": "sub", + "prefix": "prefix-", + "prefixPolicy": "Prefix" + } + }, + "validationRules": [] + }, + "clients": [ + { + "clientId": "87654321-4321-4321-4321-abcdefghijkl", + "component": { + "authClientNamespace": "openshift-console", + "name": "console" }, - "provisioningState": "" + "extraScopes": [], + "type": "Confidential" }, - "serviceProviderProperties": { - "clusterServiceID": "" + { + "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..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 @@ -7,69 +7,63 @@ "id": "9a361107-eb97-5b1b-bc2e-b9cfa961b5bc", "partitionKey": "a433a095-1277-44f1-8453-8d61a4d848c2", "properties": { - "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": { - "properties": { - "claim": { - "mappings": { - "groups": { - "claim": "groups", - "prefix": "" - }, - "username": { - "claim": "sub", - "prefix": "prefix-", - "prefixPolicy": "Prefix" - } - }, - "validationRules": [] + "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": "" }, - "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" + "username": { + "claim": "sub", + "prefix": "prefix-", + "prefixPolicy": "Prefix" + } + }, + "validationRules": [] + }, + "clients": [ + { + "clientId": "87654321-4321-4321-4321-abcdefghijkl", + "component": { + "authClientNamespace": "openshift-console", + "name": "console" }, - "provisioningState": "" + "extraScopes": [], + "type": "Confidential" }, - "serviceProviderProperties": { - "clusterServiceID": "" + { + "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..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 @@ -7,69 +7,63 @@ "id": "9a361107-eb97-5b1b-bc2e-b9cfa961b5bc", "partitionKey": "a433a095-1277-44f1-8453-8d61a4d848c2", "properties": { - "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": { - "properties": { - "claim": { - "mappings": { - "groups": { - "claim": "groups", - "prefix": "" - }, - "username": { - "claim": "sub", - "prefix": "prefix-", - "prefixPolicy": "Prefix" - } - }, - "validationRules": [] + "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": "" }, - "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" + "username": { + "claim": "sub", + "prefix": "prefix-", + "prefixPolicy": "Prefix" + } + }, + "validationRules": [] + }, + "clients": [ + { + "clientId": "87654321-4321-4321-4321-abcdefghijkl", + "component": { + "authClientNamespace": "openshift-console", + "name": "console" }, - "provisioningState": "" + "extraScopes": [], + "type": "Confidential" }, - "serviceProviderProperties": { - "clusterServiceID": "" + { + "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..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 @@ -7,69 +7,63 @@ "id": "9a361107-eb97-5b1b-bc2e-b9cfa961b5bc", "partitionKey": "a433a095-1277-44f1-8453-8d61a4d848c2", "properties": { - "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": { - "properties": { - "claim": { - "mappings": { - "groups": { - "claim": "groups", - "prefix": "" - }, - "username": { - "claim": "sub", - "prefix": "prefix-", - "prefixPolicy": "Prefix" - } - }, - "validationRules": [] + "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": "" }, - "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" + "username": { + "claim": "sub", + "prefix": "prefix-", + "prefixPolicy": "Prefix" + } + }, + "validationRules": [] + }, + "clients": [ + { + "clientId": "87654321-4321-4321-4321-abcdefghijkl", + "component": { + "authClientNamespace": "openshift-console", + "name": "console" }, - "provisioningState": "" + "extraScopes": [], + "type": "Confidential" }, - "serviceProviderProperties": { - "clusterServiceID": "" + { + "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..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 @@ -7,69 +7,63 @@ "id": "9a361107-eb97-5b1b-bc2e-b9cfa961b5bc", "partitionKey": "a433a095-1277-44f1-8453-8d61a4d848c2", "properties": { - "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": { - "properties": { - "claim": { - "mappings": { - "groups": { - "claim": "groups", - "prefix": "" - }, - "username": { - "claim": "sub", - "prefix": "prefix-", - "prefixPolicy": "Prefix" - } - }, - "validationRules": [] + "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": "" }, - "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" + "username": { + "claim": "sub", + "prefix": "prefix-", + "prefixPolicy": "Prefix" + } + }, + "validationRules": [] + }, + "clients": [ + { + "clientId": "87654321-4321-4321-4321-abcdefghijkl", + "component": { + "authClientNamespace": "openshift-console", + "name": "console" }, - "provisioningState": "" + "extraScopes": [], + "type": "Confidential" }, - "serviceProviderProperties": { - "clusterServiceID": "" + { + "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..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 @@ -7,69 +7,63 @@ "id": "9a361107-eb97-5b1b-bc2e-b9cfa961b5bc", "partitionKey": "a433a095-1277-44f1-8453-8d61a4d848c2", "properties": { - "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": { - "properties": { - "claim": { - "mappings": { - "groups": { - "claim": "groups", - "prefix": "" - }, - "username": { - "claim": "sub", - "prefix": "prefix-", - "prefixPolicy": "Prefix" - } - }, - "validationRules": [] + "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": "" }, - "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" + "username": { + "claim": "sub", + "prefix": "prefix-", + "prefixPolicy": "Prefix" + } + }, + "validationRules": [] + }, + "clients": [ + { + "clientId": "87654321-4321-4321-4321-abcdefghijkl", + "component": { + "authClientNamespace": "openshift-console", + "name": "console" }, - "provisioningState": "" + "extraScopes": [], + "type": "Confidential" }, - "serviceProviderProperties": { - "clusterServiceID": "" + { + "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/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 d099655f0db..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 @@ -10,69 +10,63 @@ "cosmosMetadata": { "resourceID": "/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": { - "properties": { - "claim": { - "mappings": { - "groups": { - "claim": "groups", - "prefix": "" - }, - "username": { - "claim": "sub", - "prefix": "prefix-", - "prefixPolicy": "Prefix" - } - }, - "validationRules": [] + "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": "" }, - "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" + "username": { + "claim": "sub", + "prefix": "prefix-", + "prefixPolicy": "Prefix" + } + }, + "validationRules": [] + }, + "clients": [ + { + "clientId": "87654321-4321-4321-4321-abcdefghijkl", + "component": { + "authClientNamespace": "openshift-console", + "name": "console" }, - "provisioningState": "" + "extraScopes": [], + "type": "Confidential" }, - "serviceProviderProperties": { - "clusterServiceID": "" + { + "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..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 @@ -7,69 +7,63 @@ "id": "85dada74-03ca-5abf-9adc-218fbd0090c7", "partitionKey": "6b690bec-0c16-4ecb-8f67-781caf40bba7", "properties": { - "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": { - "properties": { - "claim": { - "mappings": { - "groups": { - "claim": "groups", - "prefix": "" - }, - "username": { - "claim": "sub", - "prefix": "prefix-", - "prefixPolicy": "Prefix" - } - }, - "validationRules": [] + "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": "" }, - "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" + "username": { + "claim": "sub", + "prefix": "prefix-", + "prefixPolicy": "Prefix" + } + }, + "validationRules": [] + }, + "clients": [ + { + "clientId": "87654321-4321-4321-4321-abcdefghijkl", + "component": { + "authClientNamespace": "openshift-console", + "name": "console" }, - "provisioningState": "" + "extraScopes": [], + "type": "Confidential" }, - "serviceProviderProperties": { - "clusterServiceID": "" + { + "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..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 @@ -10,69 +10,63 @@ "cosmosMetadata": { "resourceID": "/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": { - "properties": { - "claim": { - "mappings": { - "groups": { - "claim": "groups2", - "prefix": "" - }, - "username": { - "claim": "sub", - "prefix": "prefix-", - "prefixPolicy": "Prefix" - } - }, - "validationRules": [] + "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": "" }, - "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" + "username": { + "claim": "sub", + "prefix": "prefix-", + "prefixPolicy": "Prefix" + } + }, + "validationRules": [] + }, + "clients": [ + { + "clientId": "87654321-4321-4321-4321-abcdefghijkl", + "component": { + "authClientNamespace": "openshift-console", + "name": "console" }, - "provisioningState": "" + "extraScopes": [], + "type": "Confidential" }, - "serviceProviderProperties": { - "clusterServiceID": "" + { + "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..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 @@ -7,69 +7,63 @@ "id": "85dada74-03ca-5abf-9adc-218fbd0090c7", "partitionKey": "6b690bec-0c16-4ecb-8f67-781caf40bba7", "properties": { - "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": { - "properties": { - "claim": { - "mappings": { - "groups": { - "claim": "groups", - "prefix": "" - }, - "username": { - "claim": "sub", - "prefix": "prefix-", - "prefixPolicy": "Prefix" - } - }, - "validationRules": [] + "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": "" }, - "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" + "username": { + "claim": "sub", + "prefix": "prefix-", + "prefixPolicy": "Prefix" + } + }, + "validationRules": [] + }, + "clients": [ + { + "clientId": "87654321-4321-4321-4321-abcdefghijkl", + "component": { + "authClientNamespace": "openshift-console", + "name": "console" }, - "provisioningState": "" + "extraScopes": [], + "type": "Confidential" }, - "serviceProviderProperties": { - "clusterServiceID": "" + { + "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..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 @@ -10,69 +10,63 @@ "cosmosMetadata": { "resourceID": "/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": { - "properties": { - "claim": { - "mappings": { - "groups": { - "claim": "groups", - "prefix": "" - }, - "username": { - "claim": "sub", - "prefix": "prefix-", - "prefixPolicy": "Prefix" - } - }, - "validationRules": [] + "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": "" }, - "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" + "username": { + "claim": "sub", + "prefix": "prefix-", + "prefixPolicy": "Prefix" + } + }, + "validationRules": [] + }, + "clients": [ + { + "clientId": "87654321-4321-4321-4321-abcdefghijkl", + "component": { + "authClientNamespace": "openshift-console", + "name": "console" }, - "provisioningState": "" + "extraScopes": [], + "type": "Confidential" }, - "serviceProviderProperties": { - "clusterServiceID": "" + { + "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..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 @@ -7,69 +7,63 @@ "id": "85dada74-03ca-5abf-9adc-218fbd0090c7", "partitionKey": "6b690bec-0c16-4ecb-8f67-781caf40bba7", "properties": { - "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": { - "properties": { - "claim": { - "mappings": { - "groups": { - "claim": "groups", - "prefix": "" - }, - "username": { - "claim": "sub", - "prefix": "prefix-", - "prefixPolicy": "Prefix" - } - }, - "validationRules": [] + "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": "" }, - "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" + "username": { + "claim": "sub", + "prefix": "prefix-", + "prefixPolicy": "Prefix" + } + }, + "validationRules": [] + }, + "clients": [ + { + "clientId": "87654321-4321-4321-4321-abcdefghijkl", + "component": { + "authClientNamespace": "openshift-console", + "name": "console" }, - "provisioningState": "" + "extraScopes": [], + "type": "Confidential" }, - "serviceProviderProperties": { - "clusterServiceID": "" + { + "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..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 @@ -6,69 +6,63 @@ "cosmosMetadata": { "resourceID": "/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": { - "properties": { - "claim": { - "mappings": { - "groups": { - "claim": "groups2", - "prefix": "" - }, - "username": { - "claim": "sub", - "prefix": "prefix-", - "prefixPolicy": "Prefix" - } - }, - "validationRules": [] + "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": "" }, - "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" + "username": { + "claim": "sub", + "prefix": "prefix-", + "prefixPolicy": "Prefix" + } + }, + "validationRules": [] + }, + "clients": [ + { + "clientId": "87654321-4321-4321-4321-abcdefghijkl", + "component": { + "authClientNamespace": "openshift-console", + "name": "console" }, - "provisioningState": "" + "extraScopes": [], + "type": "Confidential" }, - "serviceProviderProperties": { - "clusterServiceID": "" + { + "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..ecdca7de065 100644 --- a/test-integration/utils/databasemutationhelpers/per_resource_comparer.go +++ b/test-integration/utils/databasemutationhelpers/per_resource_comparer.go @@ -116,16 +116,17 @@ 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, "internalState", "internalAPI", "cosmosMetadata")...) // cluster, nodepool, externalauth - redundant copy of inline cosmosMetadata unstructured.RemoveNestedField(currMap, prepend(possiblePrepend, "cosmosMetadata", "etag")...) - // inline serialization on cluster also exposes these UUID-generated / variable fields directly under properties - 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")...)