Skip to content
This repository has been archived by the owner on Aug 3, 2020. It is now read-only.

Commit

Permalink
Merge pull request #225 from ibuildthecloud/label-to-add-url
Browse files Browse the repository at this point in the history
Add label io.rancher.container.cattle_url=true to get CATTLE_URL env var
  • Loading branch information
Craig Jellick committed Mar 8, 2016
2 parents d66742d + d53ff6a commit d078e23
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion cattle/plugins/docker/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,16 @@
from urlparse import urlparse


def _has_label(instance):
try:
return instance.labels['io.rancher.container.cattle_url'] == 'true'
except:
pass
return False


def setup_cattle_config_url(instance, create_config):
if instance.get('agentId') is None:
if instance.get('agentId') is None and not _has_label(instance):
return

if 'labels' not in create_config:
Expand Down

0 comments on commit d078e23

Please sign in to comment.