lxd/db/images.go
func (c *Cluster) ImageAssociateNode(project, fingerprint string) error {
	imageID, _, err := c.ImageGet(project, fingerprint, false, true)
	if err != nil {
		return err
	}

	err = c.Transaction(func(tx *ClusterTx) error {
		_, err := tx.tx.Exec("INSERT INTO images_nodes(image_id, node_id) VALUES(?, ?)", imageID, c.nodeID)
		return err
	})
	return err
}
func (c *Cluster) ImageAssociateNode(project, fingerprint string) error {
	imageID, _, err := c.ImageGet(project, fingerprint, false, true)
	if err != nil {
		return err
	}

	err = c.Transaction(func(tx *ClusterTx) error {
		_, err := tx.tx.Exec("INSERT INTO images_nodes(image_id, node_id) VALUES(?, ?)", imageID, c.nodeID)
		return err
	})
	return err
}
// ImageAssociateNode creates a new entry in the images_nodes table for
// tracking that the current node has the given image.