Documentation
¶
Overview ¶
Package tunnel provides shared tunnel resolution and management utilities for controllers that work with Tunnel and ClusterTunnel resources.
Index ¶
- type ClusterTunnelWrapper
- type Interface
- type Resolver
- func (r *Resolver) Resolve(ctx context.Context, ref networkingv1alpha2.TunnelReference, ...) (Interface, error)
- func (r *Resolver) ResolveForIngressClassConfig(ctx context.Context, config *networkingv1alpha2.TunnelIngressClassConfig) (Interface, error)
- func (r *Resolver) ResolveFromTunnelRef(ctx context.Context, ref networkingv1alpha1.TunnelRef, bindingNamespace string) (Interface, error)
- type TunnelWrapper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClusterTunnelWrapper ¶
type ClusterTunnelWrapper struct {
ClusterTunnel *networkingv1alpha2.ClusterTunnel
OperatorNamespace string
}
ClusterTunnelWrapper wraps a ClusterTunnel to implement Interface
func (*ClusterTunnelWrapper) GetName ¶
func (w *ClusterTunnelWrapper) GetName() string
GetName returns the cluster tunnel name
func (*ClusterTunnelWrapper) GetNamespace ¶
func (w *ClusterTunnelWrapper) GetNamespace() string
GetNamespace returns the operator namespace (cluster-scoped resources use operator namespace)
func (*ClusterTunnelWrapper) GetSpec ¶
func (w *ClusterTunnelWrapper) GetSpec() networkingv1alpha2.TunnelSpec
GetSpec returns the cluster tunnel spec
func (*ClusterTunnelWrapper) GetStatus ¶
func (w *ClusterTunnelWrapper) GetStatus() networkingv1alpha2.TunnelStatus
GetStatus returns the cluster tunnel status
type Interface ¶
type Interface interface {
GetName() string
GetNamespace() string
GetSpec() networkingv1alpha2.TunnelSpec
GetStatus() networkingv1alpha2.TunnelStatus
}
Interface provides a common interface for Tunnel and ClusterTunnel. This allows controllers to work with both resource types uniformly.
type Resolver ¶
Resolver resolves tunnel references to concrete tunnel resources. It handles both Tunnel (namespaced) and ClusterTunnel (cluster-scoped) resources.
func NewResolver ¶
NewResolver creates a new tunnel resolver.
func (*Resolver) Resolve ¶
func (r *Resolver) Resolve(ctx context.Context, ref networkingv1alpha2.TunnelReference, defaultNamespace string) (Interface, error)
Resolve resolves a TunnelReference to a concrete Interface. For Tunnel kind, it uses the provided defaultNamespace or the namespace from the reference. For ClusterTunnel kind, the namespace is the operator namespace.
func (*Resolver) ResolveForIngressClassConfig ¶
func (r *Resolver) ResolveForIngressClassConfig(ctx context.Context, config *networkingv1alpha2.TunnelIngressClassConfig) (Interface, error)
ResolveForIngressClassConfig resolves a tunnel from TunnelIngressClassConfig. It uses the config's GetTunnelNamespace() method for namespace resolution.
func (*Resolver) ResolveFromTunnelRef ¶
func (r *Resolver) ResolveFromTunnelRef(ctx context.Context, ref networkingv1alpha1.TunnelRef, bindingNamespace string) (Interface, error)
ResolveFromTunnelRef resolves from v1alpha1.TunnelRef for backward compatibility. This is used by TunnelBinding and other legacy resources. Note: v1alpha1.TunnelRef doesn't have a Namespace field, so for Tunnel kind, we use the binding's namespace.
type TunnelWrapper ¶
type TunnelWrapper struct {
Tunnel *networkingv1alpha2.Tunnel
}
TunnelWrapper wraps a Tunnel to implement Interface
func (*TunnelWrapper) GetName ¶
func (w *TunnelWrapper) GetName() string
GetName returns the tunnel name
func (*TunnelWrapper) GetNamespace ¶
func (w *TunnelWrapper) GetNamespace() string
GetNamespace returns the tunnel namespace
func (*TunnelWrapper) GetSpec ¶
func (w *TunnelWrapper) GetSpec() networkingv1alpha2.TunnelSpec
GetSpec returns the tunnel spec
func (*TunnelWrapper) GetStatus ¶
func (w *TunnelWrapper) GetStatus() networkingv1alpha2.TunnelStatus
GetStatus returns the tunnel status