Skip to content

Commit

Permalink
Remove the docker compatibility mode (#13635)
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorentClarret authored Jan 9, 2023
1 parent 7ab2c92 commit f3c30da
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions datadog_checks_dev/datadog_checks/dev/docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def compose_file_active(compose_file):
"""
Returns a `bool` indicating whether or not a compose file has any active services.
"""
command = ['docker', 'compose', '--compatibility', '-f', compose_file, 'ps']
command = ['docker', 'compose', '-f', compose_file, 'ps']
lines = run_command(command, capture='out', check=True).stdout.strip().splitlines()

return len(lines) > 1
Expand Down Expand Up @@ -220,7 +220,7 @@ def __init__(self, compose_file, build=False, service_name=None):
self.compose_file = compose_file
self.build = build
self.service_name = service_name
self.command = ['docker', 'compose', '--compatibility', '-f', self.compose_file, 'up', '-d']
self.command = ['docker', 'compose', '-f', self.compose_file, 'up', '-d']

if self.build:
self.command.append('--build')
Expand All @@ -236,7 +236,7 @@ class ComposeFileLogs(LazyFunction):
def __init__(self, compose_file, check=True):
self.compose_file = compose_file
self.check = check
self.command = ['docker', 'compose', '--compatibility', '-f', self.compose_file, 'logs']
self.command = ['docker', 'compose', '-f', self.compose_file, 'logs']

def __call__(self, exception):
return run_command(self.command, capture=False, check=self.check)
Expand All @@ -249,7 +249,6 @@ def __init__(self, compose_file, check=True):
self.command = [
'docker',
'compose',
'--compatibility',
'-f',
self.compose_file,
'down',
Expand Down Expand Up @@ -277,8 +276,8 @@ def _read_example_logs_config(check_root):
@contextmanager
def temporarily_stop_service(service, compose_file, check=True):
# type: (str, str, bool) -> Iterator[None]
stop_command = ['docker', 'compose', '--compatibility', '-f', compose_file, 'stop', service]
start_command = ['docker', 'compose', '--compatibility', '-f', compose_file, 'start', service]
stop_command = ['docker', 'compose', '-f', compose_file, 'stop', service]
start_command = ['docker', 'compose', '-f', compose_file, 'start', service]

run_command(stop_command, capture=False, check=check)
yield
Expand Down

0 comments on commit f3c30da

Please sign in to comment.