Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jenningsloy318 opened this issue Jul 14, 2017 · 2 comments
Open

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

jenningsloy318 opened this issue Jul 14, 2017 · 2 comments
Labels

Comments

@jenningsloy318
Copy link

jenningsloy318 commented Jul 14, 2017

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.

@jimmycuadra
Copy link
Contributor

I've noticed this too. It's a problem with the YAML parser ktmpl uses, and should be reported upstream. I'm happy to leave this issue open to at least remind us to update our yaml-rust dependency when the bug is fixed.

@jimmycuadra
Copy link
Contributor

This is fixed in the latest release: https://github.com/jimmycuadra/ktmpl/releases/tag/0.8.0

I don't have access to this repo anymore, so please close the issue if it's solved for you. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants