-
Notifications
You must be signed in to change notification settings - Fork 272
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
Creating a repository with init_type as Uninitialized fails on subsequent apply #498
Comments
Because we use the AzDO provider to keep the org in sync with configuration, we run apply regularly. With this issue in play, we can't use uninitialized repository resources and must use Clean instead. |
There is also another issue with this. If you do the first apply with an uninitialized repo, followed by creating a build branch policy that uses the default_branch then you get the following error.
The workaround here was to not specify the default branch as it was optional on the build policy anyway. That then leads into the issue above when apply comes in against the repository the second time. |
@roryprimrose When setting the |
Community Note
Terraform (and Azure DevOps Provider) Version
Affected Resource(s)
azuredevops_git_repository
Terraform Configuration Files
Debug Output
Output from first apply
Output from second apply
Panic Output
Expected Behavior
Apply the second time should not fail.
Actual Behavior
The first apply does not seem to set the default branch because the repo is going to be uninitialized. The second apply sees that the default branch is different and tries to set it. This then fails on the AzDO REST API because the default branch doesn't exist.
Is it possible to have the provider not try to set the default_branch if the repo is still uninitialized?
Steps to Reproduce
Important Factoids
N/A
References
The text was updated successfully, but these errors were encountered: