Documentation ¶
Index ¶
- Constants
- Variables
- type ComponentItem
- type KubernetesClient
- func (k *KubernetesClient) DeletePVC(name string) error
- func (k *KubernetesClient) GetComponentPod(componentName string) (coreV1.Pod, error)
- func (k *KubernetesClient) GetDeployment(name string) (*appsV1.Deployment, error)
- func (k *KubernetesClient) GetDeploymentContainers(name string) ([]coreV1.Container, error)
- func (k *KubernetesClient) GetPortForwardSubresourceURL(pod coreV1.Pod) *url.URL
- func (k *KubernetesClient) PortForwardRemoteSSH(componentName string) (*portforward.PortForwarder, error)
- func (k *KubernetesClient) WatchRemoteDevPods(componentName, containerName string) error
- type PortForwardOptions
- type RemoteDevelopment
- func (r *RemoteDevelopment) Close()
- func (r *RemoteDevelopment) CloseOnSignal(signals chan os.Signal)
- func (r *RemoteDevelopment) DeleteRemoteDevK8sPVC() error
- func (r *RemoteDevelopment) EnsureComponentFolder() error
- func (r *RemoteDevelopment) EnsureEnvironmentKubeConfig() error
- func (r *RemoteDevelopment) EnsureRemoteDevK8sSecret() error
- func (r *RemoteDevelopment) EnsureRemoteSSHPortForward() error
- func (r *RemoteDevelopment) EnsureSSHConfigEntry() error
- func (r *RemoteDevelopment) EnsureSSHKeys() error
- func (r *RemoteDevelopment) EnsureSyncthingPortForward() error
- func (r *RemoteDevelopment) PrepareSyncthing() error
- func (r *RemoteDevelopment) SelectComponent(defaultComponentId string) error
- func (r *RemoteDevelopment) SelectContainer() error
- func (r *RemoteDevelopment) SelectEnvironment(defaultEnvironmentId string) error
- func (r *RemoteDevelopment) SelectLocalSyncFolder(defaultLocalSyncPath string) error
- func (r *RemoteDevelopment) SelectOrganization(defaultOrganizationId string) error
- func (r *RemoteDevelopment) SelectProject(defaultProjectId string) error
- func (r *RemoteDevelopment) StartLocalSyncthing() error
- func (r *RemoteDevelopment) StartRemoteDevelopment() error
- func (r *RemoteDevelopment) StartSSHTerminal() error
- func (r *RemoteDevelopment) StopRemoteDevelopment() error
- func (r *RemoteDevelopment) UpdateLocalSyncthingConfig() error
- func (r *RemoteDevelopment) Wait()
- func (r *RemoteDevelopment) WithComponent(component ComponentItem) *RemoteDevelopment
- func (r *RemoteDevelopment) WithKubernetesClient(kubeConfigPath string) *RemoteDevelopment
- func (r *RemoteDevelopment) WithSSH(sshPrivateKeyPath, sshPublicKeyPath string) *RemoteDevelopment
Constants ¶
View Source
const ( MetadataRemoteDevPrefix = "remote-dev.bunnyshell.com/" MetadataRemoteDevEnabled = MetadataRemoteDevPrefix + "enabled" MetadataRemoteDevComponent = MetadataRemoteDevPrefix + "component" MetadataRemoteDevContainer = MetadataRemoteDevPrefix + "container" // todo this should match the secret name that remote development start api is looking for SecretNamePattern = "%s-remote-dev" // todo this should match the pvc name that remote development start api created PVCName = "%s-remote-dev" SecretCertKeyName = "cert.pem" SecretKeyKeyName = "key.pem" SecretConfigKeyName = "config.xml" SecretAuthorizedKeysKeyName = "authorized_keys" PortForwardMethod = "POST" PortForwardInterface = "127.0.0.1" SSHRemotePort = 2222 )
View Source
const ( PrivateKeyFilename = "id_rsa" PublicKeyFilename = "id_rsa.pub" SyncthingRemoteInterface = "127.0.0.1" SyncthingRemotePort = 22000 )
View Source
const ( SyncthingVersion = "v1.20.4" SyncthingLocalConfigDirname = "syncthing-local" SyncthingRemoteConfigDirname = "syncthing-remote" )
View Source
const (
KubeConfigFilename = "kube-config.yaml"
)
Variables ¶
View Source
var ( ErrNoEnvironments = fmt.Errorf("no environments available") ErrNoOrganizations = fmt.Errorf("no organizations available") ErrNoComponents = fmt.Errorf("no components available") ErrNoComponentsWithSyncPath = fmt.Errorf("no components with remote sync path set") ErrNoProjects = fmt.Errorf("no projects available") )
Functions ¶
This section is empty.
Types ¶
type ComponentItem ¶
type KubernetesClient ¶
type KubernetesClient struct { Config clientcmd.ClientConfig RESTConfig *rest.Config ClientSet *kubernetes.Clientset SSHPortForwardOptions *PortForwardOptions }
func NewKubernetesClient ¶
func NewKubernetesClient(kubeConfigPath string) (*KubernetesClient, error)
func (*KubernetesClient) DeletePVC ¶
func (k *KubernetesClient) DeletePVC(name string) error
func (*KubernetesClient) GetComponentPod ¶
func (k *KubernetesClient) GetComponentPod(componentName string) (coreV1.Pod, error)
func (*KubernetesClient) GetDeployment ¶
func (k *KubernetesClient) GetDeployment(name string) (*appsV1.Deployment, error)
func (*KubernetesClient) GetDeploymentContainers ¶
func (k *KubernetesClient) GetDeploymentContainers(name string) ([]coreV1.Container, error)
func (*KubernetesClient) GetPortForwardSubresourceURL ¶
func (k *KubernetesClient) GetPortForwardSubresourceURL(pod coreV1.Pod) *url.URL
func (*KubernetesClient) PortForwardRemoteSSH ¶
func (k *KubernetesClient) PortForwardRemoteSSH(componentName string) (*portforward.PortForwarder, error)
func (*KubernetesClient) WatchRemoteDevPods ¶
func (k *KubernetesClient) WatchRemoteDevPods(componentName, containerName string) error
type PortForwardOptions ¶
type PortForwardOptions struct { Interface string RemotePort int LocalPort int StopChannel chan struct{} ReadyChannel chan struct{} }
func NewPortForwardOptions ¶
func NewPortForwardOptions() *PortForwardOptions
type RemoteDevelopment ¶
type RemoteDevelopment struct { SSHPrivateKeyPath string SSHPublicKeyPath string RemoteSSHForwarder *portforward.PortForwarder SyncthingSSHTunnel *ssh.SSHTunnel SyncthingProcess *os.Process OrganizationId string ProjectId string EnvironmentId string LocalSyncPath string RemoteSyncPath string ComponentId string ComponentName string ComponentFolderPath string KubeConfigPath string KubernetesClient *KubernetesClient ContainerName string StopChannel chan bool }
func NewRemoteDevelopment ¶
func NewRemoteDevelopment() *RemoteDevelopment
func (*RemoteDevelopment) Close ¶
func (r *RemoteDevelopment) Close()
func (*RemoteDevelopment) CloseOnSignal ¶
func (r *RemoteDevelopment) CloseOnSignal(signals chan os.Signal)
func (*RemoteDevelopment) DeleteRemoteDevK8sPVC ¶
func (r *RemoteDevelopment) DeleteRemoteDevK8sPVC() error
func (*RemoteDevelopment) EnsureComponentFolder ¶
func (r *RemoteDevelopment) EnsureComponentFolder() error
func (*RemoteDevelopment) EnsureEnvironmentKubeConfig ¶
func (r *RemoteDevelopment) EnsureEnvironmentKubeConfig() error
func (*RemoteDevelopment) EnsureRemoteDevK8sSecret ¶
func (r *RemoteDevelopment) EnsureRemoteDevK8sSecret() error
func (*RemoteDevelopment) EnsureRemoteSSHPortForward ¶
func (r *RemoteDevelopment) EnsureRemoteSSHPortForward() error
func (*RemoteDevelopment) EnsureSSHConfigEntry ¶
func (r *RemoteDevelopment) EnsureSSHConfigEntry() error
func (*RemoteDevelopment) EnsureSSHKeys ¶
func (r *RemoteDevelopment) EnsureSSHKeys() error
func (*RemoteDevelopment) EnsureSyncthingPortForward ¶
func (r *RemoteDevelopment) EnsureSyncthingPortForward() error
func (*RemoteDevelopment) PrepareSyncthing ¶
func (r *RemoteDevelopment) PrepareSyncthing() error
func (*RemoteDevelopment) SelectComponent ¶
func (r *RemoteDevelopment) SelectComponent(defaultComponentId string) error
func (*RemoteDevelopment) SelectContainer ¶
func (r *RemoteDevelopment) SelectContainer() error
func (*RemoteDevelopment) SelectEnvironment ¶
func (r *RemoteDevelopment) SelectEnvironment(defaultEnvironmentId string) error
func (*RemoteDevelopment) SelectLocalSyncFolder ¶
func (r *RemoteDevelopment) SelectLocalSyncFolder(defaultLocalSyncPath string) error
func (*RemoteDevelopment) SelectOrganization ¶
func (r *RemoteDevelopment) SelectOrganization(defaultOrganizationId string) error
func (*RemoteDevelopment) SelectProject ¶
func (r *RemoteDevelopment) SelectProject(defaultProjectId string) error
func (*RemoteDevelopment) StartLocalSyncthing ¶
func (r *RemoteDevelopment) StartLocalSyncthing() error
@todo add restart/stop management
func (*RemoteDevelopment) StartRemoteDevelopment ¶
func (r *RemoteDevelopment) StartRemoteDevelopment() error
func (*RemoteDevelopment) StartSSHTerminal ¶
func (r *RemoteDevelopment) StartSSHTerminal() error
func (*RemoteDevelopment) StopRemoteDevelopment ¶
func (r *RemoteDevelopment) StopRemoteDevelopment() error
func (*RemoteDevelopment) UpdateLocalSyncthingConfig ¶
func (r *RemoteDevelopment) UpdateLocalSyncthingConfig() error
func (*RemoteDevelopment) Wait ¶
func (r *RemoteDevelopment) Wait()
func (*RemoteDevelopment) WithComponent ¶
func (r *RemoteDevelopment) WithComponent(component ComponentItem) *RemoteDevelopment
func (*RemoteDevelopment) WithKubernetesClient ¶
func (r *RemoteDevelopment) WithKubernetesClient(kubeConfigPath string) *RemoteDevelopment
func (*RemoteDevelopment) WithSSH ¶
func (r *RemoteDevelopment) WithSSH(sshPrivateKeyPath, sshPublicKeyPath string) *RemoteDevelopment
Source Files ¶
Click to show internal directories.
Click to hide internal directories.