|
|
c608c9 |
From 0f1b107a50dd2ba51277f6962dd0c28dfb8976fc Mon Sep 17 00:00:00 2001
|
|
|
c608c9 |
From: David Vossel <dvossel@redhat.com>
|
|
|
c608c9 |
Date: Sat, 25 Oct 2014 20:23:55 -0400
|
|
|
c608c9 |
Subject: [PATCH 1/2] High: docker: replace 'container' argument with 'name'
|
|
|
c608c9 |
|
|
|
c608c9 |
I realized that the 'container' argument means something special in
|
|
|
c608c9 |
pacemaker. In order to avoid confusion, the 'container' argument for
|
|
|
c608c9 |
this agent has been changed to 'name'. Anyone using 'container' as
|
|
|
c608c9 |
an argument right now will not be affected. The option still works, it
|
|
|
c608c9 |
is depreciated now though.
|
|
|
c608c9 |
---
|
|
|
c608c9 |
heartbeat/docker | 19 ++++++++++++++++---
|
|
|
c608c9 |
1 file changed, 16 insertions(+), 3 deletions(-)
|
|
|
c608c9 |
|
|
|
c608c9 |
diff --git a/heartbeat/docker b/heartbeat/docker
|
|
|
c608c9 |
index 37a449b..cdf4e82 100755
|
|
|
c608c9 |
--- a/heartbeat/docker
|
|
|
c608c9 |
+++ b/heartbeat/docker
|
|
|
c608c9 |
@@ -59,7 +59,7 @@ The docker image to base this container off of.
|
|
|
c608c9 |
<content type="string"/>
|
|
|
c608c9 |
</parameter>
|
|
|
c608c9 |
|
|
|
c608c9 |
-<parameter name="container" required="0" unique="0">
|
|
|
c608c9 |
+<parameter name="name" required="0" unique="0">
|
|
|
c608c9 |
<longdesc lang="en">
|
|
|
c608c9 |
The name to give the created container. By default this will
|
|
|
c608c9 |
be that resource's instance name.
|
|
|
c608c9 |
@@ -87,6 +87,11 @@ users to do things such as setting a custom entry point and injecting
|
|
|
c608c9 |
environment variables into the newly created container. Note the '-d'
|
|
|
c608c9 |
option is supplied regardless of this value to force containers to run
|
|
|
c608c9 |
in the background.
|
|
|
c608c9 |
+
|
|
|
c608c9 |
+NOTE: Do not explicitly specify the --name argument in the run_opts. This
|
|
|
c608c9 |
+agent will set --name using either the resource's instance or the name
|
|
|
c608c9 |
+provided in the 'name' argument of this agent.
|
|
|
c608c9 |
+
|
|
|
c608c9 |
</longdesc>
|
|
|
c608c9 |
<shortdesc lang="en">run options</shortdesc>
|
|
|
c608c9 |
<content type="string"/>
|
|
|
c608c9 |
@@ -314,8 +319,16 @@ docker_validate()
|
|
|
c608c9 |
return $OCF_SUCCESS
|
|
|
c608c9 |
}
|
|
|
c608c9 |
|
|
|
c608c9 |
-: ${OCF_RESKEY_container=${OCF_RESOURCE_INSTANCE}}
|
|
|
c608c9 |
-CONTAINER=$OCF_RESKEY_container
|
|
|
c608c9 |
+: ${OCF_RESKEY_name=${OCF_RESOURCE_INSTANCE}}
|
|
|
c608c9 |
+
|
|
|
c608c9 |
+if [ -n "$OCF_RESKEY_container" ]; then
|
|
|
c608c9 |
+ # we'll keep the container attribute around for a bit in order not to break
|
|
|
c608c9 |
+ # any existing deployments. The 'name' attribute is prefered now though.
|
|
|
c608c9 |
+ CONTAINER=$OCF_RESKEY_container
|
|
|
c608c9 |
+ ocf_log warn "The 'container' attribute is depreciated"
|
|
|
c608c9 |
+else
|
|
|
c608c9 |
+ CONTAINER=$OCF_RESKEY_name
|
|
|
c608c9 |
+fi
|
|
|
c608c9 |
|
|
|
c608c9 |
case $__OCF_ACTION in
|
|
|
c608c9 |
meta-data) meta_data
|
|
|
c608c9 |
--
|
|
|
c608c9 |
1.8.4.2
|
|
|
c608c9 |
|