mirror of
https://github.com/offen/docker-volume-backup.git
synced 2026-01-12 20:08:10 +08:00
Simplified hasLabel
This commit is contained in:
parent
31d0834482
commit
bcfd7230ae
1 changed files with 2 additions and 6 deletions
|
|
@ -92,12 +92,8 @@ func isSwarm(c interface {
|
|||
}
|
||||
|
||||
func hasLabel(labels map[string]string, key, value string) bool {
|
||||
if val, ok := labels[key]; ok {
|
||||
if val == value {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
val, ok := labels[key]
|
||||
return ok && val == value
|
||||
}
|
||||
|
||||
func checkStopLabels(labels map[string]string, stopDuringBackupLabelValue string, stopDuringBackupNoRestartLabelValue string) (bool, bool, error) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue