quarkiverse / quarkus-helm

Quarkus Extension to generate the Helm artifacts
Apache License 2.0
10 stars 8 forks source link

Quotes in src/main/helm/values.yaml get arbitrarily dropped in target/heml/openshift/*/values.yaml #315

Closed yrodiere closed 6 months ago

yrodiere commented 6 months ago

If I have this in src/main/helm/values.yaml:

opensearch:
  limits:
    cpu: 2000m
    memory: 3Gi
  requests:
    cpu: 1000m
    memory: 2Gi
  java-opts: "-Xms1g -Xmx1g"

Then the resulting file at target/heml/openshift/*/values.yaml doesn't have quotes around the java options (see last line), and is therefore invalid:

---
app:
  [...]
opensearch:
  limits:
    cpu: 2000m
    memory: 3Gi
  requests:
    cpu: 1000m
    memory: 2Gi
  java-opts: -Xms1g -Xmx1g

Workaround: insert a space before the -:

opensearch:
  limits:
    cpu: 2000m
    memory: 3Gi
  requests:
    cpu: 1000m
    memory: 2Gi
  java-opts: " -Xms1g -Xmx1g"

Then the file will be syntactically correct, at least:

---
app:
  [...]
opensearch:
  limits:
    cpu: 2000m
    memory: 3Gi
  requests:
    cpu: 1000m
    memory: 2Gi
  java-opts: ' -Xms1g -Xmx1g'
Sgitario commented 6 months ago

I'm not sure if there is something we can do to improve this (since we delegate this on the jackson serializer), but will take into a look into this next Tuesday. Thanks for reporting!

Sgitario commented 6 months ago

@yrodiere this was indeed caused by the way we use the jackson serializers, but I could implement a logic to preserve the double quotes when using spaces. https://github.com/quarkiverse/quarkus-helm/pull/317

yrodiere commented 6 months ago

Thanks!