Closed eelginUPS closed 5 months ago
@eelginUPS Thank you for the report. Projects do not allows group without a role assigned to it. You can verify this on the web UI.
When a new project_group
is created with empty roles
, Artifactory returns the group with one role which it defaults to the "Viewer" role since that has the least permission.
I missed this use case when I created this resource and did not have a test for this.
To avoid state drift, you should include "Viewer" in the roles
list.
I'll be updating the resource to ensure roles
attribute must have at least one item.
[ ] A description of the bug When setting
roles: []
in a project_group resource, rather than the group having no project roles, it gets assigned the default value of["viewer"]
. I have noticed this issue before when defining users to a project in Terraform. What is peculiar is that the plan will clearly mark the "viewer" role to be removed from the plan, but after applying the permission still exists. Manually removing the viewer role resolves the issues as it is never recreated on apply once it is gone.[ ] A fully functioning terraform snippet that can be copy&pasted (no outside files or ENV vars unless that's part of the issue). If this is not supplied, this issue will likely be closed without any effort expended.
The plan correctly points out the roles to be removed
It also claims in the
apply
that the updates were applied.Versions of tf + providers: terraform_1.7.5_linux_amd64.zip jfrog/project v1.5.2 jfrog/platform v1.7.4 jfrog/artifactory v10.8.0
Expected behavior
roles: []
should apply what the plan states, and remove the default 'viewer' role.