feat: support transfer image to remote

This commit is contained in:
fengcaiwen
2023-04-10 12:43:28 +08:00
parent b2a6596405
commit 71ed7e6bdb
12 changed files with 275 additions and 21 deletions

View File

@@ -256,18 +256,18 @@ func (r Run) Run(ctx context.Context, volume map[string][]mount.Mount) error {
if err != nil {
return err
}
for _, config := range r {
for _, runConfig := range r {
var id string
id, err = run(ctx, config, cli, c)
id, err = run(ctx, runConfig, cli, c)
if err != nil {
// try another way to startup container
log.Infof("occur err: %v, try another way to startup container...", err)
config.hostConfig.Mounts = nil
id, err = run(ctx, config, cli, c)
runConfig.hostConfig.Mounts = nil
id, err = run(ctx, runConfig, cli, c)
if err != nil {
return err
}
err = r.copyToContainer(ctx, volume[config.k8sContainerName], cli, id)
err = r.copyToContainer(ctx, volume[runConfig.k8sContainerName], cli, id)
if err != nil {
return err
}