From 1744dac26632d0dd333adf5f87845a966192df9c Mon Sep 17 00:00:00 2001 From: Martin Meneval <34133448+martinmeneval@users.noreply.github.com> Date: Mon, 2 Oct 2023 12:31:33 +0200 Subject: [PATCH] #874 Change serviceAccountRoleData functions to use role id instead of name --- ...esource_keycloak_openid_client_service_account_realm_role.go | 2 +- .../resource_keycloak_openid_client_service_account_role.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/provider/resource_keycloak_openid_client_service_account_realm_role.go b/provider/resource_keycloak_openid_client_service_account_realm_role.go index d19ca8a88..14903c7e3 100644 --- a/provider/resource_keycloak_openid_client_service_account_realm_role.go +++ b/provider/resource_keycloak_openid_client_service_account_realm_role.go @@ -63,7 +63,7 @@ func setOpenidClientServiceAccountRealmRoleData(data *schema.ResourceData, servi data.SetId(fmt.Sprintf("%s/%s", serviceAccountRole.ServiceAccountUserId, serviceAccountRole.Id)) data.Set("realm_id", serviceAccountRole.RealmId) data.Set("service_account_user_id", serviceAccountRole.ServiceAccountUserId) - data.Set("role", serviceAccountRole.Name) + data.Set("role", serviceAccountRole.Id) } func resourceKeycloakOpenidClientServiceAccountRealmRoleCreate(ctx context.Context, data *schema.ResourceData, meta interface{}) diag.Diagnostics { diff --git a/provider/resource_keycloak_openid_client_service_account_role.go b/provider/resource_keycloak_openid_client_service_account_role.go index 36ef9df76..b6f396e25 100644 --- a/provider/resource_keycloak_openid_client_service_account_role.go +++ b/provider/resource_keycloak_openid_client_service_account_role.go @@ -71,7 +71,7 @@ func setOpenidClientServiceAccountRoleData(data *schema.ResourceData, serviceAcc data.Set("realm_id", serviceAccountRole.RealmId) data.Set("client_id", serviceAccountRole.ContainerId) data.Set("service_account_user_id", serviceAccountRole.ServiceAccountUserId) - data.Set("role", serviceAccountRole.Name) + data.Set("role", serviceAccountRole.Id) } func resourceKeycloakOpenidClientServiceAccountRoleCreate(ctx context.Context, data *schema.ResourceData, meta interface{}) diag.Diagnostics {