builder: do not set network.host entitlement flag if already set in buildkitd conf

Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
(cherry picked from commit 617d59d70b)
This commit is contained in:
CrazyMax
2024-09-11 12:27:29 +02:00
parent e5a6b8e140
commit e8ceaad0a8
4 changed files with 73 additions and 22 deletions

View File

@ -34,8 +34,8 @@ func DefaultConfigFile(dockerCli command.Cli) (string, bool) {
return "", false
}
// loadConfigTree loads BuildKit config toml tree
func loadConfigTree(fp string) (*toml.Tree, error) {
// 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) {

View File

@ -32,7 +32,7 @@ func LoadConfigFiles(bkconfig string) (map[string][]byte, error) {
}
// Load config tree
btoml, err := loadConfigTree(bkconfig)
btoml, err := LoadConfigTree(bkconfig)
if err != nil {
return nil, err
}