Skip to content

Error when only whitespace/yaml comments exist between separators in manifests #893

Description

@jlegrone

It looks like if two --- separators are grouped together in a yaml file provided to tilt, this causes a runtime error.

I'm seeing this on tilt built from master, version info: v0.0.0-dev, built 2018-12-22

This is a minimal configuration which should reproduce the issue:

# TiltFile
k8s_yaml(local("echo '---\n---'"))

tilt up output:

Error: Object 'Kind' is missing in '---
': Object 'Kind' is missing in '---
'

In my use case, I'd like to be able to use tilt along with existing helm charts. The helm template command seems like a nice way to integrate with tilt, but its output always includes a separator and yaml comment for each source template, regardless of whether the rendered contents of that template include a valid resource.

For example, rendering the stable/redis chart with metrics disabled results in this partial yaml:

---
# Source: redis/templates/metrics-deployment.yaml


---
# Source: redis/templates/metrics-prometheus.yaml

---
# Source: redis/templates/metrics-svc.yaml

With the helm cli installed, you can reproduce this with the following configuration:

# TiltFile
k8s_yaml(local("helm fetch stable/redis --version 5.1.3 --untar --untardir tmp && helm template tmp/redis --name test"))

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