Skip to content

Commit

Permalink
Merge pull request #3657 from DataDog/ian/dockerless_conf
Browse files Browse the repository at this point in the history
[dockerutil] logs info if Dockerless
  • Loading branch information
ian28223 authored Feb 14, 2018
2 parents 5e7104b + 22008a9 commit c608802
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions utils/dockerutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class CGroupException(Exception):
CONFIG_RELOAD_STATUS = ['start', 'die', 'stop', 'kill'] # used to trigger service discovery
DEFAULT_INIT_RETRIES = 0
DEFAULT_RETRY_INTERVAL = 20 # seconds
DEFAULT_SOCK_PATH = "/var/run/docker.sock"

# only used if no exclude rule was defined
DEFAULT_CONTAINER_EXCLUDE = [
Expand Down Expand Up @@ -139,8 +140,12 @@ def client(self):
self._client.ping()
return self._client
except Exception as ex:
log.error("Failed to initialize the docker client. Docker-related features "
"will fail. Will retry %s time(s). Error: %s" % (self.left_init_retries, str(ex)))
# No docker_daemon.yaml + no existing Docker socket file = Dockerless
if self._no_conf_file and not os.path.isfile(DEFAULT_SOCK_PATH):
log.info("Docker features disabled: No running Docker instance detected. Will not retry since no docker_daemon configuration file was found.")
else:
log.error("Failed to initialize the docker client. Docker-related features "
"will fail. Will retry %s time(s). Error: %s" % (self.left_init_retries, str(ex)))
self._client = None
return

Expand Down

0 comments on commit c608802

Please sign in to comment.