mirror of https://github.com/docker/cli.git
Remove metadata file before writing
The packages will deliver this as a link so lets make sure we don't
write through the link to the underlying packaged file.
Signed-off-by: Daniel Hiltgen <daniel.hiltgen@docker.com>
(cherry picked from commit 0f22d7e295
)
Signed-off-by: Daniel Hiltgen <daniel.hiltgen@docker.com>
This commit is contained in:
parent
b7ec4a42d9
commit
ab6c0e1845
|
@ -5,6 +5,7 @@ import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
@ -124,6 +125,7 @@ func (c *baseClient) WriteRuntimeMetadata(dockerRoot string, metadata *RuntimeMe
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
os.Remove(filename)
|
||||||
return ioutil.WriteFile(filename, data, 0644)
|
return ioutil.WriteFile(filename, data, 0644)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue