Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Atlantis doesn't respect workspace settings #736

Closed
davidgereb opened this issue Aug 19, 2019 · 4 comments
Closed

Atlantis doesn't respect workspace settings #736

davidgereb opened this issue Aug 19, 2019 · 4 comments
Labels
question Further information is requested waiting-on-response Waiting for a response from the user

Comments

@davidgereb
Copy link

Issue description

workspace is defined on project level, however atlantis doesn't respect it

Expected behaviour

Atlantis uses the project's workspace key, like when you invoke it with atlantis -w sandbox

Actual behaviour

Atlantis uses default workspace instead of provided one

Atlantis version

atlantis 0.8.3

Terraform version

Terraform v0.12.6

Git repo provider

Bitbucket.org

Atlantis.yml

version: 3
automerge: true
projects:
- name: terraform-test
  dir: terraform
  terraform_version: v0.12.6
  workspace: sandbox
  autoplan:
    when_modified: ["terraform/*.tf"]
    enabled: true
  apply_requirements: [mergeable, approved]

Starting command

atlantis server --log-level="debug" \
--atlantis-url="$URL" \
--bitbucket-user="$USERNAME" \
--bitbucket-token="$TOKEN" \
--repo-whitelist="$REPO_WHITELIST"

Comment output

Ran Plan for dir: terraform workspace: default

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
+ create

Terraform will perform the following actions:

  # null_resource.example will be created
+ resource "null_resource" "example" {
      + id = (known after apply)
    }

Plan: 1 to add, 0 to change, 0 to destroy.
Releasing state lock. This may take a few moments...
▶ To apply this plan, comment:
atlantis apply -d terraform
🚮 To delete this plan click here
🔁 To plan this project again, comment:
atlantis plan -d terraform
⏩ To apply all unapplied plans from this pull request, comment:
atlantis apply
@lkysow
Copy link
Member

lkysow commented Aug 20, 2019

Can you post the log output please. I haven't seen this be an issue before.

@lkysow lkysow added question Further information is requested waiting-on-response Waiting for a response from the user labels Aug 21, 2019
@davidgereb
Copy link
Author

2019/08/22 09:30:12+0200 [WARN] server.go:560 cmd: Bitbucket Cloud does not support webhook secrets. This could allow attackers to spoof requests from Bitbucket. Ensure you are whitelisting Bitbucket IPs
2019/08/22 09:30:12+0200 [INFO] server.go:378 server: Atlantis started - listening on port 4141
2019/08/22 09:30:51+0200 [INFO] middleware.go:38 server: POST /events – from 127.0.0.1:51514
2019/08/22 09:30:51+0200 [DBUG] events_controller.go:100 server: Handling Bitbucket Cloud post
2019/08/22 09:30:51+0200 [DBUG] events_controller.go:150 server: Handling as pull request state changed event
2019/08/22 09:30:51+0200 [INFO] events_controller.go:244 server: Identified event as type "updated"
2019/08/22 09:30:51+0200 [INFO] events_controller.go:296 server: Executing autoplan
2019/08/22 09:30:51+0200 [INFO] middleware.go:42 server: POST /events – respond HTTP 200
2019/08/22 09:30:51+0200 [DBUG] project_command_builder.go:102 david_gereb/atlantis-test#3: Got workspace lock
2019/08/22 09:30:52+0200 [DBUG] project_command_builder.go:110 david_gereb/atlantis-test#3: 2 files were modified in this pull request
2019/08/22 09:30:52+0200 [DBUG] working_dir.go:79 david_gereb/atlantis-test#3: Clone directory "/Users/davidgereb/.atlantis/repos/david_gereb/atlantis-test/3/default" already exists, checking if it's at the right commit
2019/08/22 09:30:52+0200 [DBUG] working_dir.go:104 david_gereb/atlantis-test#3: Repo was already cloned but is not at correct commit, wanted "477f030fc370" got "e3cef4869e418153193d8df22b2d769d1c492158"
2019/08/22 09:30:52+0200 [INFO] working_dir.go:123 david_gereb/atlantis-test#3: Creating dir "/Users/davidgereb/.atlantis/repos/david_gereb/atlantis-test/3/default"
2019/08/22 09:30:54+0200 [DBUG] working_dir.go:189 david_gereb/atlantis-test#3: Ran: git clone --branch test3 --depth=1 --single-branch https://david_gereb:<redacted>@bitbucket.org/david_gereb/atlantis-test.git /Users/davidgereb/.atlantis/repos/david_gereb/atlantis-test/3/default. Output: Cloning into '/Users/davidgereb/.atlantis/repos/david_gereb/atlantis-test/3/default'...
2019/08/22 09:30:54+0200 [INFO] project_command_builder.go:145 david_gereb/atlantis-test#3: Found no atlantis.yaml file
2019/08/22 09:30:54+0200 [INFO] project_finder.go:54 david_gereb/atlantis-test#3: Filtered modified files to 1 .tf files: [terraform/main.tf]
2019/08/22 09:30:54+0200 [INFO] project_finder.go:75 david_gereb/atlantis-test#3: There are 1 modified project(s) at path(s): terraform
2019/08/22 09:30:54+0200 [INFO] project_command_builder.go:147 david_gereb/atlantis-test#3: Automatically determined that there were 1 projects modified in this pull request: [repofullname=david_gereb/atlantis-test path=terraform]
2019/08/22 09:30:54+0200 [DBUG] project_command_builder.go:149 david_gereb/atlantis-test#3: Determining config for project at dir: "terraform"
2019/08/22 09:30:54+0200 [DBUG] global_cfg.go:189 david_gereb/atlantis-test#3: Building config based on server-side config
2019/08/22 09:30:54+0200 [DBUG] global_cfg.go:319 david_gereb/atlantis-test#3: Setting apply_requirements: [] from default server config
2019/08/22 09:30:54+0200 [DBUG] global_cfg.go:319 david_gereb/atlantis-test#3: Setting workflow: "default" from default server config
2019/08/22 09:30:54+0200 [DBUG] global_cfg.go:319 david_gereb/atlantis-test#3: Setting allowed_overrides: [] from default server config
2019/08/22 09:30:54+0200 [DBUG] global_cfg.go:319 david_gereb/atlantis-test#3: Setting allow_custom_workflows: false from default server config
2019/08/22 09:30:54+0200 [INFO] project_locker.go:74 david_gereb/atlantis-test#3: Acquired lock with id "david_gereb/atlantis-test/terraform/default"
2019/08/22 09:30:54+0200 [DBUG] project_command_runner.go:136 david_gereb/atlantis-test#3: Acquired lock for project
2019/08/22 09:30:54+0200 [DBUG] working_dir.go:79 david_gereb/atlantis-test#3: Clone directory "/Users/davidgereb/.atlantis/repos/david_gereb/atlantis-test/3/default" already exists, checking if it's at the right commit
2019/08/22 09:30:54+0200 [DBUG] working_dir.go:101 david_gereb/atlantis-test#3: Repo is at correct commit "477f030fc370" so will not re-clone
2019/08/22 09:31:01+0200 [INFO] terraform_client.go:199 david_gereb/atlantis-test#3: Successfully ran "/usr/local/bin/terraform init -input=false -no-color -upgrade" in "/Users/davidgereb/.atlantis/repos/david_gereb/atlantis-test/3/default/terraform"
2019/08/22 09:31:01+0200 [INFO] terraform_client.go:199 david_gereb/atlantis-test#3: Successfully ran "/usr/local/bin/terraform workspace show" in "/Users/davidgereb/.atlantis/repos/david_gereb/atlantis-test/3/default/terraform"
2019/08/22 09:31:06+0200 [INFO] terraform_client.go:199 david_gereb/atlantis-test#3: Successfully ran "/usr/local/bin/terraform plan -input=false -refresh -no-color -out \"/Users/davidgereb/.atlantis/repos/david_gereb/atlantis-test/3/default/terraform/default.tfplan\"" in "/Users/davidgereb/.atlantis/repos/david_gereb/atlantis-test/3/default/terraform"
2019/08/22 09:31:06+0200 [DBUG] command_runner.go:432 david_gereb/atlantis-test#3: Updating DB with pull results
2019/08/22 09:31:07+0200 [INFO] middleware.go:38 server: POST /events – from 127.0.0.1:51673
2019/08/22 09:31:07+0200 [DBUG] events_controller.go:100 server: Handling Bitbucket Cloud post
2019/08/22 09:31:07+0200 [DBUG] events_controller.go:154 server: Handling as comment created event
2019/08/22 09:31:07+0200 [DBUG] events_controller.go:364 server: Ignoring non-command comment: "Ran Plan for dir: `terraform` workspace:..."
2019/08/22 09:31:07+0200 [INFO] middleware.go:42 server: POST /events – respond HTTP 200

@lkysow
Copy link
Member

lkysow commented Aug 22, 2019

2019/08/22 09:30:54+0200 [INFO] project_command_builder.go:145 david_gereb/atlantis-test#3: Found no atlantis.yaml file

Your atlantis.yaml is not being used. Is it at the root of the repo?

@davidgereb
Copy link
Author

Totally missed that, the issue was that I was using .yml instead of .yaml, my bad.
Just created a feature-request for that #755

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested waiting-on-response Waiting for a response from the user
Projects
None yet
Development

No branches or pull requests

2 participants