Skip to content
This repository has been archived by the owner on Jul 6, 2022. It is now read-only.

Volumes with null entries produce unclear error #47

Open
hedss opened this issue Jan 18, 2019 · 1 comment
Open

Volumes with null entries produce unclear error #47

hedss opened this issue Jan 18, 2019 · 1 comment

Comments

@hedss
Copy link
Contributor

hedss commented Jan 18, 2019

The following:

volumes:
    myvolume: null

Produces the error:

ValidationError: data/volumes/db-data should be object,null

This is unclear, as it suggests that the volume may be an object or a null value due to the comma, when in fact it is saying it may only be an object, followed by a comma and then what it has been set to.

@MBerka
Copy link

MBerka commented May 18, 2020

I thought so too, but it is actually saying exactly what hedss thought. It can be an object or null. The real confusion is that the text "null" does not get interpreted as a null value here, regardless of what my yml linter says. Here are some volumes,

volumes:
    db-data:
    mosq-conf: {}
    mosq-gen: null

and the resulting error is: data/volumes/mosq-gen should be object,null, meaning, that the blank line was interpreted as null, the braces as an object, and the "null" probably as a string (strict type checking!). The top way that this could be improved would be to add the type that failed to match the list.
"should be object,null, is a string". Not sure that the code that prints this message is in this repo though.

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

No branches or pull requests

2 participants