pass api server port to kic create container

pull/6991/head
Medya Gh 2020-03-10 18:33:59 -07:00
parent a522175211
commit 9ff0dc0ebc
2 changed files with 4 additions and 2 deletions

View File

@ -81,7 +81,7 @@ func (d *Driver) Create() error {
// control plane specific options // control plane specific options
params.PortMappings = append(params.PortMappings, oci.PortMapping{ params.PortMappings = append(params.PortMappings, oci.PortMapping{
ListenAddress: oci.DefaultBindIPV4, ListenAddress: oci.DefaultBindIPV4,
ContainerPort: constants.APIServerPort, ContainerPort: int32(params.APIServerPort),
}, },
oci.PortMapping{ oci.PortMapping{
ListenAddress: oci.DefaultBindIPV4, ListenAddress: oci.DefaultBindIPV4,
@ -202,7 +202,7 @@ func (d *Driver) GetSSHKeyPath() string {
// GetURL returns ip of the container running kic control-panel // GetURL returns ip of the container running kic control-panel
func (d *Driver) GetURL() (string, error) { func (d *Driver) GetURL() (string, error) {
p, err := oci.HostPortBinding(d.NodeConfig.OCIBinary, d.MachineName, d.NodeConfig.APIServerPort) p, err := oci.HostPortBinding(d.NodeConfig.OCIBinary, d.MachineName, int(d.NodeConfig.APIServerPort))
url := fmt.Sprintf("https://%s", net.JoinHostPort("127.0.0.1", fmt.Sprint(p))) url := fmt.Sprintf("https://%s", net.JoinHostPort("127.0.0.1", fmt.Sprint(p)))
if err != nil { if err != nil {
return url, errors.Wrap(err, "api host port binding") return url, errors.Wrap(err, "api host port binding")

View File

@ -62,6 +62,8 @@ func TestStartStop(t *testing.T) {
}}, }},
{"containerd", constants.DefaultKubernetesVersion, []string{ {"containerd", constants.DefaultKubernetesVersion, []string{
"--container-runtime=containerd", "--container-runtime=containerd",
"--docker-opt",
"containerd=/var/run/containerd/containerd.sock",
"--apiserver-port=8444", "--apiserver-port=8444",
}}, }},
{"crio", "v1.15.7", []string{ {"crio", "v1.15.7", []string{