We are now able to identify the instance group associated with a pod.
Add an extra layer to the validatePodFailure to the test where we
create a mock InstanceGroup and associate the pod failures with the
instance group to which the pod belongs to.
In the ValidationError struct, there is a field to identify the instance group to
which the ValidationError is associated with.
For pod related ValidationErrors, it is not straightforward to identify the
instance group to which the pod is associated with.
To acheive this, we create a node to instance group mapping in ValidateNodes.
This node to instance group mapping is used in collectPodFailures to identify the
pod instance group by using the pod's hostIp field.
We don't associate system-cluster-critical pods to instance groups as those pod
failures are cluster wide
The InstanceGroup field in ValidationError struct is an optional field meant
to indicate the InstanceGroup which has reported that failure. This field either
holds a pointer to the instance group which caused the validation error or can be
nil which indicates that we were unable to determine the instance group to which
this failure should be attributed to.
This field is mainly used to identify whether a failure is worth waiting for
when validating a particular instance group.
The client-go signature for most methods adds a context.Context
object, and also makes Options mandatory. Feed through a
context.Context through many of our methods (but use context.TODO to
stop it getting totally out of hand!)
We don't call klog.InitFlags yet, because that will cause a flag
redefinition error until we get everyone to stop using glog. That
will happen when we update to k8s 1.13.
URL's Host field is "host" or "host:port". (see https://golang.org/pkg/net/url/#URL )
"host:port" can't be used as net.LookupHost's parameter.
I recommend using URL.Hostname() instead of URL.Host.
line 74: "GetReadySchedulableNodesOrDie" should be replaced with “GetReadySchedulableNodes”.
"GetReadySchedulableNodesOrDie" is not defined in this file.