New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Service without labels returns null, not {} #24631
Comments
/cc @tiborvass |
Agreeing on the inconsistency, I'll take a look. |
@vdemeester Thanks! I didn't check other properties (env-vars, etc), so those may need a change as well. Also didn't compare the API between "containers" and "services" |
ping @vdemeester just found this one, did we ever change this? |
#dibs A few other types also behave the same way, e.g.: $ docker node inspect --format '{{ json .Spec.Labels}}' self |
…s is empty object {} Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
…turns-empty-map Inspect output on service without labels is an empty map instead of null, fixes #24631
if no labels are set on a service,
Spec.Labels
isnull
, not an empty map/object;$ docker service create --name nolabels nginx:alpine $ docker service inspect --format '{{ json .Spec.Labels}}' nolabels null
This is inconsistent with containers, where it's always a map/object;
$ docker run --name nolabels busybox sh $ docker inspect --format '{{json .Config.Labels }}' nolabels {}
I think we should fix that, to keep consistency in our UX.
The text was updated successfully, but these errors were encountered: