haConfig returns the HAConfig for an engine.
()
| 201 | |
| 202 | // haConfig returns the HAConfig for an engine. |
| 203 | func (e *Engine) haConfig() (*seesaw.HAConfig, error) { |
| 204 | n, err := e.thisNode() |
| 205 | if err != nil { |
| 206 | return nil, err |
| 207 | } |
| 208 | // TODO(jsing): This does not allow for IPv6-only operation. |
| 209 | return &seesaw.HAConfig{ |
| 210 | Enabled: n.State != spb.HaState_DISABLED, |
| 211 | LocalAddr: e.config.Node.IPv4Addr, |
| 212 | RemoteAddr: e.config.VRRPDestIP, |
| 213 | Priority: n.Priority, |
| 214 | VRID: e.config.VRID, |
| 215 | }, nil |
| 216 | } |
| 217 | |
| 218 | // thisNode returns the Node for the machine on which this engine is running. |
| 219 | func (e *Engine) thisNode() (*seesaw.Node, error) { |
no test coverage detected