Documentation
¶
Overview ¶
Package util holds utility functions.
Index ¶
- func CreateListener(endpoint string) (net.Listener, error)
- func FromApiserverCache(opts *metav1.GetOptions)
- func GetAddressAndDialer(endpoint string) (string, func(ctx context.Context, addr string) (net.Conn, error), error)
- func GetBootTime() (time.Time, error)
- func GetNodenameForKernel(hostname string, hostDomainName string, setHostnameAsFQDN *bool) (string, error)
- func IsUnixDomainSocket(filePath string) (bool, error)
- func LocalEndpoint(path, file string) (string, error)
- func NormalizePath(path string) string
- func SetNodeOwnerFunc(c clientset.Interface, nodeName string) func(lease *coordinationv1.Lease) error
- type PodStartupLatencyTracker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateListener ¶
CreateListener creates a listener on the specified endpoint.
func FromApiserverCache ¶
func FromApiserverCache(opts *metav1.GetOptions)
FromApiserverCache modifies <opts> so that the GET request will be served from apiserver cache instead of from etcd.
func GetAddressAndDialer ¶
func GetAddressAndDialer(endpoint string) (string, func(ctx context.Context, addr string) (net.Conn, error), error)
GetAddressAndDialer returns the address parsed from the given endpoint and a context dialer.
func GetBootTime ¶
GetBootTime returns the time at which the machine was started, truncated to the nearest second
func GetNodenameForKernel ¶
func GetNodenameForKernel(hostname string, hostDomainName string, setHostnameAsFQDN *bool) (string, error)
GetNodenameForKernel gets hostname value to set in the hostname field (the nodename field of struct utsname) of the pod.
func IsUnixDomainSocket ¶
IsUnixDomainSocket returns whether a given file is a AF_UNIX socket file
func LocalEndpoint ¶
LocalEndpoint returns the full path to a unix socket at the given endpoint
func NormalizePath ¶
NormalizePath is a no-op for Linux for now
func SetNodeOwnerFunc ¶
func SetNodeOwnerFunc(c clientset.Interface, nodeName string) func(lease *coordinationv1.Lease) error
SetNodeOwnerFunc helps construct a newLeasePostProcessFunc which sets a node OwnerReference to the given lease object
Types ¶
type PodStartupLatencyTracker ¶
type PodStartupLatencyTracker interface { ObservedPodOnWatch(pod *v1.Pod, when time.Time) RecordImageStartedPulling(podUID types.UID) RecordImageFinishedPulling(podUID types.UID) RecordStatusUpdated(pod *v1.Pod) DeletePodStartupState(podUID types.UID) }
PodStartupLatencyTracker records key moments for startup latency calculation, e.g. image pulling or pod observed running on watch.
func NewPodStartupLatencyTracker ¶
func NewPodStartupLatencyTracker() PodStartupLatencyTracker
NewPodStartupLatencyTracker creates an instance of PodStartupLatencyTracker