Documentation ¶
Index ¶
- Constants
- Variables
- func AddFeatureGate(current, new string) string
- func BuildControllerEventRecorder(k8s clientset.Interface, controllerName, namespace string) record.EventRecorder
- func GetAddresses(endpoint *v1.Endpoints) []string
- func GetFirst4(elems []net.IP) (net.IP, error)
- func GetFirst4Net(elems []*net.IPNet) (*net.IPNet, error)
- func GetFirst4String(elems []string) (string, error)
- func GetFirst6(elems []net.IP) (net.IP, error)
- func GetFirst6Net(elems []*net.IPNet) (*net.IPNet, error)
- func GetFirst6String(elems []string) (string, error)
- func GetFirstIP(nodeIPs []net.IP) (net.IP, string, bool, error)
- func GetFirstNet(elems []*net.IPNet) (*net.IPNet, error)
- func GetFirstString(elems []string) (string, bool, error)
- func GetFunctionName(i interface{}) string
- func GetHostnameAndIPs(name string, nodeIPs cli.StringSlice) (string, []net.IP, error)
- func IPStringToIPNet(address string) (*net.IPNet, error)
- func IPToIPNet(ip net.IP) (*net.IPNet, error)
- func IsIPv6OnlyCIDRs(cidrs []*net.IPNet) (bool, error)
- func JoinIP4Nets(elems []*net.IPNet) string
- func JoinIP6Nets(elems []*net.IPNet) string
- func JoinIPNets(elems []*net.IPNet) string
- func JoinIPs(elems []net.IP) string
- func ParseStringSliceToIPs(s cli.StringSlice) ([]net.IP, error)
- func SetFileModeForFile(file *os.File, mode os.FileMode) error
- func SetFileModeForPath(name string, mode os.FileMode) error
- func WaitForAPIServerReady(ctx context.Context, kubeconfigPath string, timeout time.Duration) error
Constants ¶
const DefaultAPIServerReadyTimeout = 15 * time.Minute
This sets a default duration to wait for the apiserver to become ready. This is primarily used to block startup of agent supervisor controllers until the apiserver is ready to serve requests, in the same way that the apiReady channel is used in the server packages, so it can be fairly long. It must be at least long enough for downstream projects like RKE2 to start the apiserver in the background.
Variables ¶
var ErrCommandNoArgs = errors.New("this command does not take any arguments")
var ErrUnsupportedPlatform = errors.New("unsupported platform")
Functions ¶
func AddFeatureGate ¶
AddFeatureGate correctly appends a feature gate key pair to the feature gates CLI switch.
func BuildControllerEventRecorder ¶
func BuildControllerEventRecorder(k8s clientset.Interface, controllerName, namespace string) record.EventRecorder
func GetAddresses ¶
func GetFirst4 ¶
GetFirst4 returns the first IPv4 address from the list of IP addresses. If no IPv4 addresses are found, an error is raised.
func GetFirst4Net ¶
GetFirst4Net returns the first IPv4 network from the list of IP networks. If no IPv4 addresses are found, an error is raised.
func GetFirst4String ¶
GetFirst4String returns the first IPv4 address from a list of IP address strings. If no IPv4 addresses are found, an error is raised.
func GetFirst6 ¶
GetFirst6 returns the first IPv6 address from the list of IP addresses. If no IPv6 addresses are found, an error is raised.
func GetFirst6Net ¶
GetFirst6Net returns the first IPv4 network from the list of IP networks. If no IPv6 addresses are found, an error is raised.
func GetFirst6String ¶
GetFirst6String returns the first IPv6 address from a list of IP address strings. If no IPv6 addresses are found, an error is raised.
func GetFirstIP ¶
GetFirstIP returns the first IPv4 address from the list of IP addresses. If no IPv4 addresses are found, returns the first IPv6 address if neither of IPv4 or IPv6 are found an error is raised. Additionally matching listen address and IP version is returned.
func GetFirstNet ¶
GetFirstNet returns the first IPv4 network from the list of IP networks. If no IPv4 addresses are found, returns the first IPv6 address if neither of IPv4 or IPv6 are found an error is raised.
func GetFirstString ¶
GetFirstString returns the first IP4 address from a list of IP address strings. If no IPv4 addresses are found, returns the first IPv6 address if neither of IPv4 or IPv6 are found an error is raised.
func GetFunctionName ¶
func GetFunctionName(i interface{}) string
func GetHostnameAndIPs ¶
GetHostnameAndIPs takes a node name and list of IPs, usually from CLI args. If set, these are used to return the node's name and addresses. If not set, the system hostname and primary interface address are returned instead.
func IPStringToIPNet ¶
IPStringToIPNet converts an IP string to an IPNet, using a fully filled mask appropriate for the address family.
func IPToIPNet ¶
IPToIPNet converts an IP to an IPNet, using a fully filled mask appropriate for the address family.
func IsIPv6OnlyCIDRs ¶
IsIPv6OnlyCIDRs returns if - all are valid cidrs - at least one cidr from v6 family is found - v4 family cidr is not found
func JoinIP4Nets ¶
JoinIP4Nets stringifies and joins a list of IPv4 networks with commas.
func JoinIP6Nets ¶
JoinIP6Nets stringifies and joins a list of IPv6 networks with commas.
func JoinIPNets ¶
JoinIPNets stringifies and joins a list of IP networks with commas.
func ParseStringSliceToIPs ¶
func ParseStringSliceToIPs(s cli.StringSlice) ([]net.IP, error)
ParseStringSliceToIPs converts slice of strings that in turn can be lists of comma separated unparsed IP addresses into a single slice of net.IP, it returns error if at any point parsing failed
func WaitForAPIServerReady ¶
WaitForAPIServerReady waits for the API Server's /readyz endpoint to report "ok" with timeout. This is modified from WaitForAPIServer from the Kubernetes controller-manager app, but checks the readyz endpoint instead of the deprecated healthz endpoint, and supports context.
Types ¶
This section is empty.