mirror of
https://github.com/rancher/os.git
synced 2025-08-29 03:31:25 +00:00
Ignore error creating /var/lib/system-docker if it already exists
This commit is contained in:
parent
a22075aef2
commit
32b2ccda1e
@ -191,7 +191,7 @@ func setupSharedRoot(c *config.CloudConfig) (*config.CloudConfig, error) {
|
|||||||
|
|
||||||
if isInitrd() {
|
if isInitrd() {
|
||||||
for _, i := range []string{"/mnt", "/media", "/var/lib/system-docker"} {
|
for _, i := range []string{"/mnt", "/media", "/var/lib/system-docker"} {
|
||||||
if err := os.Mkdir(i, 0755); err != nil {
|
if err := os.MkdirAll(i, 0755); err != nil {
|
||||||
return c, err
|
return c, err
|
||||||
}
|
}
|
||||||
if err := mount.Mount("tmpfs", i, "tmpfs", "rw"); err != nil {
|
if err := mount.Mount("tmpfs", i, "tmpfs", "rw"); err != nil {
|
||||||
|
10
tests/nonexistent_state_test.go
Normal file
10
tests/nonexistent_state_test.go
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
package integration
|
||||||
|
|
||||||
|
import . "gopkg.in/check.v1"
|
||||||
|
|
||||||
|
func (s *QemuSuite) TestNonexistentState(c *C) {
|
||||||
|
err := s.RunQemu("--no-format", "--append", "rancher.state.dev=LABEL=NONEXISTENT")
|
||||||
|
c.Assert(err, IsNil)
|
||||||
|
|
||||||
|
s.CheckCall(c, "sudo ros config get rancher.state.dev | grep LABEL=NONEXISTENT")
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user