remove driver and use clusterConfig

pull/7603/head
Alonyb 2020-04-10 18:50:57 -05:00
parent 3bd143037b
commit 201a2bbc62
1 changed files with 6 additions and 11 deletions

View File

@ -18,6 +18,7 @@ package kic
import ( import (
"fmt" "fmt"
"k8s.io/minikube/pkg/minikube/config"
"net" "net"
"os/exec" "os/exec"
"strconv" "strconv"
@ -95,12 +96,10 @@ func (d *Driver) Create() error {
}, },
oci.PortMapping{ oci.PortMapping{
ListenAddress: oci.DefaultBindIPV4, ListenAddress: oci.DefaultBindIPV4,
ContainerPort: constants.RegisteryAddonPort, ContainerPort: constants.RegistryAddonPort,
}, },
) )
fmt.Println("ruben")
exists, err := oci.ContainerExists(d.OCIBinary, params.Name) exists, err := oci.ContainerExists(d.OCIBinary, params.Name)
if err != nil { if err != nil {
glog.Warningf("failed to check if container already exists: %v", err) glog.Warningf("failed to check if container already exists: %v", err)
@ -209,15 +208,11 @@ func (d *Driver) GetSSHPort() (int, error) {
return p, nil return p, nil
} }
func (d *Driver) GetRegisteryHostname() (string, error) { // GetRegistryAddonPort returns port for use with registry
return oci.DefaultBindIPV4, nil func GetRegistryAddonPort(cc *config.ClusterConfig) (int, error) {
} p, err := oci.ForwardedPort(cc.Driver, cc.Name, constants.RegistryAddonPort)
// GetRegisteryAddonPort returns port for use with ssh
func (d *Driver) GetRegisteryAddonPort() (int, error) {
p, err := oci.ForwardedPort(d.OCIBinary, d.MachineName, constants.RegisteryAddonPort)
if err != nil { if err != nil {
return p, errors.Wrap(err, "get registery host-port") return p, errors.Wrap(err, "get registry port")
} }
return p, nil return p, nil
} }