mirror of https://github.com/hashicorp/terraform
fix: Stop our anti-`init -upgrade` check panicking when an overridden provider is in use. (#38635)
Prior to this commit we wanted to validate the provider upgrade process using data that was only populated during backend initialisation (as that was the only place using that data previously). Now we enable the provider supply mode data to be available before backends are initialised. After making that available, we can update the check after getProvidersFromConfig that protects against the provider version being changed outside of a deliberate state migration process. If the state store provider is overridden then the upgrade process doesn't impact that provider anyway, so the check can be skipped. Also, this protects against errors if there was ever a built in provider supplying a state store implementation.pull/38655/head
parent
dcfb4828cc
commit
cf0aae24f4
@ -0,0 +1,6 @@
|
||||
# This file is maintained automatically by "terraform init".
|
||||
# Manual edits may be lost in future updates.
|
||||
|
||||
provider "registry.terraform.io/hashicorp/simple6" {
|
||||
version = "0.0.1"
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
{
|
||||
"version": 3,
|
||||
"terraform_version": "1.15.0",
|
||||
"state_store": {
|
||||
"type": "simple6_fs",
|
||||
"provider": {
|
||||
"version": "0.0.1",
|
||||
"source": "registry.terraform.io/hashicorp/simple6",
|
||||
"config": {}
|
||||
},
|
||||
"config": {
|
||||
"workspace_dir": "states"
|
||||
},
|
||||
"hash": 3942813381,
|
||||
"provider_supply_mode": "reattached"
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,21 @@
|
||||
terraform {
|
||||
required_providers {
|
||||
simple6 = {
|
||||
source = "registry.terraform.io/hashicorp/simple6"
|
||||
}
|
||||
}
|
||||
|
||||
state_store "simple6_fs" {
|
||||
provider "simple6" {}
|
||||
|
||||
workspace_dir = "states"
|
||||
}
|
||||
}
|
||||
|
||||
variable "name" {
|
||||
default = "world"
|
||||
}
|
||||
|
||||
resource "terraform_data" "my-data" {
|
||||
input = "hello ${var.name}"
|
||||
}
|
||||
@ -0,0 +1,3 @@
|
||||
output "greeting" {
|
||||
value = resource.terraform_data.my-data.output
|
||||
}
|
||||
@ -0,0 +1,40 @@
|
||||
{
|
||||
"version": 4,
|
||||
"terraform_version": "1.15.0",
|
||||
"serial": 1,
|
||||
"lineage": "9e13d881-e480-7a63-d47a-b4f5224e6743",
|
||||
"outputs": {
|
||||
"greeting": {
|
||||
"value": "hello world",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"resources": [
|
||||
{
|
||||
"mode": "managed",
|
||||
"type": "terraform_data",
|
||||
"name": "my-data",
|
||||
"provider": "provider[\"terraform.io/builtin/terraform\"]",
|
||||
"instances": [
|
||||
{
|
||||
"schema_version": 0,
|
||||
"attributes": {
|
||||
"id": "d71fb368-2ba1-fb4c-5bd9-6a2b7f05d60c",
|
||||
"input": {
|
||||
"value": "hello world",
|
||||
"type": "string"
|
||||
},
|
||||
"output": {
|
||||
"value": "hello world",
|
||||
"type": "string"
|
||||
},
|
||||
"triggers_replace": null
|
||||
},
|
||||
"sensitive_attributes": [],
|
||||
"identity_schema_version": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"check_results": null
|
||||
}
|
||||
Loading…
Reference in new issue