Documentation
¶
Index ¶
- func GetLoadBalancerAddress(ctx context.Context, getter ServiceGetter, namespace, name string) (addr string, ready bool, err error)
- func LoadBalancerAddress(svc *corev1.Service) (addr string, ok bool)
- func WaitLoadBalancerAddress(ctx context.Context, getter ServiceGetter, namespace, name string, ...) (string, error)
- type ClientServiceGetter
- type CoreV1ServiceGetter
- type ServiceGetter
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 ¶
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 ¶
ClientServiceGetter adapts a controller-runtime client.Reader.
func (ClientServiceGetter) GetService ¶
type CoreV1ServiceGetter ¶
type CoreV1ServiceGetter struct {
Kube kubernetes.Interface
}
CoreV1ServiceGetter adapts client-go kubernetes.Interface for ctl tools.
func (CoreV1ServiceGetter) GetService ¶
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.