1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/pkg
Kir Kolyshkin 2aa13f86f0 idtools.MkdirAs*: error out if dir exists as file
Standard golang's `os.MkdirAll()` function returns "not a directory" error
in case a directory to be created already exists but is not a directory
(e.g. a file). Our own `idtools.MkdirAs*()` functions do not replicate
the behavior.

This is a bug since all `Mkdir()`-like functions are expected to ensure
the required directory exists and is indeed a directory, and return an
error otherwise.

As the code is using our in-house `system.Stat()` call returning a type
which is incompatible with that of golang's `os.Stat()`, I had to amend
the `system` package with `IsDir()`.

A test case is also provided.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2017-11-27 13:25:44 -08:00
..
aaparser apparmor: make pkg/aaparser work on read-only root 2017-05-18 00:05:13 +10:00
archive Remove solaris files 2017-10-24 15:39:34 -04:00
authorization Update libcontainerd to use containerd 1.0 2017-10-20 07:11:37 -07:00
broadcaster Improved push and pull with upload manager and download manager 2015-12-09 19:13:35 -08:00
chrootarchive Merge pull request #35285 from crosbymichael/solaris 2017-10-25 15:14:04 +02:00
containerfs pkg/package: remove promise package 2017-09-21 17:56:45 -07:00
devicemapper devmapper gd: disable for static build 2017-09-17 22:04:31 -07:00
directory Remove solaris build tag and `contrib/mkimage/solaris 2017-11-02 00:01:46 +00:00
discovery Add gosimple linter 2017-09-12 12:09:59 -04:00
dmesg devmapper: show dmesg if mount fails 2017-09-17 22:04:31 -07:00
filenotify Update logrus to v1.0.1 2017-07-31 13:16:46 -07:00
fileutils Remove solaris files 2017-10-24 15:39:34 -04:00
fsutils [project] change syscall to /x/sys/unix|windows 2017-07-11 08:00:32 -04:00
homedir Split homedir files by operating system 2017-07-10 14:10:43 +01:00
idtools idtools.MkdirAs*: error out if dir exists as file 2017-11-27 13:25:44 -08:00
ioutils Fix golint errors. 2017-08-18 14:23:44 -04:00
jsonmessage Move RFC3339NanoFixed to a more appropriate package. 2017-09-25 16:07:24 -04:00
locker pkg/locker: add benchmarks 2017-10-02 11:20:21 -07:00
longpath Windows: Fixing longpath hanlding of UNC paths. 2015-09-30 19:36:08 -07:00
loopback Add gosimple linter 2017-09-12 12:09:59 -04:00
mount Remove solaris build tag and `contrib/mkimage/solaris 2017-11-02 00:01:46 +00:00
namesgenerator Merge pull request #35250 from joppich/patch-1 2017-11-09 06:21:02 -08:00
parsers Remove solaris build tag and `contrib/mkimage/solaris 2017-11-02 00:01:46 +00:00
pidfile [project] change syscall to /x/sys/unix|windows 2017-07-11 08:00:32 -04:00
platform Remove solaris build tag and `contrib/mkimage/solaris 2017-11-02 00:01:46 +00:00
plugingetter Fixup some issues with plugin refcounting 2017-10-21 15:17:57 -04:00
plugins Add ineffassign linter 2017-09-08 18:23:21 -04:00
pools Add gosimple linter 2017-09-12 12:09:59 -04:00
progress Update the stream formatter to display custom unit numbers. 2017-05-11 11:13:11 -07:00
pubsub Make plugin emit strongly typed, consumable events 2017-07-06 14:26:06 -04:00
reexec Remove solaris build tag and `contrib/mkimage/solaris 2017-11-02 00:01:46 +00:00
signal Remove solaris build tag and `contrib/mkimage/solaris 2017-11-02 00:01:46 +00:00
stdcopy Spelling fixes 2017-07-03 13:13:09 -07:00
streamformatter Add goimports to linters. 2017-08-21 18:15:08 -04:00
stringid pkg: remove random package 2017-05-08 17:02:02 -07:00
symlink [project] change syscall to /x/sys/unix|windows 2017-07-11 08:00:32 -04:00
sysinfo Remove solaris build tag and `contrib/mkimage/solaris 2017-11-02 00:01:46 +00:00
system idtools.MkdirAs*: error out if dir exists as file 2017-11-27 13:25:44 -08:00
tailfile Change reading order of tailfile 2016-11-13 20:08:51 -08:00
tarsum Add ineffassign linter 2017-09-08 18:23:21 -04:00
term Remove solaris build tag and `contrib/mkimage/solaris 2017-11-02 00:01:46 +00:00
truncindex Fix non thread-safe Iteration around go-patricia 2017-01-09 17:06:50 +00:00
urlutil Move IsGitTransport() to gitutils 2017-06-26 10:07:04 -07:00
useragent Fix typos found across repository 2015-12-13 18:04:12 +02:00
README.md Rename a few docker to moby 2017-10-25 13:56:12 +02:00

pkg/ is a collection of utility packages used by the Moby project without being specific to its internals.

Utility packages are kept separate from the moby core codebase to keep it as small and concise as possible. If some utilities grow larger and their APIs stabilize, they may be moved to their own repository under the Moby organization, to facilitate re-use by other projects. However that is not the priority.

The directory pkg is named after the same directory in the camlistore project. Since Brad is a core Go maintainer, we thought it made sense to copy his methods for organizing Go code :) Thanks Brad!

Because utility packages are small and neatly separated from the rest of the codebase, they are a good place to start for aspiring maintainers and contributors. Get in touch if you want to help maintain them!