Skip to content

YAML that starts with comment instead of -- throws error.  #46

@bnferguson

Description

@bnferguson

When you have a current.yaml that starts with a comment instead of -- you get:

Failure parsing YAML file replicated/current.yaml:
TypeError: Cannot read property 'components' of null

So this is a problem:

# -*- tab-width: 2 -*-
---
replicated_api_version: 2.9.2

but when I change it to:

---
replicated_api_version: 2.9.2

All is well.

If you do this in the releases/ dir in a release YAML you see a stack trace as such:

[getAppUpgrades:1bd2101f] !! 500 TypeError: Cannot read property 'components' of null
    at fillOutDoc (/usr/local/lib/node_modules/replicated-studio/src/replicated/release.ts:68:11)
    at _.map (/usr/local/lib/node_modules/replicated-studio/src/replicated/release.ts:118:34)
    at arrayMap (/usr/local/lib/node_modules/replicated-studio/node_modules/lodash/lodash.js:639:23)
    at Function.map (/usr/local/lib/node_modules/replicated-studio/node_modules/lodash/lodash.js:9554:14)
    at fillOutYamlString (/usr/local/lib/node_modules/replicated-studio/src/replicated/release.ts:110:12)
    at Object.fillOutYaml (/usr/local/lib/node_modules/replicated-studio/src/replicated/release.ts:96:10)
    at _.forEach (/usr/local/lib/node_modules/replicated-studio/src/handlers/getAppUpgrades.ts:34:35)
    at arrayEach (/usr/local/lib/node_modules/replicated-studio/node_modules/lodash/lodash.js:516:11)
    at Function.forEach (/usr/local/lib/node_modules/replicated-studio/node_modules/lodash/lodash.js:9342:14)
    at /usr/local/lib/node_modules/replicated-studio/src/handlers/getAppUpgrades.ts:31:5

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions