k8s

package
v3.8.2 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2026 License: EPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLoadBalancerAddress

func GetLoadBalancerAddress(ctx context.Context, getter ServiceGetter, namespace, name string) (addr string, ready bool, err error)

GetLoadBalancerAddress performs a non-blocking read of the Service LoadBalancer address.

func LoadBalancerAddress

func LoadBalancerAddress(svc *corev1.Service) (addr string, ok bool)

LoadBalancerAddress returns the external IP or hostname from Service status. IP is preferred when both are set, matching historical go-sdk behavior.

func WaitLoadBalancerAddress

func WaitLoadBalancerAddress(ctx context.Context, getter ServiceGetter, namespace, name string, timeout time.Duration) (string, error)

WaitLoadBalancerAddress polls until the Service has a LoadBalancer address or timeout elapses.

Types

type ClientServiceGetter

type ClientServiceGetter struct {
	Client client.Reader
}

ClientServiceGetter adapts a controller-runtime client.Reader.

func (ClientServiceGetter) GetService

func (g ClientServiceGetter) GetService(ctx context.Context, namespace, name string) (*corev1.Service, error)

type CoreV1ServiceGetter

type CoreV1ServiceGetter struct {
	Kube kubernetes.Interface
}

CoreV1ServiceGetter adapts client-go kubernetes.Interface for ctl tools.

func (CoreV1ServiceGetter) GetService

func (g CoreV1ServiceGetter) GetService(ctx context.Context, namespace, name string) (*corev1.Service, error)

type ServiceGetter

type ServiceGetter interface {
	GetService(ctx context.Context, namespace, name string) (*corev1.Service, error)
}

ServiceGetter loads a Kubernetes Service by namespace and name. Implementations are provided for controller-runtime and client-go so the operator, iofogctl, and potctl can share LoadBalancer wait logic.

Jump to

Keyboard shortcuts

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