Documentation
¶
Index ¶
- Variables
- func ApplyRemoteAccess(cfg *v1alpha1.Environment, hostUrl, path string) error
- func ExpandPath(path string) (string, error)
- func GetIPAddress() (string, error)
- func GetIPAddressWithServices(services []IPService) (string, error)
- func GetKubeConfig(log *logger.FunLogger, cfg *v1alpha1.Environment, hostUrl string, dest string) error
- func RewriteKubeConfigServer(path string, serverURL string) error
- type IPService
Constants ¶
This section is empty.
Variables ¶
var ( ErrRewriteFailed = errors.New("kubeconfig server URL rewrite failed") ErrChownFailed = errors.New("kubeconfig chown failed") )
Errors returned by ApplyRemoteAccess so callers and tests can distinguish failure modes via errors.Is without string matching.
Functions ¶
func ApplyRemoteAccess ¶ added in v0.3.4
func ApplyRemoteAccess(cfg *v1alpha1.Environment, hostUrl, path string) error
ApplyRemoteAccess rewrites the kubeconfig server URL to a publicly reachable endpoint and chowns the file to the bind-mounted workspace owner. No-op when Spec.Kubernetes.RemoteAccess is false.
Ordering: rewrite first, then chown. If rewrite fails, the file is left untouched. If rewrite succeeds but chown fails, the file has the new server URL but the original ownership; the caller must treat the kubeconfig as garbage and abort.
func ExpandPath ¶ added in v0.3.0
ExpandPath expands a leading ~ to the user's home directory. Non-tilde paths are returned unchanged.
func GetIPAddress ¶ added in v0.2.14
GetIPAddress gets the IP address of the user with timeout and fallback services
func GetIPAddressWithServices ¶ added in v0.3.0
GetIPAddressWithServices gets the IP address using the provided list of services. This allows for testing with mock services.
func GetKubeConfig ¶
func GetKubeConfig(log *logger.FunLogger, cfg *v1alpha1.Environment, hostUrl string, dest string) error
GetKubeConfig downloads the kubeconfig file from the remote host
func RewriteKubeConfigServer ¶ added in v0.3.0
RewriteKubeConfigServer rewrites the server URL in a kubeconfig file. If serverURL is empty, this is a no-op.