terraform/internal/command/workdir
Martin Atkins 06f51dbe04 command/workdir: Model the "backend state" file format
Historically (before there were "backends") Terraform had a single state
file format used both for real state snapshots and for tracking where
remote state was stored.

Terraform v0.12 caused these two to be split because we adopted state
snapshot version 4 for real snapshots but retained a subset of version 3
for tracking the remote backend configuration in the local working
directory.

Unfortunately we previously kept that working by retaining a snapshot of
the entire Terraform v0.11 "terraform" package as legacy/terraform, which
happened to still be around because we also needed to retain a copy of
the entire legacy SDK to keep the remote state backends working.

This now hoists just the tiny slice of legacy terraform package
functionality needed to implement the "backend state" file format into
package workdir. This package is a good home for it because it's part of
the working directory state. Ideally it would be accessed through methods
of the workdir.Dir type, but that's too disruptive a refactor to combine
into this and so that'll need to wait for another day; for now we'll keep
the existing callers doing their access through our "clistate" package
that is itself a forked snapshot of what statemgr.Filesystem used to be
in Terraform v0.11.

This removes all but one of the uses of "legacy/terraform" aside from calls
in the other packages under "legacy". We'll clean up the last one in a
later commit, because it's not related to the backend state file format.
2024-03-08 17:21:53 -08:00
..
backend_state.go command/workdir: Model the "backend state" file format 2024-03-08 17:21:53 -08:00
backend_state_test.go command/workdir: Model the "backend state" file format 2024-03-08 17:21:53 -08:00
dir.go Update copyright file headers to BUSL-1.1 2023-08-10 23:43:27 +01:00
doc.go Update copyright file headers to BUSL-1.1 2023-08-10 23:43:27 +01:00
normalize_path.go Update copyright file headers to BUSL-1.1 2023-08-10 23:43:27 +01:00
plugin_dirs.go Update copyright file headers to BUSL-1.1 2023-08-10 23:43:27 +01:00
plugin_dirs_test.go Update copyright file headers to BUSL-1.1 2023-08-10 23:43:27 +01:00