Skip to content

Strip leading and trailing whitespace from template CLI parameters #2829

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

Closed
ketang opened this issue Jul 4, 2022 · 0 comments
Closed

Strip leading and trailing whitespace from template CLI parameters #2829

ketang opened this issue Jul 4, 2022 · 0 comments

Comments

@ketang
Copy link
Contributor

ketang commented Jul 4, 2022

This did not work (note the leading space before tcp):

$ coder  templates create
> Create and upload "~/project/kode-templates/docker-amd64b"? (yes/no) yes
...
var.docker_host
  Specify location of Docker socket (check `docker context ls` if you're not sure)

> Enter a value:  tcp://localhost:2375
...              ^ extraneous space
  Error: Error initializing Docker client: parse " tcp://localhost:2375": first path segment in URL cannot contain colon

This did:

$ coder templates create
> Create and upload "~/project/kode-templates/docker-amd64b"? (yes/no) yes
...
var.docker_host
  Specify location of Docker socket (check `docker context ls` if you're not sure)

> Enter a value: tcp://localhost:2375
...
[success]

We should strip leading and trailing whitespace from all parameters, especially since any errors caused by this could be pretty cryptic.

@ketang ketang changed the title Strip leading and trailing whitespace from CLI parameters Strip leading and trailing whitespace from template CLI parameters Jul 4, 2022
@ketang ketang closed this as completed Jul 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant