-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhance Terraform Support for Simultaneously Managing Shared and Assigned Repositories in Artifactory #110
Comments
I tried the alternative I mentioned above and it seems like that also does not work. Even with ignored
|
@borkke Have you tried the recently released project resource |
@borkke Project sharing support is forthcoming. We are waiting for some projects API enhancement needed before we can add it to the project provider. |
@alexhung Thank you for a quick response. I will give it a try on Monday. Regarding sharing option. This is already good information! Do you know roughly when I can expect this feature? Is there also a ticket somewhere that I can “follow” to get updates on the progress? |
@borkke Currently scheduled for Q2. |
@alexhung Thanks for the information, I'm looking forward to this feature. I tried the In few words:
I exported the log file and added some comments and TF plan |
@borkke Which version of the provider and Terraform CLI are you using? |
@alexhung Seems like I'm a bit behind Terraform version. I will upgrade and try later today.
|
@alexhung Same problem with the updated terraform version. Here is another log file. |
I just noticed that it doesn't happen always. Sometimes works fine and sometimes fails with that error message and when it does, I just run it again it's ok. |
@borkke Thanks for the logs. I'll look into this. |
@borkke So I think the issue is explained in this community post. The project provider uses the Projects API to assign a repository to a project during the "Create" part of the process. Before the end of this process, the provider set the resource ID to Then the provider uses the Artifactory Repository API to read back the current state from the repository. This read process also set the same resource ID (because "Read" is also used for refresh and import). However, due to the nature of Artifactory internal working, the repository may not immediately has the latest state. This means the repository's This is an known issue and we have plan in Q2 to add new Projects API to retrieve the repo assignment status reliably. In the meantime, I'll add retry logic to the "Read" process and have the provider to make a few (5?) attempts before giving up. |
@alexhung good news! I guess if you put 1s timeout between attempts and fail after 5 attempts, I think it should be fine. |
@borkke The Terraform SDKv2 retry mechanism doesn't support number of retry or interval between retries, unfortunately. It will attempt the retry until timeout is reached, which for Creation is 20 min out of the box. I can potentially set it lower but probably unnecessary. |
Add retry logic for project_repository create func
Is your feature request related to a problem? Please describe.
It seems like I can't manage "shared" repositories together with “assigned” repositories and this is what I need to do. My TF state gets messed up.
Describe the solution you'd like
I would like to create remote repos for all public repos we use and share with all the projects (I need sharing here).
Then, we plan to have ~10 projects and for each project we need many local repos assigned to a project and virtual also assigned to a project which contains local and the "shared remotes" (here I need assignments). All via Terraform.
Since I couldn't find an option to "share" via terraform, I went to the UI and shared it. Of course it starts to get messy. Even though I didn't use "assign to project" in the UI, I used "share", I'm seeing this change.
and then I get a message:
In the end, I think it would be a good idea to allow people to "share" repos on the repo level as part of the "artifactory_virtual_maven_repository" resource and leave the "repos = []" on the project level only for project assignments.
Describe alternatives you've considered
I was thinking to use the "project_key" in the repo to do the assignments (which is not suggested by the docs) and use lifecycle to ignore the "repos" on the project level. Then I have to share the repos manually via UI.
The text was updated successfully, but these errors were encountered: