mirror of
https://git.vectorsigma.ru/public/atlantis.git
synced 2026-07-29 01:58:18 +00:00
fix: Log streaming broken with TFE local execution mode (#2364)
This commit is contained in:
@@ -104,6 +104,7 @@ const (
|
||||
VarFileAllowlistFlag = "var-file-allowlist"
|
||||
VCSStatusName = "vcs-status-name"
|
||||
TFEHostnameFlag = "tfe-hostname"
|
||||
TFELocalExecutionModeFlag = "tfe-local-execution-mode"
|
||||
TFETokenFlag = "tfe-token"
|
||||
WriteGitCredsFlag = "write-git-creds"
|
||||
WebBasicAuthFlag = "web-basic-auth"
|
||||
@@ -422,6 +423,10 @@ var boolFlags = map[string]boolFlag{
|
||||
description: "Skips cloning the PR repo if there are no projects were changed in the PR.",
|
||||
defaultValue: false,
|
||||
},
|
||||
TFELocalExecutionModeFlag: {
|
||||
description: "Enable if you're using local execution mode (instead of TFE/C's remote execution mode).",
|
||||
defaultValue: false,
|
||||
},
|
||||
WebBasicAuthFlag: {
|
||||
description: "Switches on or off the Basic Authentication on the HTTP Middleware interface",
|
||||
defaultValue: DefaultWebBasicAuth,
|
||||
|
||||
@@ -102,6 +102,7 @@ var testFlags = map[string]interface{}{
|
||||
SSLKeyFileFlag: "key-file",
|
||||
TFDownloadURLFlag: "https://my-hostname.com",
|
||||
TFEHostnameFlag: "my-hostname",
|
||||
TFELocalExecutionModeFlag: true,
|
||||
TFETokenFlag: "my-token",
|
||||
VCSStatusName: "my-status",
|
||||
WriteGitCredsFlag: true,
|
||||
|
||||
@@ -626,6 +626,12 @@ Values are chosen in this order:
|
||||
If using Terraform Cloud (i.e. you don't have your own Terraform Enterprise installation)
|
||||
no need to set since it defaults to `app.terraform.io`.
|
||||
|
||||
* ### `--tfe-local-execution-mode`
|
||||
```bash
|
||||
atlantis server --tfe-local-execution-mode
|
||||
```
|
||||
Enable if you're using local execution mode (instead of TFE/C's remote execution mode). See [Terraform Cloud](terraform-cloud.html) for more details.
|
||||
|
||||
* ### `--tfe-token`
|
||||
```bash
|
||||
atlantis server --tfe-token="xxx.atlasv1.yyy"
|
||||
|
||||
@@ -73,6 +73,10 @@ flag to its hostname.
|
||||
That's it! Atlantis should be able to perform Terraform operations using Terraform Cloud/Enterprise's
|
||||
remote state backend now.
|
||||
|
||||
:::warning
|
||||
If you're using local execution mode for your workspaces, remember to set the
|
||||
`--tfe-local-execution-mode`. Otherwise you won't see the logs in Atlantis.
|
||||
|
||||
:::warning
|
||||
The Terraform Cloud/Enterprise integration only works with the built-in
|
||||
`plan` and `apply` steps. It does not work with custom `run` steps that replace
|
||||
|
||||
@@ -351,9 +351,9 @@ func NewServer(userConfig UserConfig, config Config) (*Server, error) {
|
||||
}
|
||||
|
||||
var projectCmdOutputHandler jobs.ProjectCommandOutputHandler
|
||||
// When TFE is enabled log streaming is not necessary.
|
||||
|
||||
if userConfig.TFEToken != "" {
|
||||
if userConfig.TFEToken != "" && !userConfig.TFELocalExecutionMode {
|
||||
// When TFE is enabled and using remote execution mode log streaming is not necessary.
|
||||
projectCmdOutputHandler = &jobs.NoopProjectOutputHandler{}
|
||||
} else {
|
||||
projectCmdOutput := make(chan *jobs.ProjectCmdOutputLine)
|
||||
|
||||
@@ -85,6 +85,7 @@ type UserConfig struct {
|
||||
SSLKeyFile string `mapstructure:"ssl-key-file"`
|
||||
TFDownloadURL string `mapstructure:"tf-download-url"`
|
||||
TFEHostname string `mapstructure:"tfe-hostname"`
|
||||
TFELocalExecutionMode bool `mapstructure:"tfe-local-execution-mode"`
|
||||
TFEToken string `mapstructure:"tfe-token"`
|
||||
VarFileAllowlist string `mapstructure:"var-file-allowlist"`
|
||||
VCSStatusName string `mapstructure:"vcs-status-name"`
|
||||
|
||||
Reference in New Issue
Block a user