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.
  1. 19 Nov, 2018 11 commits
    • Martin Atkins's avatar
      command: Partially fix TestMetaBackend_planLocalStatePath · 2b9f92be
      Martin Atkins authored
      This test is testing some strange implementation details of the old
      local backend which do not hold with the new filesystem state manager.
      Specifically, it was expecting state to be read from the stateOutPath
      rather than the statePath, which makes no sense here because the backend
      is configured to read from the default terraform.tfstate file (which does
      not exist.)
      
      There is another problem with this test which will be addressed in a
      subsequent commit.
      2b9f92be
    • Martin Atkins's avatar
      command: Fix TestMetaBackend_configuredChangeCopy_multiToNoDefaultWithoutDefault · aecb66d3
      Martin Atkins authored
      As part of integrating the new "remote" backend we relaxed the requirement
      that a "default" workspace must exist in all backends and now skip
      migrating empty workspace states to avoid creating unnecessary "default"
      workspaces when switching between backends that require it and backends
      that don't, such as when switching from the local backend (which always
      has a "default" workspace) to Terraform Enterprise.
      aecb66d3
    • Martin Atkins's avatar
      command: Fix TestMetaBackend_configuredChangeCopy_multiToMulti · ec27526c
      Martin Atkins authored
      This was failing because we now handle the settings for the local backend
      a little differently as a result of decoding it with the HCL2 machinery.
      
      Specifically, the backend.State* fields are now assumed to be what is
      given in configuration, and any CLI overrides are maintained separately
      in OverrideState* fields so that they can be imposed "just in time" in
      StatePaths.
      
      This is particularly important because OverrideStatePath (when set) is
      used regardless of workspace name, while StatePath is a suitable value
      only for the "default" workspace, with others needing to be constructed
      from StateWorkspaceDir instead.
      ec27526c
    • Martin Atkins's avatar
      command: More logging during migration · 6c7cecfb
      Martin Atkins authored
      This just finishes off the logging added in earlier commits to get all
      the way through to the actual migration call.
      6c7cecfb
    • Martin Atkins's avatar
      command: Fix various TestMetaBackend-prefix tests · f39a5d09
      Martin Atkins authored
      Our new state model has a different implementation of "empty" that doesn't
      consider lineage/serial, so we need to have some actual content in these
      state fixtures to avoid them being skipped during state migrations.
      f39a5d09
    • Martin Atkins's avatar
      command: Use statemgr.Import and statemgr.Export for state push and pull · 22c84c71
      Martin Atkins authored
      We previously hacked around the import/export functionality being missing
      in the statemgr layer after refactoring, but now it's been reintroduced
      to fix functionality elsewhere we should use the centralized Import and
      Export functions to ensure consistent behavior.
      
      In particular, this pushes the logic for checking lineage and serial
      during push down into the state manager itself, which is better because
      all other details about lineage and serial are managed within the state
      managers.
      22c84c71
    • Martin Atkins's avatar
      states/statemgr: Fix the Filesystem state manager tests · 985b414d
      Martin Atkins authored
      Now that we're verifying the Terraform version during state loading, we
      need to force a particular Terraform version to use during these tests.
      985b414d
    • Martin Atkins's avatar
      command: Fix TestMetaBackend_configureNewWithState · aacbe1d1
      Martin Atkins authored
      This test was initially failing because its fixture had a state which our
      new state models consider to be "empty", and thus it was not migrated.
      
      After fixing that (by adding an output to the fixture), this revealed a
      bug that the lineage was not being persisted through the migration. This
      is fixed by using the statemgr.Migrate method instead of writing via the
      normal Writer interface, which allows two cooperating state managers to
      properly transfer the lineage and serial along with the state snapshot.
      aacbe1d1
    • Martin Atkins's avatar
    • Martin Atkins's avatar
      states/statemgr: Migrate, Import, and Export functions · 94510bc1
      Martin Atkins authored
      In our recent refactoring of the state manager interfaces we made serial
      and lineage management the responsibility of the state managers
      themselves, not exposing them at all to most callers, and allowing for
      simple state managers that don't implement them at all.
      
      However, we do have some specific cases where we need to preserve these
      properly when available, such as migration between backends, and the
      "terraform state push" and "terraform state pull" commands.
      
      These new functions and their associated optional interface allow the
      logic here to be captured in one place and access via some simple
      calls. Separating this from the main interface leaves things simple for
      the normal uses of state managers.
      
      Since these functions are mostly just thin wrappers around other
      functionality, they are not yet well-tested directly, but will be
      indirectly tested through the tests of their callers. A subsequent commit
      will add more unit tests here.
      94510bc1
    • Martin Atkins's avatar
      command: Fix TestMetaBackend_emptyWithExplicitState · 22933912
      Martin Atkins authored
      This test was incorrectly updated in a previous iteration, with it
      creating a modified state to write but then not actually writing it,
      writing an empty test state instead.
      
      This made the test fail because a backup state file is created only if
      the new state snapshot is different to the old when written.
      22933912
  2. 17 Nov, 2018 1 commit
  3. 16 Nov, 2018 15 commits
  4. 15 Nov, 2018 8 commits
  5. 13 Nov, 2018 5 commits