Use a strong type for UID fields

This commit is contained in:
Tim Hockin
2015-01-14 13:53:43 -08:00
parent 4e539001df
commit e86d4cd3c6
31 changed files with 182 additions and 170 deletions

View File

@@ -32,8 +32,8 @@ type execActionHandler struct {
kubelet *Kubelet
}
func (e *execActionHandler) Run(podFullName, uuid string, container *api.Container, handler *api.Handler) error {
_, err := e.kubelet.RunInContainer(podFullName, uuid, container.Name, handler.Exec.Command)
func (e *execActionHandler) Run(podFullName string, uid util.UID, container *api.Container, handler *api.Handler) error {
_, err := e.kubelet.RunInContainer(podFullName, uid, container.Name, handler.Exec.Command)
return err
}
@@ -67,11 +67,11 @@ func ResolvePort(portReference util.IntOrString, container *api.Container) (int,
return -1, fmt.Errorf("couldn't find port: %v in %v", portReference, container)
}
func (h *httpActionHandler) Run(podFullName, uuid string, container *api.Container, handler *api.Handler) error {
func (h *httpActionHandler) Run(podFullName string, uid util.UID, container *api.Container, handler *api.Handler) error {
host := handler.HTTPGet.Host
if len(host) == 0 {
var info api.PodInfo
info, err := h.kubelet.GetPodInfo(podFullName, uuid)
info, err := h.kubelet.GetPodInfo(podFullName, uid)
if err != nil {
glog.Errorf("unable to get pod info, event handlers may be invalid.")
return err