Update system connection add & remove

Add new --farm flag to podman system connection add so that
a user can add a new connection to a farm immediately.
Update system connection remove such that when a connection is
removed, the connection is also removed from any farms that have it.
Add docs and tests for these changes.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
This commit is contained in:
Urvashi Mohnani
2023-07-26 09:48:59 -04:00
parent 310f971fcf
commit bcebcad1fd
4 changed files with 155 additions and 0 deletions

View File

@ -167,6 +167,17 @@ func StringMatchRegexSlice(s string, re []string) bool {
return false
}
// IndexOfStringInSlice returns the index if a string is in a slice, otherwise
// it returns -1 if the string is not found
func IndexOfStringInSlice(s string, sl []string) int {
for i := range sl {
if sl[i] == s {
return i
}
}
return -1
}
// ParseSignal parses and validates a signal name or number.
func ParseSignal(rawSignal string) (syscall.Signal, error) {
// Strip off leading dash, to allow -1 or -HUP