You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// If we're handling the builtin "terraform" provider then there's no version information to store in the dependency lock file, so don't access it.
1673
-
// We must record a value into the backend state file, and we cannot include a value that changes (e.g. the Terraform core binary version) as migration
1674
-
// is impossible with builtin providers.
1675
-
// So, we use an arbitrary stand-in version.
1676
-
standInVersion, err:=version.NewVersion("0.0.1")
1677
-
iferr!=nil {
1678
-
diags=diags.Append(fmt.Errorf("Error when creating a backend state file. This is a bug in Terraform and should be reported: %w",
1679
-
err))
1680
-
returnnil, diags
1681
-
}
1682
-
pVersion=standInVersion
1671
+
varpVersion*version.Version// This will remain nil for builtin providers or unmanaged providers.
Summary: "State storage is using a builtin provider",
1676
+
Detail: "Terraform is using a builtin provider for initializing state storage. Terraform will be less able to detect when state migrations are required in future init commands.",
diags=diags.Append(fmt.Errorf("Error determining if the state storage provider is reattached or not. This is a bug in Terraform and should be reported: %w",
1687
1682
err))
1688
1683
returnnil, diags
1689
1684
}
1690
1685
ifisReattached {
1691
-
// If the provider is unmanaged then it won't be in the locks.
1692
-
// If there are no locks then there's no version information to for us to access and use when creating the backend state file.
1693
-
// So, we use an arbitrary stand-in version.
1694
1686
diags=diags.Append(&hcl.Diagnostic{
1695
1687
Severity: hcl.DiagWarning,
1696
1688
Summary: "State storage provider is not managed by Terraform",
1697
-
Detail: "Terraform is using a provider supplied via TF_REATTACH_PROVIDERS for initializing state storage. This will affect Terraform's ability to detect when state migrations are required.",
1689
+
Detail: "Terraform is using a provider supplied via TF_REATTACH_PROVIDERS for initializing state storage. Terraform will be less able to detect when state migrations are required in future init commands.",
1698
1690
})
1699
-
standInVersion, err:=version.NewVersion("0.0.1")
1700
-
iferr!=nil {
1701
-
diags=diags.Append(fmt.Errorf("Error when creating a backend state file. This is a bug in Terraform and should be reported: %w",
1702
-
err))
1703
-
returnnil, diags
1704
-
}
1705
-
pVersion=standInVersion
1706
1691
} else {
1707
1692
// The provider is not built in and is being managed by Terraform
0 commit comments