From b8ebeda35b24426efa4014d1f0647411dc8cdd8a Mon Sep 17 00:00:00 2001 From: Erik Johnson Date: Thu, 20 Apr 2017 14:30:06 -0500 Subject: [PATCH 1/3] Alias moby to docker in Nitrogen (and later) --- salt/modules/dockermod.py | 2 +- salt/states/docker.py | 2 +- salt/states/docker_container.py | 1 + salt/states/docker_image.py | 1 + salt/states/docker_network.py | 1 + salt/states/docker_volume.py | 1 + 6 files changed, 6 insertions(+), 2 deletions(-) diff --git a/salt/modules/dockermod.py b/salt/modules/dockermod.py index 3045ae60ae..8a463f10c1 100644 --- a/salt/modules/dockermod.py +++ b/salt/modules/dockermod.py @@ -255,7 +255,7 @@ NOTSET = object() # Define the module's virtual name and alias __virtualname__ = 'docker' -__virtual_aliases__ = ('dockerng',) +__virtual_aliases__ = ('dockerng', 'moby') def __virtual__(): diff --git a/salt/states/docker.py b/salt/states/docker.py index b8ff9d3504..595a26d637 100644 --- a/salt/states/docker.py +++ b/salt/states/docker.py @@ -67,7 +67,7 @@ log = logging.getLogger(__name__) # pylint: disable=invalid-name # Define the module's virtual name __virtualname__ = 'docker' -__virtual_aliases__ = ('dockerng',) +__virtual_aliases__ = ('dockerng', 'moby') def __virtual__(): diff --git a/salt/states/docker_container.py b/salt/states/docker_container.py index d4694d7fc5..cf043148f1 100644 --- a/salt/states/docker_container.py +++ b/salt/states/docker_container.py @@ -60,6 +60,7 @@ log = logging.getLogger(__name__) # pylint: disable=invalid-name # Define the module's virtual name __virtualname__ = 'docker_container' +__virtual_aliases__ = ('moby_container',) def __virtual__(): diff --git a/salt/states/docker_image.py b/salt/states/docker_image.py index 53d0e49ac7..283fafa837 100644 --- a/salt/states/docker_image.py +++ b/salt/states/docker_image.py @@ -46,6 +46,7 @@ log = logging.getLogger(__name__) # pylint: disable=invalid-name # Define the module's virtual name __virtualname__ = 'docker_image' +__virtual_aliases__ = ('moby_image',) def __virtual__(): diff --git a/salt/states/docker_network.py b/salt/states/docker_network.py index 6b623e662e..250c133ebc 100644 --- a/salt/states/docker_network.py +++ b/salt/states/docker_network.py @@ -38,6 +38,7 @@ log = logging.getLogger(__name__) # pylint: disable=invalid-name # Define the module's virtual name __virtualname__ = 'docker_network' +__virtual_aliases__ = ('moby_network',) def __virtual__(): diff --git a/salt/states/docker_volume.py b/salt/states/docker_volume.py index 7a15e04233..ce15967a59 100644 --- a/salt/states/docker_volume.py +++ b/salt/states/docker_volume.py @@ -41,6 +41,7 @@ log = logging.getLogger(__name__) # pylint: disable=invalid-name # Define the module's virtual name __virtualname__ = 'docker_volume' +__virtual_aliases__ = ('moby_volume',) def __virtual__(): From 3d25746bd79a0af1bf11486a7ca52cf4f9a7cc20 Mon Sep 17 00:00:00 2001 From: Erik Johnson Date: Sun, 23 Apr 2017 23:32:04 -0500 Subject: [PATCH 2/3] Fix wrong indentation in RST --- salt/states/docker_image.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/salt/states/docker_image.py b/salt/states/docker_image.py index 283fafa837..7fb6a7b887 100644 --- a/salt/states/docker_image.py +++ b/salt/states/docker_image.py @@ -103,7 +103,7 @@ def present(name, - build: /home/myuser/docker/myimage - dockerfile: Dockerfile.alternative - .. versionadded:: 2016.11.0 + .. versionadded:: 2016.11.0 The image will be built using :py:func:`docker.build ` and the specified image name and tag From 0e229a19105dbf2799860f9c321c90f1d071e285 Mon Sep 17 00:00:00 2001 From: Erik Johnson Date: Sun, 23 Apr 2017 23:32:24 -0500 Subject: [PATCH 3/3] Add note about moby naming to Nitrogen release notes --- doc/topics/releases/nitrogen.rst | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/doc/topics/releases/nitrogen.rst b/doc/topics/releases/nitrogen.rst index e73f378aa1..de3d4b9826 100644 --- a/doc/topics/releases/nitrogen.rst +++ b/doc/topics/releases/nitrogen.rst @@ -347,6 +347,18 @@ This is similar to how Salt handles MySQL, MongoDB, Zabbix, and other cases where the same execution module is used to manage several different kinds of objects (users, databases, roles, etc.). +.. note:: + With the `Moby announcement`_ coming at this year's DockerCon_, Salt's + :mod:`docker ` execution module (as well as the + state modules) work interchangably when **docker** is replaced with + **moby** (e.g. :py:func:`moby_container.running + `, :py:func:`moby_image.present + `, :py:func:`moby.inspect_container + `, etc.) + +.. _`Moby announcement`: https://blog.docker.com/2017/04/introducing-the-moby-project/ +.. _DockerCon: http://2017.dockercon.com/ + The old syntax will continue to work until the **Fluorine** release of Salt. The old ``dockerng`` naming will also continue to work until that release, so no immediate changes need to be made to your SLS files (unless you were still