提交 9ff0dc0e 编写于 作者: M Medya Gh

pass api server port to kic create container

上级 a5221752
......@@ -81,7 +81,7 @@ func (d *Driver) Create() error {
// control plane specific options
params.PortMappings = append(params.PortMappings, oci.PortMapping{
ListenAddress: oci.DefaultBindIPV4,
ContainerPort: constants.APIServerPort,
ContainerPort: int32(params.APIServerPort),
},
oci.PortMapping{
ListenAddress: oci.DefaultBindIPV4,
......@@ -202,7 +202,7 @@ func (d *Driver) GetSSHKeyPath() string {
// GetURL returns ip of the container running kic control-panel
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)))
if err != nil {
return url, errors.Wrap(err, "api host port binding")
......
......@@ -62,6 +62,8 @@ func TestStartStop(t *testing.T) {
}},
{"containerd", constants.DefaultKubernetesVersion, []string{
"--container-runtime=containerd",
"--docker-opt",
"containerd=/var/run/containerd/containerd.sock",
"--apiserver-port=8444",
}},
{"crio", "v1.15.7", []string{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册