Do not filter mounts if volume backup is not enabled
This commit is contained in:
parent
91901ee35c
commit
faa2d9ff7e
|
@ -158,8 +158,12 @@ class Container:
|
||||||
return self._labels.get(name, None)
|
return self._labels.get(name, None)
|
||||||
|
|
||||||
def filter_mounts(self):
|
def filter_mounts(self):
|
||||||
"""Get all mounts for this container matching include/exclude filters"""
|
"""Get all mounts for this container matching include/exclude filters"""
|
||||||
filtered = []
|
filtered = []
|
||||||
|
|
||||||
|
if not self.volume_backup_enabled:
|
||||||
|
return filtered
|
||||||
|
|
||||||
if self._include:
|
if self._include:
|
||||||
for mount in self._mounts:
|
for mount in self._mounts:
|
||||||
for pattern in self._include:
|
for pattern in self._include:
|
||||||
|
|
|
@ -59,6 +59,7 @@ class ResticBackupTests(unittest.TestCase):
|
||||||
{
|
{
|
||||||
'service': 'web',
|
'service': 'web',
|
||||||
'labels': {
|
'labels': {
|
||||||
|
'restic-compose-backup.volumes': True,
|
||||||
'test': 'test',
|
'test': 'test',
|
||||||
},
|
},
|
||||||
'mounts': [{
|
'mounts': [{
|
||||||
|
@ -119,6 +120,7 @@ class ResticBackupTests(unittest.TestCase):
|
||||||
{
|
{
|
||||||
'service': 'web',
|
'service': 'web',
|
||||||
'labels': {
|
'labels': {
|
||||||
|
'restic-compose-backup.volumes': True,
|
||||||
'restic-compose-backup.volumes.include': 'media',
|
'restic-compose-backup.volumes.include': 'media',
|
||||||
},
|
},
|
||||||
'mounts': [
|
'mounts': [
|
||||||
|
@ -152,6 +154,7 @@ class ResticBackupTests(unittest.TestCase):
|
||||||
{
|
{
|
||||||
'service': 'web',
|
'service': 'web',
|
||||||
'labels': {
|
'labels': {
|
||||||
|
'restic-compose-backup.volumes': True,
|
||||||
'restic-compose-backup.volumes.exclude': 'stuff',
|
'restic-compose-backup.volumes.exclude': 'stuff',
|
||||||
},
|
},
|
||||||
'mounts': [
|
'mounts': [
|
||||||
|
|
Loading…
Reference in New Issue