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

[GOCA] template escaping problem #5914

Closed
3 tasks
treywelsh opened this issue Jul 11, 2022 · 0 comments · Fixed by #5932
Closed
3 tasks

[GOCA] template escaping problem #5914

treywelsh opened this issue Jul 11, 2022 · 0 comments · Fixed by #5932

Comments

@treywelsh
Copy link
Contributor

treywelsh commented Jul 11, 2022

Description

Since issue #5785 and related PR #5782 merged the terraform provider doesn't handle anymore multiline strings (I made an update on the goca dependencies to point to one 6.4).
Before this PR, goca only escaped double quotes.

See the related provider issue.
At first this change seems positive to me: before #5782 we had some complex escaping issues like in this provider issue, however it seems that we don't want to escape all characters.

Escaping is done in String() method on dynamic template.

To Reproduce
It should be easy to reproduce with a goca example:

package main

import (
	"fmt"
	"github.com/OpenNebula/one/src/oca/go/src/goca/schemas/vm"
)

func main() {
	tpl := vm.NewTemplate()
	tpl.Add("KEY", `line1
	line2`)

	fmt.Println(tpl.String())
}

Will print with goca 6.4:

KEY="line1\n\tline2"

Expected behavior

Not sure on how should we handle this. Should we rewrite a more specific quote method to not handle '\n' ?

Details

  • Affected Component: goca
  • Hypervisor: [e.g. KVM]
  • Version: from 6.4 ONE releases

Progress Status

  • Code committed
  • Testing - QA
  • Documentation (Release notes - resolved issues, compatibility, known issues)
treywelsh added a commit to treywelsh/one that referenced this issue Jul 26, 2022
treywelsh added a commit to treywelsh/one that referenced this issue Jul 26, 2022
Signed-off-by: Pierre Lafievre <pierre.lafievre@iguanesolutions.com>
treywelsh added a commit to treywelsh/one that referenced this issue Jul 26, 2022
Signed-off-by: Pierre Lafievre <pierre.lafievre@iguanesolutions.com>
treywelsh added a commit to treywelsh/one that referenced this issue Jul 26, 2022
Signed-off-by: Pierre Lafievre <pierre.lafievre@iguanesolutions.com>
rsmontero pushed a commit that referenced this issue Jul 27, 2022
Signed-off-by: Pierre Lafievre <pierre.lafievre@iguanesolutions.com>
(cherry picked from commit 75f2411)
treywelsh added a commit to treywelsh/one that referenced this issue Aug 9, 2022
treywelsh added a commit to treywelsh/one that referenced this issue Aug 9, 2022
treywelsh added a commit to treywelsh/one that referenced this issue Aug 9, 2022
Signed-off-by: Pierre Lafievre <pierre.lafievre@iguanesolutions.com>
rsmontero pushed a commit that referenced this issue Aug 9, 2022
Signed-off-by: Pierre Lafievre <pierre.lafievre@iguanesolutions.com>
(cherry picked from commit df3f44d)
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

Successfully merging a pull request may close this issue.

1 participant