support optional server fields
This commit is contained in:
@@ -139,11 +139,12 @@ fn remove_frontend_by_bind_address(haproxy: &mut HAProxy, bind_address: &str) ->
|
||||
}
|
||||
|
||||
fn remove_backend(haproxy: &mut HAProxy, old_frontend: Frontend) -> Option<HAProxyBackend> {
|
||||
let default_backend = old_frontend.default_backend?;
|
||||
let pos = haproxy
|
||||
.backends
|
||||
.backends
|
||||
.iter()
|
||||
.position(|b| b.uuid == old_frontend.default_backend);
|
||||
.position(|b| b.uuid == default_backend);
|
||||
|
||||
match pos {
|
||||
Some(pos) => Some(haproxy.backends.backends.remove(pos)),
|
||||
|
||||
Reference in New Issue
Block a user