mirror of
https://github.com/offen/docker-volume-backup.git
synced 2026-04-21 16:12:40 +02:00
Compare commits
2 Commits
v2.36.0-al
...
v2.36.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c3daeacecb | ||
|
|
2065fb2815 |
@@ -170,26 +170,23 @@ func (s *script) stopContainersAndServices() (func() error, error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
s.logger.Info(
|
||||||
|
fmt.Sprintf(
|
||||||
|
"Stopping %d out of %d running container(s) as they were labeled %s.",
|
||||||
|
len(containersToStop),
|
||||||
|
len(allContainers),
|
||||||
|
filterMatchLabel,
|
||||||
|
),
|
||||||
|
)
|
||||||
if isDockerSwarm {
|
if isDockerSwarm {
|
||||||
s.logger.Info(
|
s.logger.Info(
|
||||||
fmt.Sprintf(
|
fmt.Sprintf(
|
||||||
"Stopping %d out of %d running container(s) and scaling down %d out of %d active service(s) as they were labeled %s.",
|
"Scaling down %d out of %d active service(s) as they were labeled %s.",
|
||||||
len(containersToStop),
|
|
||||||
len(allContainers),
|
|
||||||
len(servicesToScaleDown),
|
len(servicesToScaleDown),
|
||||||
len(allServices),
|
len(allServices),
|
||||||
filterMatchLabel,
|
filterMatchLabel,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
} else {
|
|
||||||
s.logger.Info(
|
|
||||||
fmt.Sprintf(
|
|
||||||
"Stopping %d out of %d running container(s) as they were labeled %s.",
|
|
||||||
len(containersToStop),
|
|
||||||
len(allContainers),
|
|
||||||
filterMatchLabel,
|
|
||||||
),
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var stoppedContainers []types.Container
|
var stoppedContainers []types.Container
|
||||||
@@ -320,21 +317,20 @@ func (s *script) stopContainersAndServices() (func() error, error) {
|
|||||||
errors.Join(allErrors...),
|
errors.Join(allErrors...),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
s.logger.Info(
|
||||||
|
fmt.Sprintf(
|
||||||
|
"Restarted %d container(s).",
|
||||||
|
len(stoppedContainers),
|
||||||
|
),
|
||||||
|
)
|
||||||
if isDockerSwarm {
|
if isDockerSwarm {
|
||||||
s.logger.Info(
|
s.logger.Info(
|
||||||
fmt.Sprintf(
|
fmt.Sprintf(
|
||||||
"Restarted %d container(s) and %d service(s).",
|
"Scaled %d service(s) back up.",
|
||||||
len(stoppedContainers),
|
|
||||||
len(scaledDownServices),
|
len(scaledDownServices),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
} else {
|
|
||||||
s.logger.Info(
|
|
||||||
fmt.Sprintf(
|
|
||||||
"Restarted %d container(s).",
|
|
||||||
len(stoppedContainers),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
2
go.mod
2
go.mod
@@ -10,7 +10,7 @@ require (
|
|||||||
github.com/docker/cli v24.0.1+incompatible
|
github.com/docker/cli v24.0.1+incompatible
|
||||||
github.com/docker/docker v24.0.7+incompatible
|
github.com/docker/docker v24.0.7+incompatible
|
||||||
github.com/gofrs/flock v0.8.1
|
github.com/gofrs/flock v0.8.1
|
||||||
github.com/klauspost/compress v1.17.4
|
github.com/klauspost/compress v1.17.5
|
||||||
github.com/leekchan/timeutil v0.0.0-20150802142658-28917288c48d
|
github.com/leekchan/timeutil v0.0.0-20150802142658-28917288c48d
|
||||||
github.com/minio/minio-go/v7 v7.0.66
|
github.com/minio/minio-go/v7 v7.0.66
|
||||||
github.com/offen/envconfig v1.5.0
|
github.com/offen/envconfig v1.5.0
|
||||||
|
|||||||
4
go.sum
4
go.sum
@@ -456,8 +456,8 @@ github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7V
|
|||||||
github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM=
|
github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM=
|
||||||
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
|
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
|
||||||
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
||||||
github.com/klauspost/compress v1.17.4 h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW4fZ4=
|
github.com/klauspost/compress v1.17.5 h1:d4vBd+7CHydUqpFBgUEKkSdtSugf9YFmSkvUYPquI5E=
|
||||||
github.com/klauspost/compress v1.17.4/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM=
|
github.com/klauspost/compress v1.17.5/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM=
|
||||||
github.com/klauspost/cpuid/v2 v2.0.1/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
|
github.com/klauspost/cpuid/v2 v2.0.1/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
|
||||||
github.com/klauspost/cpuid/v2 v2.2.6 h1:ndNyv040zDGIDh8thGkXYjnFtiN02M1PVVF+JE/48xc=
|
github.com/klauspost/cpuid/v2 v2.2.6 h1:ndNyv040zDGIDh8thGkXYjnFtiN02M1PVVF+JE/48xc=
|
||||||
github.com/klauspost/cpuid/v2 v2.2.6/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws=
|
github.com/klauspost/cpuid/v2 v2.2.6/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws=
|
||||||
|
|||||||
Reference in New Issue
Block a user