Drone CLI is outputting raw data when using `drone jsonnet`

Whenever I run drone jsonnet, it’s showing JSON data instead of the generated YAML file for some reason.

Jsonnet file:

Generated file:

I’m on 1.3.0 on the Linux release.

Hi,
I had the same problem. From version 1.3+ the default output was changed for JSON. To output as YAML you need to set flag --format=true.

Keep in mind, that for some use-cases, drone jsonnet is ignoring some kubernetes definitions like node_selector or resources section. This is due to drone jsonnet is not designed for kubernetes runner but docker runner.
I hope this funtionality will be added some time soon but I’m afraid it won’t.

1 Like

The generated file in your example is in fact valid yaml … yaml is a superset of json which means a yaml document may be formatted in a manner that looks just like a json document :slight_smile:

@mknapcok’s answer explained it.

As of my knowledge, it just behaved differently in previous releases, thus causing my confusion.

I’ll check everything out later.

1 Like