Skip to content

Commit

Permalink
Policy is needed in every service account update
Browse files Browse the repository at this point in the history
Don't know why, seems like it was already the case with previous code
  • Loading branch information
ribetm committed Nov 12, 2024
1 parent 5fa48b3 commit 655b090
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion minio/resource_minio_service_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,8 @@ func minioUpdateServiceAccount(ctx context.Context, d *schema.ResourceData, meta
return NewResourceError("Minio does not support removing service account names", d.Id(), serviceAccountConfig.MinioName)
}
err := serviceAccountConfig.MinioAdmin.UpdateServiceAccount(ctx, d.Id(), madmin.UpdateServiceAccountReq{
NewName: serviceAccountConfig.MinioName,
NewName: serviceAccountConfig.MinioName,
NewPolicy: processServiceAccountPolicy(policy),
})
if err != nil {
return NewResourceError("error updating service account name %s: %s", d.Id(), err)
Expand All @@ -207,6 +208,7 @@ func minioUpdateServiceAccount(ctx context.Context, d *schema.ResourceData, meta
}
err := serviceAccountConfig.MinioAdmin.UpdateServiceAccount(ctx, d.Id(), madmin.UpdateServiceAccountReq{
NewDescription: serviceAccountConfig.MinioDescription,
NewPolicy: processServiceAccountPolicy(policy),
})
if err != nil {
return NewResourceError("error updating service account description %s: %s", d.Id(), err)
Expand All @@ -220,6 +222,7 @@ func minioUpdateServiceAccount(ctx context.Context, d *schema.ResourceData, meta
}
err = serviceAccountConfig.MinioAdmin.UpdateServiceAccount(ctx, d.Id(), madmin.UpdateServiceAccountReq{
NewExpiration: &expiration,
NewPolicy: processServiceAccountPolicy(policy),
})
if err != nil {
return NewResourceError("error updating service account expiration %s: %s", d.Id(), err)
Expand Down

0 comments on commit 655b090

Please sign in to comment.