Implement the Enterprise enhanced remote backend

This commit is contained in:
Sander van Harmelen
2018-07-04 17:24:49 +02:00
parent 179b32d426
commit 7fb2d1b8de
37 changed files with 2342 additions and 43 deletions

14
main.go
View File

@@ -11,9 +11,8 @@ import (
"strings"
"sync"
"github.com/mitchellh/colorstring"
"github.com/hashicorp/go-plugin"
backendInit "github.com/hashicorp/terraform/backend/init"
"github.com/hashicorp/terraform/command/format"
"github.com/hashicorp/terraform/helper/logging"
"github.com/hashicorp/terraform/svchost/disco"
@@ -21,6 +20,7 @@ import (
"github.com/mattn/go-colorable"
"github.com/mattn/go-shellwords"
"github.com/mitchellh/cli"
"github.com/mitchellh/colorstring"
"github.com/mitchellh/panicwrap"
"github.com/mitchellh/prefixedio"
)
@@ -143,10 +143,16 @@ func wrappedMain() int {
}
}
// Get any configured credentials from the config and initialize
// a service discovery object.
credsSrc := credentialsSource(config)
services := disco.NewWithCredentialsSource(credsSrc)
// Initialize the backends.
backendInit.Init(services)
// In tests, Commands may already be set to provide mock commands
if Commands == nil {
credsSrc := credentialsSource(config)
services := disco.NewWithCredentialsSource(credsSrc)
initCommands(config, services)
}