This project is mirrored from https://:*****@github.com/hashicorp/terraform.git.
Pull mirroring failed .
Repository mirroring has been paused due to too many failed attempts. It can be resumed by a project maintainer.
Repository mirroring has been paused due to too many failed attempts. It can be resumed by a project maintainer.
- 26 Aug, 2022 1 commit
-
-
Martin Atkins authored
This allows us to retain check results from one run into the next, so that we can react to status changes between runs and potentially report e.g. that a previously-failing check has now been fixed, or that a previously-failing check is "still failing" so that an operator can get a hint as to whether a problem is something they've just introduced or if it was already an active problem before they made a change.
-
- 25 Jul, 2022 1 commit
-
-
Brandon Croft authored
Normally, `terraform output` refreshes and reads the entire state in the command package before pulling output values out of it. This doesn't give Terraform Cloud the opportunity to apply the read state outputs org permission and instead applies the read state versions permission. I decided to expand the state manager interface to provide a separate GetRootOutputValues function in order to give the cloud backend a more nuanced opportunity to fetch just the outputs. This required moving state Refresh/Read code that was previously in the command into the shared backend state as well as the filesystem state packages.
-
- 21 Jul, 2022 1 commit
-
-
Martin Atkins authored
These tests were originally written long before Go supported subtests explicitly, but now that we have t.Run we can avoid the prior problem that one test failing would mask all of the others that followed it. Now we'll always run all of them, potentially collecting more errors in a single run so we can have more context to debug with and potentially fix them all in a single step rather than one by one.
-
- 17 May, 2021 1 commit
-
-
Martin Atkins authored
This is part of a general effort to move all of Terraform's non-library package surface under internal in order to reinforce that these are for internal use within Terraform only. If you were previously importing packages under this prefix into an external codebase, you could pin to an earlier release tag as an interim solution until you've make a plan to achieve the same functionality some other way.
-
- 10 Sep, 2020 1 commit
-
-
Pam Selle authored
In refactoring the force push code when implementing force push for the Terraform remote backend, a bug was introduced that meant that backends that don't implement the EnableForcePush method would still have their state validated. This commit fixes that, and adds test coverage such that there is a separate mockRemoteClient that has this method implemented.
-
- 11 Aug, 2020 1 commit
-
-
Kristin Laemmert authored
Most of the state package has been deprecated by the states package. This PR replaces all the references to the old state package that can be done simply - the low-hanging fruit. * states: move state.Locker to statemgr The state.Locker interface was a wrapper around a statemgr.Full, so moving this was relatively straightforward. * command: remove unnecessary use of state package for writing local terraform state files * move state.LocalState into terraform package state.LocalState is responsible for managing terraform.States, so it made sense (to me) to move it into the terraform package. * slight change of heart: move state.LocalState into clistate instead of terraform
-
- 06 May, 2020 1 commit
-
-
Lee Trout authored
Both differing serials and lineage protections should be bypassed with the -force flag (in addition to resources). Compared to other backends we aren’t just shipping over the state bytes in a simple payload during the persistence phase of the push command and the force flag added to the Go TFE client needs to be specified at that time. To prevent changing every method signature of PersistState of the remote client I added an optional interface that provides a hook to flag the Client as operating in a force push context. Changing the method signature would be more explicit at the cost of not being used anywhere else currently or the optional interface pattern could be applied to the state itself so it could be upgraded to support PersistState(force bool) only when needed. Prior to this only the resources of the state were checked for changes not the lineage or the serial. To bring this in line with documented behavior noted above those attributes also have a “read” counterpart just like state has. These are now checked along with state to determine if the state as a whole is unchanged. Tests were altered to table driven test format and testing was expanded to include WriteStateForMigration and its interaction with a ClientForcePusher type.
-
- 04 May, 2020 1 commit
-
-
Lee Trout authored
We only persist a new state if the actual state contents have changed. This test demonstrates that behavior by calling write and persist methods when either the lineage or serial have changed.
-
- 20 Jun, 2019 2 commits
-
-
Martin Atkins authored
Previously we would write to the backend for every call to PersistState, even if nothing changed since the last write, but update the serial only if the state had changed. The Terraform Cloud & Enterprise state storage have a simple safety check that any future write with an already-used lineage and serial must be byte-for-byte identical. StatesMarshalEqual is intended to detect that, but it only actually detects changes the state itself, and not changes to the snapshot metadata. Because we write the current Terraform version into the snapshot metadata during serialization, we'd previously have an issue where if the first state write after upgrading Terraform to a new version happened to change nothing about the state content then we'd write a new snapshot that differed only by Terraform version, and Terraform Cloud/Enterprise would then reject it. The snapshot header is discarded immediately after decoding, so we can't use information from it when deciding whether to increment the serial. The next best thing is to skip sending no-op snapshot updates to the state client in the first place. These writes are unnecessary anyway, and state storage owners have asked us in the past to elide these to avoid generating noise in their version logs, so we'll also finally meet those requests as a nice side-effect of this change. We didn't previously have tests for the full flow of retrieving and then successively updating persisted state snapshots, so this includes a test which covers that logic and includes an assertion that a no-op update does not get written to the state client.
-
Martin Atkins authored
These statemgr interfaces are the new names for the older interfaces in the "state" package. These types alias each other so it doesn't really matter which we use, but the "state" package is deprecated and we intend to eventually remove it, so this is a further step in that direction.
-
- 17 Oct, 2018 2 commits
-
-
Martin Atkins authored
The underlying bug that was causing this test to hang has since been fixed.
-
Martin Atkins authored
One of the tests was hanging, so for now it's stubbed out until we can get to the bottom of the hang on a subsequent pass.
-
- 25 May, 2017 1 commit
-
-
James Bardin authored
-
- 20 Feb, 2017 1 commit
-
-
James Bardin authored
moved to a new backend
-
- 15 Feb, 2017 1 commit
-
-
Mitchell Hashimoto authored
This adds unit tests (that will fail at compile time) if various structs don't implement the right interfaces for locking
-
- 24 Feb, 2015 1 commit
-
-
Mitchell Hashimoto authored
-
- 23 Feb, 2015 2 commits
-
-
Mitchell Hashimoto authored
-
Mitchell Hashimoto authored
-