diff options
author | W. Trevor King <wking@tremily.us> | 2018-05-10 11:06:53 -0700 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-05-11 16:26:35 +0000 |
commit | 89430ffe65636b45cab834c94f176c1dc1d8a167 (patch) | |
tree | ca0620a2f47e1a805f874826f67e3a912935e570 /pkg/hooks/README.md | |
parent | 4b22913e11208eb2a46085c1fede48a8e9168936 (diff) | |
download | podman-89430ffe65636b45cab834c94f176c1dc1d8a167.tar.gz podman-89430ffe65636b45cab834c94f176c1dc1d8a167.tar.bz2 podman-89430ffe65636b45cab834c94f176c1dc1d8a167.zip |
hooks: Order injection by collated JSON filename
We also considered ordering with sort.Strings, but Matthew rejected
that because it uses a byte-by-byte UTF-8 comparison [1] which would
fail many language-specific conventions [2].
There's some more discussion of the localeToLanguage mapping in [3].
Currently language.Parse does not handle either 'C' or 'POSIX',
returning:
und, language: tag is not well-formed
for both.
[1]: https://github.com/projectatomic/libpod/pull/686#issuecomment-387914358
[2]: https://en.wikipedia.org/wiki/Alphabetical_order#Language-specific_conventions
[3]: https://github.com/golang/go/issues/25340
Signed-off-by: W. Trevor King <wking@tremily.us>
Closes: #686
Approved by: mheon
Diffstat (limited to 'pkg/hooks/README.md')
-rw-r--r-- | pkg/hooks/README.md | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/pkg/hooks/README.md b/pkg/hooks/README.md index e47000a09..0d7037222 100644 --- a/pkg/hooks/README.md +++ b/pkg/hooks/README.md @@ -23,6 +23,10 @@ For both `crio` and `podman`, hooks are read from `/usr/share/containers/oci/hoo For `crio`, hook JSON is also read from `/etc/containers/oci/hooks.d/*.json`. If files of with the same name exist in both directories, the one in `/etc/containers/oci/hooks.d` takes precedence. +Hooks MUST be injected in the JSON filename case- and width-insensitive collation order. +Collation order depends on your locale, as set by [`LC_ALL`][LC_ALL], [`LC_COLLATE`][LC_COLLATE], or [`LANG`][LANG] (in order of decreasing precedence). +For example, in the [POSIX locale][LC_COLLATE-POSIX], a matching hook defined in `01-my-hook.json` would be injected before matching hooks defined in `02-another-hook.json` and `01-UPPERCASE.json`. + Each JSON file should contain an object with the following properties: ### 1.0.0 Hook Schema @@ -160,6 +164,10 @@ $ cat /etc/containers/oci/hooks.d/osystemd-hook.json ``` [JSON]: https://tools.ietf.org/html/rfc8259 +[LANG]: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html#tag_08_02 +[LC_ALL]: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html#tag_08_02 +[LC_COLLATE]: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap07.html#tag_07_03_02 +[LC_COLLATE-POSIX]: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap07.html#tag_07_03_02_06 [nvidia-container-runtime-hook]: https://github.com/NVIDIA/nvidia-container-runtime/tree/master/hook/nvidia-container-runtime-hook [oci-systemd-hook]: https://github.com/projectatomic/oci-systemd-hook [oci-umount]: https://github.com/projectatomic/oci-umount |