Skip to content

Commit

Permalink
cliconfig: Move HCL 1.0-based language out of the way
Browse files Browse the repository at this point in the history
We've been continuing to maintain the HCL 1-based CLI configuration
language to keep compatibility with prior versions, but the HCL 1 API is
constraining and it's annoying to have both versions of HCL in Terraform
at once.

This commit doesn't change any user-visible behavior but it does rename
a bunch of things in the cliconfig package to include the word "Legacy" so
that we can gradually build out an HCL 2 based new implementation
alongside and eventually support them both together.

The plan to support them both at once is to also switch over to using
OS-standard configuration file locations (like XDG Base Directory on Linux)
at the same time and treat the new locations as an opt-in for the new
language variant, with both continuing to be supported for the forseeable
future but the legacy one likely becoming increasingly more deprecated as
it ages.
  • Loading branch information
apparentlymart committed Dec 2, 2020
1 parent 0346eff commit cb8bb69
Show file tree
Hide file tree
Showing 15 changed files with 857 additions and 736 deletions.
4 changes: 2 additions & 2 deletions checkpoint.go
Expand Up @@ -18,15 +18,15 @@ var checkpointResult chan *checkpoint.CheckResponse

// runCheckpoint runs a HashiCorp Checkpoint request. You can read about
// Checkpoint here: https://github.com/hashicorp/go-checkpoint.
func runCheckpoint(c *cliconfig.Config) {
func runCheckpoint(c *cliconfig.LegacyConfig) {
// If the user doesn't want checkpoint at all, then return.
if c.DisableCheckpoint {
log.Printf("[INFO] Checkpoint disabled. Not running.")
checkpointResult <- nil
return
}

configDir, err := cliconfig.ConfigDir()
configDir, err := cliconfig.LegacyConfigDir()
if err != nil {
log.Printf("[ERR] Checkpoint setup error: %s", err)
checkpointResult <- nil
Expand Down

0 comments on commit cb8bb69

Please sign in to comment.