mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-10-17 15:12:42 +02:00
Perform manual failover during the scale down
This commit is contained in:
@@ -103,3 +103,19 @@ func FindNamedStringSubmatch(r *regexp.Regexp, s string) map[string]string {
|
||||
|
||||
return res
|
||||
}
|
||||
|
||||
// MapContains returns true if and only if haystack contains all the keys from the needle with matching corresponding values
|
||||
func MapContains(haystack, needle map[string]string) bool {
|
||||
if len(haystack) < len(needle) {
|
||||
return false
|
||||
}
|
||||
|
||||
for k, v := range needle {
|
||||
v2, ok := haystack[k]
|
||||
if !ok || v2 != v {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user