From 3d5c9ae870e8c9a5e158f6b34888ff247c25ecaa Mon Sep 17 00:00:00 2001 From: Medya Gh Date: Thu, 23 Jan 2020 18:28:32 -0800 Subject: [PATCH] implement SSHPortName for kic --- pkg/drivers/kic/kic.go | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/pkg/drivers/kic/kic.go b/pkg/drivers/kic/kic.go index 533af1e234..ea7336e050 100644 --- a/pkg/drivers/kic/kic.go +++ b/pkg/drivers/kic/kic.go @@ -58,16 +58,17 @@ type Driver struct { // Config is configuration for the kic driver used by registry type Config struct { - MachineName string // maps to the container name being created - CPU int // Number of CPU cores assigned to the container - Memory int // max memory in MB - StorePath string // libmachine store path - OCIBinary string // oci tool to use (docker, podman,...) - ImageDigest string // image name with sha to use for the node - HostBindPort int // port to connect to forward from container to user's machine - Mounts []oci.Mount // mounts - PortMappings []oci.PortMapping // container port mappings - Envs map[string]string // key,value of environment variables passed to the node + MachineName string // maps to the container name being created + CPU int // Number of CPU cores assigned to the container + Memory int // max memory in MB + StorePath string // libmachine store path + OCIBinary string // oci tool to use (docker, podman,...) + ImageDigest string // image name with sha to use for the node + APIHostBindPort int // bind port for api server + SSHHostBindPort int // bind port for ssh server + Mounts []oci.Mount // mounts + PortMappings []oci.PortMapping // container port mappings + Envs map[string]string // key,value of environment variables passed to the node } // NewDriver returns a fully configured Kic driver @@ -137,12 +138,12 @@ func (d *Driver) GetIP() (string, error) { // GetSSHHostname returns hostname for use with ssh func (d *Driver) GetSSHHostname() (string, error) { - return "", fmt.Errorf("driver does not have SSHHostName") + return DefaultBindIPV4, nil } // GetSSHPort returns port for use with ssh func (d *Driver) GetSSHPort() (int, error) { - return 0, fmt.Errorf("driver does not support GetSSHPort") + return d.NodeConfig.SSHHostBindPort, nil } // GetURL returns ip of the container running kic control-panel