-
Notifications
You must be signed in to change notification settings - Fork 745
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
Need instructions for migrating from hashicorp/github to integrations/github #652
Comments
On my side I make:
And it works; at the beginning I didn't update my modules so I got some confusion.... |
🤔 maybe we document this as a breaking change? |
Also @docwhat if the problem persists, it's probably useful to check You have details per plan and modules, output is like:
|
@docwhat I am also seeing the same issue as you do and it seems that, at least for me, it was due to the bug described here: #655 (comment)
by setting the |
terraform {
required_providers {
github = {
source = "integrations/github"
}
}
} Adding the |
@jcudit no, unfortunately it does not. I have:
and still both get installed: Initializing provider plugins...
Partner and community providers are signed by their developers. Terraform has created a lock file .terraform.lock.hcl to record the provider Warning: Additional provider information from registry The remote registry returned warnings for
What is going on in
|
@MRostanski it looks like you're hitting the same thing we just did: if you use modules, each module needs to declare its own Without that, you end up with the mix of the two providers... |
The workaround is to put this snippet with the main.tf and also inside the github module directory. lets assume we have main.tf and subdirectory containing github.tf. The main file uses a module that uses the github resource. Now the problem begins. Terraform download both integrations/github and hashicorp/github, but if you put the required_providers in both places, with the main and within the subdirectory, it stops the problem. |
This is the one, thanks for this workaround! |
I have already run When using github resource inside modules, then this becomes quite confusing. As an experiment, I put nothing github under
Now, if I put It initialized successfully, but the provider config in the top level isn't inherited to the module, so it can't work. Then, if I So, I guess this problem is caused by both |
I can confirm @larstobi findings on my end. |
Can this be considered a bug, then, and not just about documentation? |
I'm not sure how I would go about troubleshooting that at the provider level. I wonder if that's something specific to the Terraform platform or tooling. |
Plan was giving warning: ``` The remote registry returned warnings for registry.terraform.io/-/fastly: - For users on Terraform 0.13 or greater, this provider has moved to fastly/fastly. Please update your source in required_providers. ``` Need to define `required_providers` in multiple places, as per integrations/terraform-provider-github#652 (comment)
…cified in modules main.tf file - possible mitigation -> integrations/terraform-provider-github#652
I meet same issue lately. a. change providers from module
in local just refer providers:
b. rm -rf .terraform .terraform.lock.hcl finally, I add following block in local tf. and run step b and c.
and only integrations/github is used. and tf plan also smoothly. |
so seems to switch providers from old one. we must update both module and local tf provider. |
I have also solved this problem by using replace-provider.
|
👋 Hey Friends, this issue has been automatically marked as |
This doesn't in fact solve the issue completely. See my above findings. |
Now that GitHub has taken over ownership of the
github
provider we need some instructions for upgrading.I tried the obvious:
required_providers
:source
attribute tointegrations/github
.version
to4.2.0
(from4.1.0
in my case)terraform state replace-provider registry.terraform.io/hashicorp/github registry.terraform.io/integrations/github
terraform init
terraform plan
Unfortunately, it then seems to hang forever.
TRACE shows that it is trying to access github.com (it should be using our enterprise server) without specifying the org using the hashicorp 4.1.0 provider:
There is exactly one
GET
using the 4.2 provider:No matter what I do, terraform insists on using the official hashicorp provider.
The text was updated successfully, but these errors were encountered: