Skip to content

generate wrong format ymal when multiple key/value pairs #18

@jenningsloy318

Description

@jenningsloy318

Hi All,

just made a test with the lastest ktml.

example.yaml

---
kind: "Template"
apiVersion: "v1"
metadata:
  name: "mongodb-ephemeral"
  annotations:
    description: "Provides a MongoDB database service"
labels:
  template: "mongodb-ephemeral-template"
objects:
  - kind: "Service"
    apiVersion: "v1"
    metadata:
      name: "$(DATABASE_SERVICE_NAME)"
    spec:
      ports:
        - name: "mongo"
          protocol: "TCP"
          targetPort: 27017
      selector:
        name: "$(DATABASE_SERVICE_NAME)"
parameters:
  - name: "DATABASE_SERVICE_NAME"
    description: "Database service name"
    value: "mongodb"
    required: true
    parameterType: "string"

parameter.yaml

---
DATABASE_SERVICE_NAME: "mongoabc"

will result

---
apiVersion: v1
kind: Service
metadata:
  name: mongoabc
spec:
  ports:
    -
      name: mongo
      protocol: TCP
      targetPort: 27017
  selector:
    name: mongoabc

seems the ports section has some format issue, and I also test the similar ways, found that if we have multiple value start with "-", we will get same format issue. ktml will process the content after "-" as a new line start.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions