Fix render of PATCH_CONTENT in full_json_patch krm function 52/15252/2
authormesaj <juanmanuel.mesamendez.ext@telefonica.com>
Tue, 24 Jun 2025 11:24:56 +0000 (13:24 +0200)
committergarciadeblas <gerardo.garciadeblas@telefonica.com>
Fri, 4 Jul 2025 11:55:54 +0000 (13:55 +0200)
commitcdad086b5e063ae6e5a3882b90d85c39710c3077
treed9877972ea1105f6ea762ec2c5523421b12ff9bd
parenta13680c07d0474f8563f17c966a84d698d5fddf7
Fix render of PATCH_CONTENT in full_json_patch krm function

This will fix Helm inline values patch rendering

When using inline values such as:

```
inline_values:
  service:
    ports:
      http: "8080"
      https: "8443"
```

The current `full_json_patch()` function was failing with error: `Error:
bad expression, please check expression syntax`. This is because yq
seems like doesn't properly handle literal new-lines inside a
double-quoted string.

This change replace current implementation to a safer approach using
HEREDOCS template to render the patch.

Change-Id: If7e78a6509ca0e6731f3125eeb535cedf394b06b
Signed-off-by: mesaj <juanmanuel.mesamendez.ext@telefonica.com>
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
docker/osm-krm-functions/scripts/library/helper-functions.rc