Moving operator code to a designated folder so that webhook work can also be included in this repo

This commit is contained in:
jillianwilson
2021-09-28 15:07:19 -03:00
parent d807e92c36
commit f974d3f398
50 changed files with 283 additions and 288 deletions

View File

@@ -0,0 +1,33 @@
package utils
import (
"strconv"
"strings"
)
func ContainsString(slice []string, s string) bool {
for _, item := range slice {
if item == s {
return true
}
}
return false
}
func RemoveString(slice []string, s string) (result []string) {
for _, item := range slice {
if item == s {
continue
}
result = append(result, item)
}
return
}
func StringToBool(str string) (bool, error) {
restartDeploymentBool, err := strconv.ParseBool(strings.ToLower(str))
if err != nil {
return false, err
}
return restartDeploymentBool, nil
}