pulumi / kube2pulumi

Upgrade your Kubernetes YAML to a modern language
https://www.pulumi.com/kube2pulumi/
Apache License 2.0
105 stars 6 forks source link

Parse error: Missing item separator #79

Closed suhabe closed 1 year ago

suhabe commented 2 years ago

Hello!

Issue details

I'm getting the following parse error when using kube2pulumi:

> kube2pulumi go --file src/filebeat_autodiscover_2.1.yaml -o filebeats.go                                                                                                

Error: Error: Missing item separator

  on pcl-965641736.pp line 39:
  36: processors = [
  37: {
  38: add_cloud_metadata = null
  39: }
  40: {

Expected a comma to mark the beginning of the next item.

The yaml file is this one: https://raw.githubusercontent.com/elastic/cloud-on-k8s/2.1/config/recipes/beats/filebeat_autodiscover.yaml

Steps to reproduce

  1. Execute the command: brew install pulumi/tap/kube2pulumi
  2. Download the yaml file at https://raw.githubusercontent.com/elastic/cloud-on-k8s/2.1/config/recipes/beats/filebeat_autodiscover.yaml
  3. Execute the command: kube2pulumi go --file src/filebeat_autodiscover_2.1.yaml -o filebeats.go

Expected: kube2pulumi successfully converts the yaml file to golang Actual: It fails and gives a parse error.

amalic commented 2 years ago

I am having a similar issue

  1. First I installed pulumi's kubernetes plugin via pulumi plugin install resource kubernetes and kube2pulumi via brew install pulumi/tap/kube2pulumi
  2. Next I converted our helm-chart into kubernetes yaml file via helm dep up && mkdir -p pulumi && helm template -f values-dev.yaml . > ./pulumi/k8s.yaml && cd pulumi
  3. When trying to convert our k8s deployment to a Pulumi skript via kube2pulumi go -f k8s.yaml I am getting following error (getting the same error when trying to generate Python or Typescript)

    
    > kube2pulumi go -f k8s.yaml 
    Error: Error: Invalid character
    
    on pcl-872512158.pp line 6170:
    6171:           /run.sh ${ARGS[@]}

This character is not used within the language.

Error: Invalid character

on pcl-872512158.pp line 6388: 6389: /run.sh "${ARGS[@]}"

This character is not used within the language.

Error: Invalid character

on pcl-872512158.pp line 6603: 6604: /run.sh ${ARGS[@]}

This character is not used within the language.

Error: Invalid character

on pcl-872512158.pp line 6821: 6822: /run.sh "${ARGS[@]}"

This character is not used within the language.

Error: Invalid character

on pcl-872512158.pp line 7036: 7037: /run.sh ${ARGS[@]}

This character is not used within the language.

Error: Invalid character

on pcl-872512158.pp line 7254: 7255: /run.sh "${ARGS[@]}"

This character is not used within the language.

Error: Invalid character

on pcl-872512158.pp line 7938: 7939: /run.sh ${ARGS[@]}

This character is not used within the language.

Error: Invalid character

on pcl-872512158.pp line 8156: 8157: /run.sh "${ARGS[@]}"

This character is not used within the language.

Error: Invalid character

on pcl-872512158.pp line 8380: 8381: /run.sh ${ARGS[@]}

This character is not used within the language.

Error: Invalid character

on pcl-872512158.pp line 8598: 8599: /run.sh "${ARGS[@]}"

This character is not used within the language.

Error: Missing item separator

on pcl-872512158.pp line 3860: 3855: envFrom = [ 3856: { 3857: configMapRef = { 3858: name = "release-something-importer" 3859: }, 3860: } 3861: {

Expected a comma to mark the beginning of the next item.

Usage: kube2pulumi go [flags]

Flags: -h, --help help for go

Global Flags: -d, --directory string file path for directory to convert -f, --file string YAML file to convert -o, --outputFile string The name of the output file to write to

unable to run program: Error: Invalid character

on pcl-872512158.pp line 6170: 6171: /run.sh ${ARGS[@]}

This character is not used within the language.

Error: Invalid character

on pcl-872512158.pp line 6388: 6389: /run.sh "${ARGS[@]}"

This character is not used within the language.

Error: Invalid character

on pcl-872512158.pp line 6603: 6604: /run.sh ${ARGS[@]}

This character is not used within the language.

Error: Invalid character

on pcl-872512158.pp line 6821: 6822: /run.sh "${ARGS[@]}"

This character is not used within the language.

Error: Invalid character

on pcl-872512158.pp line 7036: 7037: /run.sh ${ARGS[@]}

This character is not used within the language.

Error: Invalid character

on pcl-872512158.pp line 7254: 7255: /run.sh "${ARGS[@]}"

This character is not used within the language.

Error: Invalid character

on pcl-872512158.pp line 7938: 7939: /run.sh ${ARGS[@]}

This character is not used within the language.

Error: Invalid character

on pcl-872512158.pp line 8156: 8157: /run.sh "${ARGS[@]}"

This character is not used within the language.

Error: Invalid character

on pcl-872512158.pp line 8380: 8381: /run.sh ${ARGS[@]}

This character is not used within the language.

Error: Invalid character

on pcl-872512158.pp line 8598: 8599: /run.sh "${ARGS[@]}"

This character is not used within the language.

Error: Missing item separator

on pcl-872512158.pp line 3860: 3855: envFrom = [ 3856: { 3857: configMapRef = { 3858: name = "release-something-importer" 3859: }, 3860: } 3861: {

Expected a comma to mark the beginning of the next item.

mefuller commented 2 years ago

I am experiencing the same issue on Ubuntu 18.04 with kube2pulumi v0.0.11:

The relevant subsection of the current YAML is:

          envFrom:
            - secretRef:
                name: postgres-secrets
            - secretRef:
                name: backstage-secrets

And the attempt to convert the file is:

$ kube2pulumi go -f backstage.yaml
Error: Error: Missing item separator

  on pcl-758039703.pp line 52:
  47: envFrom = [
  48: {
  49: secretRef = {
  50: name = "postgres-secrets"
  51: },
  52: }
  53: {

Expected a comma to mark the beginning of the next item.