util

package
v0.0.0-...-ca29982 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 1, 2023 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Overview

Package util holds utility functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateListener

func CreateListener(endpoint string) (net.Listener, error)

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

func GetBootTime() (time.Time, error)

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

func IsUnixDomainSocket(filePath string) (bool, error)

IsUnixDomainSocket returns whether a given file is a AF_UNIX socket file

func LocalEndpoint

func LocalEndpoint(path, file string) (string, error)

LocalEndpoint returns the full path to a unix socket at the given endpoint

func NormalizePath

func NormalizePath(path string) string

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

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL