// Controller mocks base method
977050
func (m *MockConfig) Controller() names_v2.ControllerTag {
	ret := m.ctrl.Call(m, "Controller")
	ret0, _ := ret[0].(names_v2.ControllerTag)
	return ret0
}
690171
func (env *environ) DestroyController(ctx callcontext.ProviderCallContext, controllerUUID string) error {
	return env.withSession(ctx, func(env *sessionEnviron) error {
		return env.DestroyController(ctx, controllerUUID)
	})
}
808471
func (m *MockState) ControllerConfig() (controller.Config, error) {
	ret := m.ctrl.Call(m, "ControllerConfig")
	ret0, _ := ret[0].(controller.Config)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}
360666
func WrapController(c ControllerCommand, options ...WrapControllerOption) ControllerCommand {
	wrapper := &controllerCommandWrapper{
		ControllerCommand:    c,
		setControllerFlags:   true,
		useDefaultController: true,
	}
	for _, option := range options {
		option(wrapper)
	}
	// Define a new type so that we can embed the ModelCommand
	// interface one level deeper than cmd.Command, so that
	// we'll get the Command methods from WrapBase
	// and all the ModelCommand methods not in cmd.Command
	// from modelCommandWrapper.
	type embed struct {
		*controllerCommandWrapper
	}
	return struct {
		embed
		cmd.Command
	}{
		Command: WrapBase(wrapper),
		embed:   embed{wrapper},
	}
}
510948
func (c *Controller) Finish() {
	c.Lock()
	for _, m := range c.mockers {
		m.MinimockFinish()
	}
	c.Unlock()
}
725595
func (e *executor) Controller(t *api.Task) (exec.Controller, error) {
	// Get the node description from the executor field
	e.mutex.Lock()
	nodeDescription := e.node
	e.mutex.Unlock()
	ctlr, err := newController(e.client, nodeDescription, t, secrets.Restrict(e.secrets, t))
	if err != nil {
		return nil, err
	}

	return ctlr, nil
}
122724
func ParseControllers(data []byte) (*Controllers, error) {
	var result Controllers
	err := yaml.Unmarshal(data, &result)
	if err != nil {
		return nil, errors.Annotate(err, "cannot unmarshal yaml controllers metadata")
	}
	return &result, nil
}
114603
func (st *State) ControllerInfo() (*ControllerInfo, error) {
	session := st.session.Copy()
	defer session.Close()
	return readRawControllerInfo(session)
}
264249
func (m *Module) ControllerByName(name, action string) (ctype *ControllerType) {
	comparison := name
	if strings.Index(name, namespaceSeperator) < 0 {
		comparison = m.Namespace() + name
	}
	for _, c := range m.ControllerTypeList {
		if c.Name() == comparison {
			ctype = c
			break
		}
	}
	return
}
7950
func (e *manualEnviron) ControllerInstances(ctx context.ProviderCallContext, controllerUUID string) ([]instance.Id, error) {
	if !isRunningController() {
		// Not running inside the controller, so we must
		// verify the host.
		if err := e.verifyBootstrapHost(); err != nil {
			return nil, err
		}
	}
	return []instance.Id{BootstrapInstanceId}, nil
}
1217928
func (m *MockIndex) Func(arg0 func(http.Request) (int, bool)) {
	m.ctrl.T.Helper()
	m.ctrl.Call(m, "Func", arg0)
}
179108
func (rc *externalController) ControllerInfo() crossmodel.ControllerInfo {
	return crossmodel.ControllerInfo{
		ControllerTag: names.NewControllerTag(rc.doc.Id),
		Alias:         rc.doc.Alias,
		Addrs:         rc.doc.Addrs,
		CACert:        rc.doc.CACert,
	}
}
903959
func (c *Controller) Wait(d time.Duration) {
	wg := sync.WaitGroup{}
	wg.Add(len(c.mockers))
	for _, m := range c.mockers {
		go func(m Mocker) {
			defer wg.Done()
			m.MinimockWait(d)
		}(m)
	}

	wg.Wait()
}
879699
func (s *precheckShim) ControllerBackend() (PrecheckBackend, error) {
	return PrecheckShim(s.controllerState, s.controllerState)
}
252007
func Destroy(
	controllerName string,
	env ControllerDestroyer,
	ctx context.ProviderCallContext,
	store jujuclient.ControllerStore,
) error {
	details, err := store.ControllerByName(controllerName)
	if errors.IsNotFound(err) {
		// No controller details, nothing to do.
		return nil
	} else if err != nil {
		return errors.Trace(err)
	}
	if err := env.DestroyController(ctx, details.ControllerUUID); err != nil {
		return errors.Trace(err)
	}
	err = store.RemoveController(controllerName)
	if err != nil && !errors.IsNotFound(err) {
		return errors.Trace(err)
	}
	return nil
}
621475
func (env *environ) ControllerInstances(ctx context.ProviderCallContext, controllerUUID string) ([]instance.Id, error) {
	containers, err := env.server().AliveContainers("juju-")
	if err != nil {
		common.HandleCredentialError(IsAuthorisationFailure, err, ctx)
		return nil, errors.Trace(err)
	}

	var results []instance.Id
	for _, c := range containers {
		if c.Metadata(tags.JujuController) != controllerUUID {
			continue
		}
		if c.Metadata(tags.JujuIsController) == "true" {
			results = append(results, instance.Id(c.Name))
		}
	}
	if len(results) == 0 {
		return nil, environs.ErrNotBootstrapped
	}
	return results, nil
}
596122
func (c *ModelCommandBase) ControllerName() (string, error) {
	c.assertRunStarted()
	if err := c.maybeInitModel(); err != nil {
		return "", errors.Trace(err)
	}
	return c._controllerName, nil
}