You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When you set ignore_missing_user to true the project_user resources will not be properly created once the user is actually in the system.
When I implemented the ignore_missing_user I missed an important detail. The project_user will be added to the TF state and it does not detect any change due to that thinking the user is there. The TF provider needs additional mechanisms to detect whether a user is missing and attempt re-creation on the next apply.
A fully functioning terraform snippet that can be copy&pasted (no outside files or ENV vars unless that's part of the issue)
Your version of artifactory (you can curl it at $host/artifactory/api/system/version7.100.2
Your version of terraform: 1.5.6
Your version of terraform provider 1.9.0
Expected behavior
You apply this TF code and you get a warning about the missing user but the user is added to the state.
Manually create the user in artifactory (e.g. in a SSO scenario the user would login the first time becoming available as user)
Apply this TF code again and you will notice on the plan and apply that it will not do anything thinking nothing changed, nothing to be done.
Additional context
In the TF State / Plan there is no information about whether a user is considered missing or not. Unfortunately the TF API doesn't allow checking if a user exists unless you're an admin with global user administration rights. Hence the best choice is attempting to create the project_user and check the response but there is no real way to differenciate between "user not existing" and "user not assigned to project", the responses are the same.
I am thinking of a solution that we do not add the project_user to the state in this case so that the next run will re-try the create. But we do not fail in this case, just skip the state add/update.
My goal is to contribute a fix, but due to license and test environment limitations I might need assistence getting the integration tests green after manual testing.
The text was updated successfully, but these errors were encountered:
Describe the bug
When you set
ignore_missing_user
totrue
theproject_user
resources will not be properly created once the user is actually in the system.When I implemented the
ignore_missing_user
I missed an important detail. Theproject_user
will be added to the TF state and it does not detect any change due to that thinking the user is there. The TF provider needs additional mechanisms to detect whether a user is missing and attempt re-creation on the next apply.Requirements for and issue
curl
it at$host/artifactory/api/system/version
7.100.2Expected behavior
Additional context
In the TF State / Plan there is no information about whether a user is considered missing or not. Unfortunately the TF API doesn't allow checking if a user exists unless you're an admin with global user administration rights. Hence the best choice is attempting to create the
project_user
and check the response but there is no real way to differenciate between "user not existing" and "user not assigned to project", the responses are the same.I am thinking of a solution that we do not add the project_user to the state in this case so that the next run will re-try the create. But we do not fail in this case, just skip the state add/update.
My goal is to contribute a fix, but due to license and test environment limitations I might need assistence getting the integration tests green after manual testing.
The text was updated successfully, but these errors were encountered: