From 6d86854ff4a9c1c64ff72c5bbf05304b16e29bd9 Mon Sep 17 00:00:00 2001 From: user Date: Thu, 20 Jan 2022 12:42:36 +0100 Subject: [PATCH] Draft --- internal/services/applications/application_resource.go | 9 +-------- .../serviceprincipals/service_principal_resource.go | 8 +------- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/internal/services/applications/application_resource.go b/internal/services/applications/application_resource.go index c124d3a30a..b6856a3e22 100644 --- a/internal/services/applications/application_resource.go +++ b/internal/services/applications/application_resource.go @@ -994,7 +994,6 @@ func applicationResourceCreate(ctx context.Context, d *schema.ResourceData, meta // Retrieve and set the initial owners, which can be up to 20 in total when creating the application if v, ok := d.GetOk("owners"); ok { - ownerCount := 0 for _, ownerIdRaw := range v.(*schema.Set).List() { ownerId := ownerIdRaw.(string) @@ -1009,13 +1008,7 @@ func applicationResourceCreate(ctx context.Context, d *schema.ResourceData, meta client.BaseClient.Endpoint, client.BaseClient.TenantId, ownerId))), ID: &ownerId, } - - if ownerCount < 19 { - ownersFirst20 = append(ownersFirst20, ownerObject) - } else { - ownersExtra = append(ownersExtra, ownerObject) - } - ownerCount++ + ownersExtra = append(ownersExtra, ownerObject) } } diff --git a/internal/services/serviceprincipals/service_principal_resource.go b/internal/services/serviceprincipals/service_principal_resource.go index ed3f8f9808..18d900b91c 100644 --- a/internal/services/serviceprincipals/service_principal_resource.go +++ b/internal/services/serviceprincipals/service_principal_resource.go @@ -434,7 +434,6 @@ func servicePrincipalResourceCreate(ctx context.Context, d *schema.ResourceData, // Retrieve and set the initial owners, which can be up to 20 in total when creating the service principal if v, ok := d.GetOk("owners"); ok { - ownerCount := 0 for _, ownerIdRaw := range v.(*schema.Set).List() { ownerId := ownerIdRaw.(string) @@ -450,12 +449,7 @@ func servicePrincipalResourceCreate(ctx context.Context, d *schema.ResourceData, ID: &ownerId, } - if ownerCount < 19 { - ownersFirst20 = append(ownersFirst20, ownerObject) - } else { - ownersExtra = append(ownersExtra, ownerObject) - } - ownerCount++ + ownersExtra = append(ownersExtra, ownerObject) } }