提交 ca68beae 编写于 作者: M Medya Gh

remove not needed code

上级 0f77b9d7
......@@ -51,7 +51,7 @@ type Config struct {
Memory int
StorePath string
OciBinary string // oci tool to use (docker, podman,...)
ImageSha string // image name with sha to use for the node
ImageDigest string // image name with sha to use for the node
APIServerPort int32 // port to connect to forward from container to user's machine
}
......@@ -64,7 +64,7 @@ func NewDriver(c Config) *Driver {
},
exec: command.NewKICRunner(c.MachineName, c.OciBinary),
OciBinary: c.OciBinary,
ImageSha: c.ImageSha,
ImageSha: c.ImageDigest,
CPU: c.CPU,
Memory: c.Memory,
APIServerPort: c.APIServerPort,
......@@ -88,7 +88,7 @@ func (d *Driver) Create() error {
IPv6: false, // MEDYA:TODO add proxy envs here
}
_, err := ks.Create(command.NewKICRunner(d.MachineName, d.OciBinary))
err := ks.Create(command.NewKICRunner(d.MachineName, d.OciBinary))
if err != nil {
return errors.Wrap(err, "create kic from spec")
}
......
......@@ -45,7 +45,7 @@ type Spec struct {
Envs map[string]string // environment variables to be passsed to passed to create nodes
}
func (d *Spec) Create(cmder command.Runner) (node *Node, err error) {
func (d *Spec) Create(cmder command.Runner) (err error) {
params := CreateParams{
Name: d.Name,
Image: d.Image,
......@@ -65,22 +65,17 @@ func (d *Spec) Create(cmder command.Runner) (node *Node, err error) {
HostPort: d.APIServerPort,
ContainerPort: 6443,
})
node, err = CreateNode(
_, err = CreateNode(
params,
cmder,
)
if err != nil {
return node, err
return err
}
// stores the port mapping into the node internal state
node.cache.set(func(cache *nodeCache) {
cache.ports = map[int32]int32{6443: d.APIServerPort}
})
return node, nil
return nil
default:
return nil, fmt.Errorf("unknown node role: %s", d.Role)
return fmt.Errorf("unknown node role: %s", d.Role)
}
}
......
......@@ -57,13 +57,13 @@ func (k *kicRunner) RunCmd(cmd *exec.Cmd) (*RunResult, error) {
"-i", // interactive so we can supply input
)
}
// if the command is hooked up to the processes's output we want a tty
// if the command is hooked to another processes's output we want a tty
if isTerminal(cmd.Stderr) || isTerminal(cmd.Stdout) {
args = append(args,
"-t",
)
}
// set env
for _, env := range cmd.Env {
args = append(args, "-e", env)
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册