From 851697a0134fe8691bdf14907b8789b12394f173 Mon Sep 17 00:00:00 2001 From: Yannick te Kulve <738464+YannickTeKulve@users.noreply.github.com> Date: Mon, 14 Oct 2024 16:24:02 +0200 Subject: [PATCH] Fix implied policy in service account (#584) --- docker-compose.yml | 8 ++++---- minio/resource_minio_service_account.go | 5 +++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index fd64154f..5e8d9611 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ version: "3" services: minio: - image: minio/minio:RELEASE.2023-08-31T15-31-16Z + image: minio/minio:RELEASE.2024-10-02T17-50-41Z ports: - "9000:9000" - "9001:9001" @@ -13,7 +13,7 @@ services: MINIO_NOTIFY_WEBHOOK_ENDPOINT_primary: https://webhook.example.com command: server --console-address :9001 /data{0...3} secondminio: # This is used to test bucket replication - image: minio/minio:RELEASE.2023-08-31T15-31-16Z + image: minio/minio:RELEASE.2024-10-02T17-50-41Z ports: - "9002:9000" - "9003:9001" @@ -25,7 +25,7 @@ services: MINIO_NOTIFY_WEBHOOK_ENDPOINT_primary: https://webhook.example.com command: server --console-address :9001 /data{0...3} thirdminio: # This is used to test bucket replication - image: minio/minio:RELEASE.2023-08-31T15-31-16Z + image: minio/minio:RELEASE.2024-10-02T17-50-41Z ports: - "9004:9000" - "9005:9001" @@ -37,7 +37,7 @@ services: MINIO_NOTIFY_WEBHOOK_ENDPOINT_primary: https://webhook.example.com command: server --console-address :9001 /data{0...3} fourthminio: # This is used to test bucket replication - image: minio/minio:RELEASE.2023-08-31T15-31-16Z + image: minio/minio:RELEASE.2024-10-02T17-50-41Z ports: - "9006:9000" - "9007:9001" diff --git a/minio/resource_minio_service_account.go b/minio/resource_minio_service_account.go index 13a0790f..7a5e812b 100644 --- a/minio/resource_minio_service_account.go +++ b/minio/resource_minio_service_account.go @@ -186,8 +186,9 @@ func minioReadServiceAccount(ctx context.Context, d *schema.ResourceData, meta i return NewResourceError("reading service account failed", d.Id(), err) } - _ = d.Set("policy", output.Policy) - + if !output.ImpliedPolicy { + _ = d.Set("policy", output.Policy) + } return nil }