Skip to content

updating a template via CLI that has tags set through template editor strips all provisioner tags #13131

Closed
@matifali

Description

@matifali

I have a template where I added a provisioner tag in the template editor docker=true,
When I tried to update the same template from CLI using coder template push <TEMPLATE-NAME>, I get

oder templates push windows-in-docker
> Upload "."? (yes/no) yes
==> ⧗ Queued (next)
=== ✔ Queued [12623ms]
==> ⧗ Running
=== ✔ Running [10ms]
==> ⧗ Setting up
=== ✔ Setting up [1ms]
==> ⧗ Parsing template parameters
=== ✔ Parsing template parameters [9ms]
==> ⧗ Detecting persistent resources
2024-05-02 18:22:11.940+03:00 Terraform 1.6.6
2024-05-02 18:22:12.766+03:00 data.coder_workspace.me: Refreshing...
2024-05-02 18:22:12.768+03:00 data.coder_workspace.me: Refresh complete after 0s [id=125a5f67-68b8-40b1-aca6-34fa6af658a3]
2024-05-02 18:22:12.787+03:00 coder_agent.dev: Plan to create
2024-05-02 18:22:12.787+03:00 local_file.coder_agent_token: Plan to create
2024-05-02 18:22:12.787+03:00 Plan: 2 to add, 0 to change, 0 to destroy.
2024-05-02 18:22:12.789+03:00 Error: Error pinging Docker server: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/_ping": dial unix /var/run/docker.sock: connect: permission denied
2024-05-02 18:22:12.789+03:00 on main.tf line 12, in provider "docker":
2024-05-02 18:22:12.789+03:00   12: provider "docker" {}
2024-05-02 18:22:12.789+03:00 
2024-05-02 18:22:12.789+03:00 
=== ✔ Detecting persistent resources [1640ms]
==> ⧗ Cleaning Up
=== ✘ Cleaning Up [13ms]
=== ✘ Cleaning Up [228ms]
Encountered an error running "coder templates push", see "coder templates push --help" for more information
error: template import provision for start: terraform plan: exit status 1

When checked from the template editor, I observed that tags are no longer there
image

Adding the tag again from the template editor or via CLI resolves the issue.
coder templates push --provisioner-tag docker=true <TEMPLATE-NAME>

Metadata

Metadata

Assignees

Labels

cliArea: CLIs2Broken use cases or features (with a workaround). Only humans may set this.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions