Skip to content

Commit 0a2f635

Browse files
committed
typos
1 parent 74d5558 commit 0a2f635

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

docker.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,13 +158,17 @@ func (p Plugin) Exec() error {
158158
os.MkdirAll(dockerHome, 0600)
159159

160160
path := filepath.Join(dockerHome, "config.json")
161-
err := os.WriteFile(path, []byte(p.Login.Config), 0600)
161+
file, err := os.OpenFile(path, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0600)
162+
if err != nil {
163+
return fmt.Errorf("Error writing config.json: %s", err)
164+
}
165+
err = os.WriteFile(path, []byte(p.Login.Config), 0600)
162166
if err != nil {
163167
return fmt.Errorf("Error writing config.json: %s", err)
164168
}
165169
file.Close()
166170
}
167-
171+
168172
// add base image docker credentials to the existing config file, else create new
169173
if p.BaseImagePassword != "" {
170174
json, err := setDockerAuth(p.Login.Username, p.Login.Password, p.Login.Registry,

0 commit comments

Comments
 (0)