diff --git a/container/container.go b/container/container.go index 47a4af4018..33f81e1ab2 100644 --- a/container/container.go +++ b/container/container.go @@ -175,7 +175,7 @@ func (container *Container) toDisk() (*Container, error) { } // Save container settings - f, err := ioutils.NewAtomicFileWriter(pth, 0600) + f, err := ioutils.NewAtomicFileWriter(pth, 0o600) if err != nil { return nil, err } @@ -250,7 +250,7 @@ func (container *Container) WriteHostConfig() (*containertypes.HostConfig, error return nil, err } - f, err := ioutils.NewAtomicFileWriter(pth, 0600) + f, err := ioutils.NewAtomicFileWriter(pth, 0o600) if err != nil { return nil, err } @@ -279,7 +279,7 @@ func (container *Container) SetupWorkingDirectory(rootIdentity idtools.Identity) 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) if err2 == nil && pthInfo != nil && !pthInfo.IsDir() { 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 { 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")) } info.LogPath = filepath.Join(logDir, "container.log") diff --git a/container/container_unix.go b/container/container_unix.go index 6509c0a99b..d081de5957 100644 --- a/container/container_unix.go +++ b/container/container_unix.go @@ -60,7 +60,7 @@ func (container *Container) BuildHostnameFile() error { return err } 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. diff --git a/container/view_test.go b/container/view_test.go index 903d8d1e8c..2c815478f1 100644 --- a/container/view_test.go +++ b/container/view_test.go @@ -32,7 +32,7 @@ func newContainer(t *testing.T) *Container { id = uuid.New().String() cRoot = filepath.Join(root, id) ) - if err := os.MkdirAll(cRoot, 0755); err != nil { + if err := os.MkdirAll(cRoot, 0o755); err != nil { t.Fatal(err) } c := NewBaseContainer(id, cRoot)