On Wed, Nov 11, 2020 at 02:14:09PM +0800, Xiao Shenwei wrote:
register host2queues and requested specified queues
Signed-off-by: Xiao Shenwei xiaoshenwei96@163.com
providers/docker/docker.rb | 47 ++++++++++++++++++++++++-------------- 1 file changed, 30 insertions(+), 17 deletions(-)
diff --git a/providers/docker/docker.rb b/providers/docker/docker.rb index 4e6bc2f..8e489c6 100755 --- a/providers/docker/docker.rb +++ b/providers/docker/docker.rb @@ -11,15 +11,26 @@ require_relative '../../container/defconfig'
BASE_DIR = '/srv/dc'
+names = Set.new %w[
- SCHED_HOST
- SCHED_PORT
+] +defaults = relevant_defaults(names) +SCHED_HOST = defaults['SCHED_HOST'] || '172.17.0.1' +SCHED_PORT = defaults['SCHED_PORT'] || 3000
def get_url(hostname)
- names = Set.new %w[
- SCHED_HOST
- SCHED_PORT
- ]
- defaults = relevant_defaults(names)
- host = defaults['SCHED_HOST'] || '172.17.0.1'
- port = defaults['SCHED_PORT'] || 3000
- "http://#%7Bhost%7D:#%7Bport%7D/boot.container/hostname/#%7Bhostname%7D"
You can define a static variable for this url, so don't have to caculate everytime using it.
Thanks, Yuanchao
+end