removing inner goroutine in cluster.Switchover (#1876)

* removing inner goroutine in cluster.Switchover and resolve race between processPodEvent and unregisterPodSubscriber
* unlock mutex after handling event, now with non-blocking default case
This commit is contained in:
Felix Kunde
2022-05-17 18:10:39 +02:00
committed by GitHub
parent c6f2c68588
commit 268a86a045
5 changed files with 36 additions and 44 deletions
+9 -1
View File
@@ -324,12 +324,20 @@ func testNil(values ...*int32) bool {
return false
}
// Convert int to IntOrString type
// ToIntStr converts int to IntOrString type
func ToIntStr(val int) *intstr.IntOrString {
b := intstr.FromInt(val)
return &b
}
// Bool2Int converts bool to int
func Bool2Int(flag bool) int {
if flag {
return 1
}
return 0
}
// Get int from IntOrString and return max int if string
func IntFromIntStr(intOrStr intstr.IntOrString) int {
if intOrStr.Type == 1 {