Closed lcordero closed 4 years ago
@lcordero Primary investigation leads me to believe that this is related to latest changes we made in how templates were created. It's a side-effect of adding "
to the templated names. Nested JSON objects seem to be not parsed correctly by Ansible. Will update here as I learn more.
Related to https://github.com/konveyor/pvc-migrate/pull/126 and https://github.com/konveyor/pvc-migrate/issues/125
== Error 1 ==
Description: Error creating NS on destination cluster. As the object _namespacedata is treated as JSON, at the time you are passing item.annotations on the loop, it'll fail because the template format is YAML and not JSON.
Error:
Possible solution: Change the format of the template _2_pvc_destinationgen/templates/namespace.yml.j2 to json; like this:
file: _2_pvc_destinationgen/templates/namespace.json.j2
== Error 2 ==
Description: Error creating PVC on destination cluster. As the object _ mig_dest_adjusted_pvcdata is treated as JSON, at the time you are passing _item.accessmodes (json Array) on the loop, it'll fail because the template format is YAML and not JSON.
Error:
Possible solution: Change the format of the template _2_pvc_destinationgen/templates/pvc.yml.j2 to json; like this:
file: _2_pvc_destinationgen/templates/pvc.json.j2
I have tested both solutions and now the playbook is working, at least the tests I performed.