mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-10-06 20:52:03 +02:00
add unit test and documentation for finalizers (#2509)
* add unit test and documentation for finalizers * error msg with lower case and cover sync case * try to avoid adding json-patch dependency * use Update to remove finalizer * changing status and finalizer during create * do not call Delete() twice
This commit is contained in:
@@ -152,6 +152,17 @@ func IsEqualIgnoreOrder(a, b []string) bool {
|
||||
return reflect.DeepEqual(a_copy, b_copy)
|
||||
}
|
||||
|
||||
// Iterate through slice and remove certain string, then return cleaned slice
|
||||
func RemoveString(slice []string, s string) (result []string) {
|
||||
for _, item := range slice {
|
||||
if item == s {
|
||||
continue
|
||||
}
|
||||
result = append(result, item)
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
// SliceReplaceElement
|
||||
func StringSliceReplaceElement(s []string, a, b string) (result []string) {
|
||||
tmp := make([]string, 0, len(s))
|
||||
|
||||
Reference in New Issue
Block a user