store snapshot of config files on create

Files can be reused when container needs to be booted again.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
Tonis Tiigi
2021-11-02 22:48:20 -07:00
parent 7f0e37531c
commit 4c1621cccd
7 changed files with 92 additions and 73 deletions

View File

@ -2,7 +2,6 @@ package kubernetes
import (
"context"
"os"
"strconv"
"strings"
@ -78,12 +77,8 @@ func (f *factory) New(ctx context.Context, cfg driver.InitConfig) (driver.Driver
deploymentOpt.Qemu.Image = bkimage.QemuImage
if cfg.ConfigFile != "" {
buildkitConfig, err := os.ReadFile(cfg.ConfigFile)
if err != nil {
return nil, err
}
deploymentOpt.BuildkitConfig = buildkitConfig
if cfg, ok := cfg.Files["buildkitd.toml"]; ok {
deploymentOpt.BuildkitConfig = cfg
}
loadbalance := LoadbalanceSticky