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

Alias quoted string handling not working as expected #1239

Open
accuser opened this issue Sep 23, 2024 · 0 comments
Open

Alias quoted string handling not working as expected #1239

accuser opened this issue Sep 23, 2024 · 0 comments
Labels
Bug Confirmed to be a bug Easy Good for new contributors
Milestone

Comments

@accuser
Copy link

accuser commented Sep 23, 2024

Required information

  • Distribution: Ubuntu Server
  • Distribution version: 24.04.1
  • The output of "incus info" or if that fails:
    • Kernel version: 6.8.0-45-generic
    • Incus version: 6.0.0
    • Storage backend in use: ZFS

Issue description

I wanted to add an incus alias to automatically update and upgrade packages in instances, but the alias failed when I tried to use it due to an unterminated quoted string.

  • sh -c 'apt update && apt upgrade' in the instance works as expected.
  • incus exec test -- sh -c 'apt update && apt upgrade' in the host works as expected.
  • incus alias add up "exec @ARGS@ -- sh -c 'apt update && apt upgrade'" in the host works as expected.
  • incus up test-instance does not work: unterminated quoted string (see steps to reproduce).

I can work around this by adding individual aliases for apt update and apt upgrade, but it would be nice to be able to do this with a single alias.

Steps to reproduce

$ incus launch images:ubuntu/24.04 test-instance  --storage default
$ incus alias add up "exec @ARGS@ -- sh -c 'apt update && apt upgrade'"
$ incus alias list
+------------+--------------------------------------------------+
|   ALIAS    |                      TARGET                      |
+------------+--------------------------------------------------+
| up         | exec @ARGS@ -- sh -c 'apt update && apt upgrade' |
+------------+--------------------------------------------------+
$ incus up test-instance
update: 1: Syntax error: Unterminated quoted string
@stgraber stgraber added Bug Confirmed to be a bug Easy Good for new contributors labels Sep 23, 2024
@stgraber stgraber added this to the incus-6.6 milestone Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Confirmed to be a bug Easy Good for new contributors
Development

No branches or pull requests

2 participants