Instead of endpoints being a flat list, it is now a list of "subsets"
where each is a struct of {Addresses, Ports}. To generate the list of
endpoints you need to take union of the Cartesian products of the
subsets. This is compact in the vast majority of cases, yet still
represents named ports and corner cases (e.g. each pod has a different
port number).
This also stores subsets in a deterministic order (sorted by hash) to
avoid spurious updates and comparison problems.
This is a fully compatible change - old objects and clients will
keepworking as long as they don't need the new functionality.
This is the prep for multi-port Services, which will add API to produce
endpoints in this new structure.
In v1b1 and v1b2 we choose the "first defined port" if you do not specify a
ContainerPort. I am proposing that v1b3 just assume the ContainerPort is the
same as the service port unless explicitly provided. This leaves named ports
for now, but that is under discussion on its own.
This is strictly compatible, though to implement this we have to leave the
internal objects with the looser behavior until v1b[12] die. This also adds a
link dependency so that when we DO kill v1b[12] the endpoints controller will
blow up, prompting a fix.
Revise our code to only call Request.Namespace() if a namespace
*should* be present. For root scoped resources, namespace should
be ignored. For namespaced resources, it is an error to have
Namespace=="".
People were misusing EncodeJSON in tests when they should be using
runtime.EncodeOrDie(testapi.Codec(), obj). Removing the potential
for cutting self on sharp objects.
Allows us to define different watch versioning regimes in the future
as well as to encode information with the resource version.
This changes /watch/resources?resourceVersion=3 to start the watch at
4 instead of 3, which means clients can read a resource version and
then send it back to the server. Clients should no longer do math on
resource versions.