resolve comments

This commit is contained in:
Aishwarya Lad
2024-06-26 15:42:46 -07:00
parent 5639b702aa
commit 74d5558af0
2 changed files with 14 additions and 38 deletions
-18
View File
@@ -5,8 +5,6 @@ import (
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"os"
"strings"
)
@@ -71,19 +69,3 @@ func (c *Config) CreateDockerConfigJson(credentials []RegistryCredentials) ([]by
return jsonBytes, nil
}
func WriteDockerConfig(data []byte, path string) (string error) {
err := os.MkdirAll(path, 0600)
if err != nil {
if !os.IsExist(err) {
return errors.New("failed to create %s directory")
}
}
filePath := path + "/config.json"
err = ioutil.WriteFile(filePath, data, 0644)
if err != nil {
return errors.New("failed to create docker config file at %s")
}
return nil
}