Skip to content

Commit

Permalink
Merge pull request lxc#503 from stgraber/cluster
Browse files Browse the repository at this point in the history
incusd/instances: Use correct project on cross-project copy
  • Loading branch information
tych0 authored Feb 17, 2024
2 parents a77ce43 + 433de09 commit d81cb32
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions cmd/incusd/instances_post.go
Original file line number Diff line number Diff line change
Expand Up @@ -1248,15 +1248,13 @@ func instanceFindStoragePool(s *state.State, projectName string, req *api.Instan
}

func clusterCopyContainerInternal(s *state.State, r *http.Request, source instance.Instance, projectName string, profiles []api.Profile, req *api.InstancesPost) response.Response {
name := req.Source.Source

// Locate the source of the container
var nodeAddress string
err := s.DB.Cluster.Transaction(context.TODO(), func(ctx context.Context, tx *db.ClusterTx) error {
var err error

// Load source node.
nodeAddress, err = tx.GetNodeAddressOfInstance(ctx, projectName, name, source.Type())
nodeAddress, err = tx.GetNodeAddressOfInstance(ctx, source.Project().Name, source.Name(), source.Type())
if err != nil {
return fmt.Errorf("Failed to get address of instance's member: %w", err)
}
Expand Down

0 comments on commit d81cb32

Please sign in to comment.