The API server will refuse to start if a link-local IP address is selected, however, ChooseNetworkInterface can still select link-local network routes. This causes a startup failure on platforms like DigitalOcean that use a link-local route to fetch metadata.
Signed-off-by: Christian Stewart <christian@paral.in>
It would be better if Kubernetes could be instrumented to report panics
and handled but unreturned errors in controller loops to a remote
service. This commit introduces settable handlers for HandleCrash and a new
HandleError that can be overriden to report errors to a remote service
for analysis. HandleError() in particular is for control loops that do
not return an error, and so there is no ability to report those errors
other than in log files.
ReplicationController is provided as an example.
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.
Also rename some to other names that make better reading. There are still a
bunch of "make" functions but they do things like assemble a string from parts
or build an array of things. It seemed that "make" there seemed fine. "New"
is for "constructors".
Because time.Time doesn't work correctly with our YAML package, it is necessary
to introduce a type, util.Time, which serializes correctly to JSON and YAML.
Eventually we would like timestamping to cut across storage implementations;
for now, we set it in each storage.
Specifying an API type as IntOrString will allow JSON and YAML to accept
either ints or strings with the same name. For example, port names or
numbers.