container: format code with gofumpt
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
87cedbe443
commit
b71951c70c
3 changed files with 6 additions and 6 deletions
|
@ -175,7 +175,7 @@ func (container *Container) toDisk() (*Container, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Save container settings
|
// Save container settings
|
||||||
f, err := ioutils.NewAtomicFileWriter(pth, 0600)
|
f, err := ioutils.NewAtomicFileWriter(pth, 0o600)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
@ -250,7 +250,7 @@ func (container *Container) WriteHostConfig() (*containertypes.HostConfig, error
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
f, err := ioutils.NewAtomicFileWriter(pth, 0600)
|
f, err := ioutils.NewAtomicFileWriter(pth, 0o600)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
@ -279,7 +279,7 @@ func (container *Container) SetupWorkingDirectory(rootIdentity idtools.Identity)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := idtools.MkdirAllAndChownNew(pth, 0755, rootIdentity); err != nil {
|
if err := idtools.MkdirAllAndChownNew(pth, 0o755, rootIdentity); err != nil {
|
||||||
pthInfo, err2 := os.Stat(pth)
|
pthInfo, err2 := os.Stat(pth)
|
||||||
if err2 == nil && pthInfo != nil && !pthInfo.IsDir() {
|
if err2 == nil && pthInfo != nil && !pthInfo.IsDir() {
|
||||||
return errors.Errorf("Cannot mkdir: %s is not a directory", container.Config.WorkingDir)
|
return errors.Errorf("Cannot mkdir: %s is not a directory", container.Config.WorkingDir)
|
||||||
|
@ -402,7 +402,7 @@ func (container *Container) StartLogger() (logger.Logger, error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if err := os.MkdirAll(logDir, 0700); err != nil {
|
if err := os.MkdirAll(logDir, 0o700); err != nil {
|
||||||
return nil, errdefs.System(errors.Wrap(err, "error creating local logs dir"))
|
return nil, errdefs.System(errors.Wrap(err, "error creating local logs dir"))
|
||||||
}
|
}
|
||||||
info.LogPath = filepath.Join(logDir, "container.log")
|
info.LogPath = filepath.Join(logDir, "container.log")
|
||||||
|
|
|
@ -60,7 +60,7 @@ func (container *Container) BuildHostnameFile() error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
container.HostnamePath = hostnamePath
|
container.HostnamePath = hostnamePath
|
||||||
return os.WriteFile(container.HostnamePath, []byte(container.Config.Hostname+"\n"), 0644)
|
return os.WriteFile(container.HostnamePath, []byte(container.Config.Hostname+"\n"), 0o644)
|
||||||
}
|
}
|
||||||
|
|
||||||
// NetworkMounts returns the list of network mounts.
|
// NetworkMounts returns the list of network mounts.
|
||||||
|
|
|
@ -32,7 +32,7 @@ func newContainer(t *testing.T) *Container {
|
||||||
id = uuid.New().String()
|
id = uuid.New().String()
|
||||||
cRoot = filepath.Join(root, id)
|
cRoot = filepath.Join(root, id)
|
||||||
)
|
)
|
||||||
if err := os.MkdirAll(cRoot, 0755); err != nil {
|
if err := os.MkdirAll(cRoot, 0o755); err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
c := NewBaseContainer(id, cRoot)
|
c := NewBaseContainer(id, cRoot)
|
||||||
|
|
Loading…
Reference in a new issue