You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: bundle.go
    path of file: ./repos/juju/cmd/juju/application/deployer
    
    the code of the file until where you have to start completion: // Copyright 2020 Canonical Ltd.
// Licensed under the AGPLv3, see LICENCE file for details.

package deployer

import (
	"fmt"
	"strings"

	"github.com/juju/charm/v12"
	"github.com/juju/cmd/v3"
	"github.com/juju/collections/set"
	"github.com/juju/errors"

	com
    
func (d *deployBundle) makeBundleDeploySpec(ctx *cmd.Context, apiRoot DeployerAPI) (bundleDeploySpec, error) {
	// set the consumer details API factory method on the spec, so it makes it
	// possible to communicate with other controllers, that are found within
	// the local cache.
	// If no controller is found within the local cache, an error will be raised
	// which should ask the user to login.
	getConsumeDetails := func(url *charm.OfferURL) (ConsumeDetails, error) {
		// Ensure that we have a url source when querying the controller.
		if url.Source == "" {
			url.Source = d.controllerName
		}
		return d.newConsumeDetailsAPI(url)
	}

	knownSpaces, err := apiRoot.ListSpaces()
	if err != nil && !errors.IsNotSupported(err) {
		return bundleDeploySpec{}, errors.Trace(err)
	}

	knownSpaceNames := set.NewStrings()
	for _, space := range knownSpaces {
		knownSpaceNames.Add(space.Name)
	}

	return bundleDeploySpec{
		ctx:                  ctx,
		filesystem:           d.model.Filesystem(),
		dryRun:               d.dryRun,
		force:                d.force,
		trust:                d.trust,
		bundleDataSource:     d.bundleDataSource,
		bundleDir:            d.bundleDir,
		bundleURL:            d.bundleURL,
		bundleOverlayFile:    d.bundleOverlayFile,
		origin:               d.origin,
		modelConstraints:     d.modelConstraints,
		deployAPI:            apiRoot,
		bundleResolver:       d.resolver,
		getConsumeDetailsAPI: getConsumeDetails,
		deployResources:      d.deployResources,
		useExistingMachines:  d.useExistingMachines,
		bundleMachines:       d.bundleMachines,
		bundleStorage:        d.bundleStorage,
		bundleDevices:        d.bundleDevices,
		targetModelName:      d.targetModelName,
		targetModelUUID:      d.targetModelUUID,
		controllerName:       d.controllerName,
		accountUser:          d.accountUser,
		knownSpaceNames:      knownSpaceNames,
	}, nil
}