removing inner goroutine in cluster.Switchover and resolve race between processPodEvent and unregisterPodSubscriber

This commit is contained in:
Felix Kunde
2022-05-05 16:05:33 +02:00
parent a77d5df158
commit 3641911786
4 changed files with 28 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 convert 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 {