container driver: copy ca and user tls registries certs

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax
2021-10-28 22:29:55 +02:00
parent 084b6c0a95
commit 3f716f00fa
69 changed files with 11391 additions and 33 deletions

25
util/confutil/config.go Normal file
View File

@ -0,0 +1,25 @@
package confutil
import (
"os"
"github.com/pelletier/go-toml"
"github.com/pkg/errors"
)
// loadConfigTree loads BuildKit config toml tree
func loadConfigTree(fp string) (*toml.Tree, error) {
f, err := os.Open(fp)
if err != nil {
if errors.Is(err, os.ErrNotExist) {
return nil, nil
}
return nil, errors.Wrapf(err, "failed to load config from %s", fp)
}
defer f.Close()
t, err := toml.LoadReader(f)
if err != nil {
return t, errors.Wrap(err, "failed to parse config")
}
return t, nil
}