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

[v0.5.1] Regression with multi-line context entries #309

Closed
danimo opened this issue Jul 6, 2022 · 2 comments · Fixed by #321
Closed

[v0.5.1] Regression with multi-line context entries #309

danimo opened this issue Jul 6, 2022 · 2 comments · Fixed by #321

Comments

@danimo
Copy link

danimo commented Jul 6, 2022

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

1.2.2

Affected Resource(s)

  • opennebula_virtual_machine

Expected Behavior

A resource with the definition:

....
  context = {
    SSH_PUBLIC_KEY = <<-EOF
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPAdpks3NLPqv3hrZAZ5wJwXlgGcTbmG+BCG4fxxw5 foo
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINwq3MeJKlP9biT4XyqSkAzeq3Ri3kmincCMefxfJz bar
EOF
  }

creates a context variable like so:

....
SSH_PUBLIC_KEY = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPAdpks3NLPqv3hrZAZ5wJwXlgGcTbmG+BCG4fxxw5 foo
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINwq3MeJKlP9biT4XyqSkAzeq3Ri3kmincCMefxfJz bar"
....

leading to a .ssh/authorized_keys file that contains one key per line.

Actual Behavior

creates a context variable like so:

....
SSH_PUBLIC_KEY = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPAdpks3NLPqv3hrZAZ5wJwXlgGcTbmG+BCG4fxxw5 foo\nssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINwq3MeJKlP9biT4XyqSkAzeq3Ri3kmincCMefxfJz bar"
....

leading to a .ssh/authorized_keys file that has all keys concatenated in a single line.

Steps to Reproduce

  1. Upgrade from version 0.5.0 to 0.5.1

  2. terraform apply (might need changes to the keys)

References

It is reasonable to assume that the Switch to SDKv2 (#161) has introduced this regression, though we haven't done any bisecting yet.

@treywelsh
Copy link
Collaborator

treywelsh commented Jul 8, 2022

This is due to PR #270, in which we updated the goca dependency to retrieve 6.4 OpenNebula changes.

Among other changes, the OpenNebula issue that modified the goca behavior regarding character escaping is OpenNebula/one#5785

The change is in String() dynamic template method which escape now much more characters

@treywelsh
Copy link
Collaborator

Issue opened to the one repository: OpenNebula/one#5914

@frousselet frousselet removed a link to a pull request Jul 31, 2022
7 tasks
@frousselet frousselet linked a pull request Jul 31, 2022 that will close this issue
7 tasks
treywelsh added a commit that referenced this issue Aug 3, 2022
treywelsh added a commit that referenced this issue Aug 3, 2022
frousselet pushed a commit that referenced this issue Aug 3, 2022
frousselet pushed a commit that referenced this issue Aug 3, 2022
treywelsh added a commit that referenced this issue Aug 9, 2022
frousselet pushed a commit that referenced this issue Aug 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment