-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: change tofu unpacking to default to terraform registry (#1001)
* fix: default to registry.terraform.io as the default unpacking location when reading a brokerpak and creating the plugins folder, we were defaulting the domain of the providers to registry.opentofu.org instead of registry.terraform.io. This was not consistent with our default for the download location, which is registry.terraform.io. It now defaults to terraform registry in both places. This means brokerpaks which don't indicate any domain in their provider definitions in the manifest.yml file, will need to fully qualify the provider in the required_providers block to avoid errors, as OpenTofu will default to the opentofu registry. [#187379198](https://www.pivotaltracker.com/story/show/187379198) * fix: workaround to prevent tofu from renaming providers on show when fixing [this issue in tofu](opentofu/opentofu#1139) some logic was introduced to change the hostname of the providers to [#187199940](https://www.pivotaltracker.com/story/show/187199940) point to the opentofu registry (in-memory) when executing a show, if the terraform code didn't specify a hostname in the provider's block. However this functionality seems to be buggy and it is renaming providers regardless, which breaks the tf_attribute_skip functionality. A way to disable this rename is to set the OPENTOFU_STATEFILE_PROVIDER_ADDRESS_TRANSLATION environment variable to `0`. This PR implements that workaround for the broker. [#187379198](https://www.pivotaltracker.com/story/show/187379198) Co-authored-by: Felisia Martini <[email protected]> * chore: tidy up go.mod [#187379198](https://www.pivotaltracker.com/story/show/187379198) Co-authored-by: Marcela Campo <[email protected]> * chore: add reference to opentofu issue [#187379198](https://www.pivotaltracker.com/story/show/187379198) Co-authored-by: Felisia Martini <[email protected]> --------- Co-authored-by: Felisia Martini <[email protected]>
- Loading branch information
1 parent
53b4080
commit 9848ca2
Showing
38 changed files
with
249 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,12 @@ | ||
// Fails as required "length" parameter is missing | ||
terraform { | ||
required_providers { | ||
random = { | ||
source = "registry.terraform.io/hashicorp/random" | ||
} | ||
} | ||
} | ||
|
||
resource "random_string" "random" {} | ||
|
||
output bind_output { value = random_string.random.result } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,11 @@ | ||
terraform { | ||
required_providers { | ||
random = { | ||
source = "registry.terraform.io/hashicorp/random" | ||
} | ||
} | ||
} | ||
|
||
resource "random_uuid" "random" {} | ||
|
||
output provision_output { value = random_uuid.random.result } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,11 @@ | ||
terraform { | ||
required_providers { | ||
random = { | ||
source = "registry.terraform.io/hashicorp/random" | ||
} | ||
} | ||
} | ||
|
||
resource "random_uuid" "random" {} | ||
|
||
output bind_output { value = random_uuid.random.result } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,11 @@ | ||
terraform { | ||
required_providers { | ||
random = { | ||
source = "registry.terraform.io/hashicorp/random" | ||
} | ||
} | ||
} | ||
|
||
resource "random_uuid" "random" {} | ||
|
||
output provision_output { value = random_uuid.random.result } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 7 additions & 1 deletion
8
integrationtest/fixtures/prevent-destroy-during-update/fake-provision.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
integrationtest/fixtures/provision-cleanup/fake-string-provision.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,12 @@ | ||
// Fails as required "length" parameter is missing | ||
terraform { | ||
required_providers { | ||
random = { | ||
source = "registry.terraform.io/hashicorp/random" | ||
} | ||
} | ||
} | ||
|
||
resource "random_string" "random" {} | ||
|
||
output provision_output { value = random_string.random.result } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
terraform { | ||
required_providers { | ||
random = { | ||
source = "registry.terraform.io/hashicorp/random" | ||
} | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
integrationtest/fixtures/termination-recovery/fake-uuid-bind.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,11 @@ | ||
terraform { | ||
required_providers { | ||
random = { | ||
source = "registry.terraform.io/hashicorp/random" | ||
} | ||
} | ||
} | ||
|
||
resource "random_uuid" "random" {} | ||
|
||
output bind_output { value = random_uuid.random.result } |
8 changes: 8 additions & 0 deletions
8
integrationtest/fixtures/termination-recovery/fake-uuid-provision.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,11 @@ | ||
terraform { | ||
required_providers { | ||
random = { | ||
source = "registry.terraform.io/hashicorp/random" | ||
} | ||
} | ||
} | ||
|
||
resource "random_uuid" "random" {} | ||
|
||
output provision_output { value = random_uuid.random.result } |
2 changes: 1 addition & 1 deletion
2
integrationtest/fixtures/terraform-block-action-before-upgrade-updated/fake-provision.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
integrationtest/fixtures/terraform-block-action-before-upgrade/fake-provision.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
integrationtest/fixtures/terraform-module-upgrade-updated/fake-provision.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 7 additions & 1 deletion
8
integrationtest/fixtures/terraform-module-upgrade/fake-provision.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
integrationtest/fixtures/terraform-rename-provider/fake-provision.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
integrationtest/fixtures/terraform-upgrade-updated/fake-bind.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
integrationtest/fixtures/terraform-upgrade-updated/fake-provision.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 0 additions & 10 deletions
10
integrationtest/fixtures/tf_attribute_skip/fake-provision.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
terraform { | ||
required_providers { | ||
random = { | ||
source = "registry.terraform.io/hashicorp/random" | ||
version = "3.5.1" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.