Separate Direct and Indirect streaming paths, implement indirect path with CRI

This commit is contained in:
Tim St. Clair
2016-11-02 17:42:00 -07:00
parent c83a924628
commit 86d849e374
28 changed files with 723 additions and 436 deletions

View File

@@ -22,16 +22,23 @@ import (
"time"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/types"
)
type podHandler func(*api.Pod) string
// Pod returns a string reprenetating a pod in a human readable format,
// Pod returns a string representing a pod in a consistent human readable format,
// with pod UID as part of the string.
func Pod(pod *api.Pod) string {
return PodDesc(pod.Name, pod.Namespace, pod.UID)
}
// PodDesc returns a string representing a pod in a consistent human readable format,
// with pod UID as part of the string.
func PodDesc(podName, podNamespace string, podUID types.UID) string {
// Use underscore as the delimiter because it is not allowed in pod name
// (DNS subdomain format), while allowed in the container name format.
return fmt.Sprintf("%s_%s(%s)", pod.Name, pod.Namespace, pod.UID)
return fmt.Sprintf("%s_%s(%s)", podName, podNamespace, podUID)
}
// PodWithDeletionTimestamp is the same as Pod. In addition, it prints the