diff --git a/src/restic_compose_backup/containers.py b/src/restic_compose_backup/containers.py index a05e638..fbc2049 100644 --- a/src/restic_compose_backup/containers.py +++ b/src/restic_compose_backup/containers.py @@ -72,9 +72,7 @@ class Container: @property def service_name(self) -> str: """Name of the container/service""" - name = self.get_label('com.docker.compose.service', default='') - if not name: - return self.get_label('com.docker.swarm.service.name', default='') + return self.get_label('com.docker.compose.service', default='') or self.get_label('com.docker.swarm.service.name', default='') @property def backup_process_label(self) -> str: