Skip to content

Commit

Permalink
lxd/operations: Forward to right cluster node
Browse files Browse the repository at this point in the history
Closes #4721

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
  • Loading branch information
stgraber committed Jul 6, 2018
1 parent 3a341e9 commit 024c71f
Show file tree
Hide file tree
Showing 2 changed files with 247 additions and 52 deletions.
6 changes: 6 additions & 0 deletions lxd/db/operations.go
Expand Up @@ -22,6 +22,12 @@ func (c *ClusterTx) OperationsUUIDs() ([]string, error) {
return query.SelectStrings(c.tx, stmt, c.nodeID)
}

// OperationNodes returns a list of nodes that have running operations
func (c *ClusterTx) OperationNodes() ([]string, error) {
stmt := "SELECT DISTINCT nodes.address FROM operations JOIN nodes ON nodes.id = node_id"
return query.SelectStrings(c.tx, stmt)
}

// OperationByUUID returns the operation with the given UUID.
func (c *ClusterTx) OperationByUUID(uuid string) (Operation, error) {
null := Operation{}
Expand Down

0 comments on commit 024c71f

Please sign in to comment.