kubernetes/kubernetes
GitHub で見るAudit all APIs for selector fields, ensure documented semantics when nil or empty.
Open
#25,836 opened on 2016年5月18日
help wantedlifecycle/frozenpriority/backlogsig/architecture
説明
Service.spec.selector comments say "If empty, all pods are selected, if not specified, endpoints must be manually specified".
As far as I can tell this is not implemented, though. While Go understands the different between a nil slice and a non-nil slice with no elements, JSON does not. With an omitempty field, we get the field dropped in either case.
To actually achieve this semantic, we need the type to be a pointer, so omitempty applies to a nil pointer but not an empty map. But at least protobuf codegen does not support this, either. I think the right fix is to change the documentation.
@bgrant0607 @smarterclayton