Skip to content

Commit

Permalink
Merge pull request #975 from subutai-io/issue-963
Browse files Browse the repository at this point in the history
  • Loading branch information
Dilshat authored Mar 8, 2019
2 parents 20c9719 + 4bc8909 commit 2c3e43b
Show file tree
Hide file tree
Showing 12 changed files with 348 additions and 1,065 deletions.
82 changes: 0 additions & 82 deletions cli/backup.go

This file was deleted.

8 changes: 2 additions & 6 deletions cli/clone.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import (
"github.com/nightlyone/lockfile"
"time"
"github.com/subutai-io/agent/lib/common"
"github.com/subutai-io/agent/lib/fs"
)

var (
Expand All @@ -34,17 +33,14 @@ var (
// This is one of the security checks which makes sure that each container creation request is authorized by registered user.
//
// The clone options are not intended for manual use: unless you're confident about what you're doing. Use default clone format without additional options to create Subutai containers.
func LxcClone(parent, child, envID, addr, consoleSecret, backupFile string) {
func LxcClone(parent, child, envID, addr, consoleSecret string) {

util.VerifyLxcName(child)

if container.LxcInstanceExists(child) {
log.Error("Container " + child + " already exists")
}

backupFile = strings.TrimSpace(backupFile)
checkState(backupFile == "" || fs.FileExists(backupFile), "Backup file %s not found", backupFile)

//synchronize
var lock lockfile.Lockfile
var err error
Expand Down Expand Up @@ -73,7 +69,7 @@ func LxcClone(parent, child, envID, addr, consoleSecret, backupFile string) {
LxcImport("id:"+t.Id, "")
}

log.Check(log.ErrorLevel, "Cloning the container", container.Clone(fullRef, child, backupFile))
log.Check(log.ErrorLevel, "Cloning the container", container.Clone(fullRef, child))

gpg.GenerateKey(child)
if len(consoleSecret) != 0 {
Expand Down
10 changes: 5 additions & 5 deletions cli/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -555,19 +555,19 @@ func install(templateName string) error {
return err
}
// create partitions
err = fs.ReceiveStream(templateName+"/rootfs", path.Join(pathToDecompressedTemplate, "deltas", "rootfs.delta"))
err = fs.ReceiveStream(templateName+"/rootfs", path.Join(pathToDecompressedTemplate, "deltas", "rootfs.delta"), false)
if err != nil {
return err
}
err = fs.ReceiveStream(templateName+"/home", path.Join(pathToDecompressedTemplate, "deltas", "home.delta"))
err = fs.ReceiveStream(templateName+"/home", path.Join(pathToDecompressedTemplate, "deltas", "home.delta"), false)
if err != nil {
return err
}
err = fs.ReceiveStream(templateName+"/var", path.Join(pathToDecompressedTemplate, "deltas", "var.delta"))
err = fs.ReceiveStream(templateName+"/var", path.Join(pathToDecompressedTemplate, "deltas", "var.delta"), false)
if err != nil {
return err
}
err = fs.ReceiveStream(templateName+"/opt", path.Join(pathToDecompressedTemplate, "deltas", "opt.delta"))
err = fs.ReceiveStream(templateName+"/opt", path.Join(pathToDecompressedTemplate, "deltas", "opt.delta"), false)
if err != nil {
return err
}
Expand Down Expand Up @@ -599,7 +599,7 @@ func install(templateName string) error {
}

func initManagement(templateRef string) {
container.Clone(templateRef, container.Management, "")
container.Clone(templateRef, container.Management)

container.SetContainerUID(container.Management)
container.SetContainerConf(container.Management, [][]string{
Expand Down
Loading

0 comments on commit 2c3e43b

Please sign in to comment.