Skip to content

Missing quote on annotation when containing multiple consecutive curly brackets #433

@foxlegend

Description

@foxlegend

Hello,

I have a service override (common.yml in src/main/bubernetes) in my Quarkus project to define some backend config for GKE such as:

apiVersion: v1
kind: Service
metadata:
  annotations:
    cloud.google.com/backend-config: '{"port":{"someport":"mybackendconfig"}}'
  name: myapp

When rendered by the quarkus-helm extension, there is a missing quote resulting in a malformed yaml file:

---
apiVersion: v1
kind: Service
metadata:
  annotations:
    cloud.google.com/backend-config: "{\"port\":{\"someport\":\"mybackendconfig\"\
      }}
    app.quarkus.io/quarkus-version: 3.20.0
    app.quarkus.io/vcs-uri: https://some.vcs.uri
  labels:
    app.kubernetes.io/managed-by: quarkus
    app.kubernetes.io/name: myapp
  name: myapp

In kubernetes.json and kubernetes.yml, they are correctly rendered:

{
  "apiVersion" : "v1",
  "kind" : "Service",
  "metadata" : {
    "annotations" : {
      "cloud.google.com/backend-config" : "{\"port\":{\"someport\":\"mybackendconfig\"}}"
    }
}
apiVersion: v1
kind: Service
metadata:
  annotations:
    cloud.google.com/backend-config: "{\"port\":{\"someport\":\"mybackendconfig\"\
      }}"

The problem seems to occur if and only if there are several levels of curly brackets. If there is a single level of curly bracket, I do not have this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions