upgrader

package
v0.0.0-...-23dbee4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 29, 2024 License: AGPL-3.0 Imports: 24 Imported by: 1

Documentation

Overview

Package upgrader is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(registry facade.FacadeRegistry)

Register is called to expose a package of facades onto a given registry.

Types

type ControllerConfigGetter

type ControllerConfigGetter interface {
	ControllerConfig(context.Context) (controller.Config, error)
}

ControllerConfigGetter defines a method for getting the controller config.

type MockModelAgentService

type MockModelAgentService struct {
	// contains filtered or unexported fields
}

MockModelAgentService is a mock of ModelAgentService interface.

func NewMockModelAgentService

func NewMockModelAgentService(ctrl *gomock.Controller) *MockModelAgentService

NewMockModelAgentService creates a new mock instance.

func (*MockModelAgentService) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockModelAgentService) GetMachineTargetAgentVersion

func (m *MockModelAgentService) GetMachineTargetAgentVersion(arg0 context.Context, arg1 machine.Name) (version.Number, error)

GetMachineTargetAgentVersion mocks base method.

func (*MockModelAgentService) GetModelTargetAgentVersion

func (m *MockModelAgentService) GetModelTargetAgentVersion(arg0 context.Context) (version.Number, error)

GetModelTargetAgentVersion mocks base method.

func (*MockModelAgentService) GetUnitTargetAgentVersion

func (m *MockModelAgentService) GetUnitTargetAgentVersion(arg0 context.Context, arg1 string) (version.Number, error)

GetUnitTargetAgentVersion mocks base method.

func (*MockModelAgentService) WatchMachineTargetAgentVersion

func (m *MockModelAgentService) WatchMachineTargetAgentVersion(arg0 context.Context, arg1 machine.Name) (watcher.Watcher[struct{}], error)

WatchMachineTargetAgentVersion mocks base method.

func (*MockModelAgentService) WatchModelTargetAgentVersion

func (m *MockModelAgentService) WatchModelTargetAgentVersion(arg0 context.Context) (watcher.Watcher[struct{}], error)

WatchModelTargetAgentVersion mocks base method.

func (*MockModelAgentService) WatchUnitTargetAgentVersion

func (m *MockModelAgentService) WatchUnitTargetAgentVersion(arg0 context.Context, arg1 string) (watcher.Watcher[struct{}], error)

WatchUnitTargetAgentVersion mocks base method.

type MockModelAgentServiceGetMachineTargetAgentVersionCall

type MockModelAgentServiceGetMachineTargetAgentVersionCall struct {
	*gomock.Call
}

MockModelAgentServiceGetMachineTargetAgentVersionCall wrap *gomock.Call

func (*MockModelAgentServiceGetMachineTargetAgentVersionCall) Do

Do rewrite *gomock.Call.Do

func (*MockModelAgentServiceGetMachineTargetAgentVersionCall) DoAndReturn

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*MockModelAgentServiceGetMachineTargetAgentVersionCall) Return

Return rewrite *gomock.Call.Return

type MockModelAgentServiceGetModelTargetAgentVersionCall

type MockModelAgentServiceGetModelTargetAgentVersionCall struct {
	*gomock.Call
}

MockModelAgentServiceGetModelTargetAgentVersionCall wrap *gomock.Call

func (*MockModelAgentServiceGetModelTargetAgentVersionCall) Do

Do rewrite *gomock.Call.Do

func (*MockModelAgentServiceGetModelTargetAgentVersionCall) DoAndReturn

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*MockModelAgentServiceGetModelTargetAgentVersionCall) Return

Return rewrite *gomock.Call.Return

type MockModelAgentServiceGetUnitTargetAgentVersionCall

type MockModelAgentServiceGetUnitTargetAgentVersionCall struct {
	*gomock.Call
}

MockModelAgentServiceGetUnitTargetAgentVersionCall wrap *gomock.Call

func (*MockModelAgentServiceGetUnitTargetAgentVersionCall) Do

Do rewrite *gomock.Call.Do

func (*MockModelAgentServiceGetUnitTargetAgentVersionCall) DoAndReturn

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*MockModelAgentServiceGetUnitTargetAgentVersionCall) Return

Return rewrite *gomock.Call.Return

type MockModelAgentServiceMockRecorder

type MockModelAgentServiceMockRecorder struct {
	// contains filtered or unexported fields
}

MockModelAgentServiceMockRecorder is the mock recorder for MockModelAgentService.

func (*MockModelAgentServiceMockRecorder) GetMachineTargetAgentVersion

GetMachineTargetAgentVersion indicates an expected call of GetMachineTargetAgentVersion.

func (*MockModelAgentServiceMockRecorder) GetModelTargetAgentVersion

GetModelTargetAgentVersion indicates an expected call of GetModelTargetAgentVersion.

func (*MockModelAgentServiceMockRecorder) GetUnitTargetAgentVersion

GetUnitTargetAgentVersion indicates an expected call of GetUnitTargetAgentVersion.

func (*MockModelAgentServiceMockRecorder) WatchMachineTargetAgentVersion

WatchMachineTargetAgentVersion indicates an expected call of WatchMachineTargetAgentVersion.

func (*MockModelAgentServiceMockRecorder) WatchModelTargetAgentVersion

WatchModelTargetAgentVersion indicates an expected call of WatchModelTargetAgentVersion.

func (*MockModelAgentServiceMockRecorder) WatchUnitTargetAgentVersion

WatchUnitTargetAgentVersion indicates an expected call of WatchUnitTargetAgentVersion.

type MockModelAgentServiceWatchMachineTargetAgentVersionCall

type MockModelAgentServiceWatchMachineTargetAgentVersionCall struct {
	*gomock.Call
}

MockModelAgentServiceWatchMachineTargetAgentVersionCall wrap *gomock.Call

func (*MockModelAgentServiceWatchMachineTargetAgentVersionCall) Do

Do rewrite *gomock.Call.Do

func (*MockModelAgentServiceWatchMachineTargetAgentVersionCall) DoAndReturn

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*MockModelAgentServiceWatchMachineTargetAgentVersionCall) Return

Return rewrite *gomock.Call.Return

type MockModelAgentServiceWatchModelTargetAgentVersionCall

type MockModelAgentServiceWatchModelTargetAgentVersionCall struct {
	*gomock.Call
}

MockModelAgentServiceWatchModelTargetAgentVersionCall wrap *gomock.Call

func (*MockModelAgentServiceWatchModelTargetAgentVersionCall) Do

Do rewrite *gomock.Call.Do

func (*MockModelAgentServiceWatchModelTargetAgentVersionCall) DoAndReturn

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*MockModelAgentServiceWatchModelTargetAgentVersionCall) Return

Return rewrite *gomock.Call.Return

type MockModelAgentServiceWatchUnitTargetAgentVersionCall

type MockModelAgentServiceWatchUnitTargetAgentVersionCall struct {
	*gomock.Call
}

MockModelAgentServiceWatchUnitTargetAgentVersionCall wrap *gomock.Call

func (*MockModelAgentServiceWatchUnitTargetAgentVersionCall) Do

Do rewrite *gomock.Call.Do

func (*MockModelAgentServiceWatchUnitTargetAgentVersionCall) DoAndReturn

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*MockModelAgentServiceWatchUnitTargetAgentVersionCall) Return

Return rewrite *gomock.Call.Return

type ModelAgentService

type ModelAgentService interface {
	// GetMachineTargetAgentVersion reports the target agent version that should
	// be being run on the provided machine identified by name. The following
	// errors are possible:
	// - [github.com/juju/juju/domain/machine/errors.MachineNotFound]
	// - [github.com/juju/juju/domain/model/errors.NotFound]
	GetMachineTargetAgentVersion(context.Context, machine.Name) (version.Number, error)

	// GetModelTargetAgentVersion returns the target agent version for the
	// entire model. The following errors can be returned:
	// - [github.com/juju/juju/domain/model/errors.NotFound] - When the model does
	// not exist.
	GetModelTargetAgentVersion(context.Context) (version.Number, error)

	// GetUnitTargetAgentVersion reports the target agent version that should be
	// being run on the provided unit identified by name. The following errors
	// are possible:
	// - [github.com/juju/juju/domain/application/errors.UnitNotFound] - When
	// the unit in question does not exist.
	// - [github.com/juju/juju/domain/model/errors.NotFound] - When the model
	// the unit belongs to no longer exists.
	GetUnitTargetAgentVersion(context.Context, string) (version.Number, error)

	// WatchMachineTargetAgentVersion is responsible for watching the target agent
	// version for machine and reporting when there has been a change via a
	// [watcher.NotifyWatcher]. The following errors can be expected:
	// - [machineerrors.NotFound] - When no machine exists for the provided name.
	// - [modelerrors.NotFound] - When the model of the machine no longer exists.
	WatchMachineTargetAgentVersion(ctx context.Context, machineName machine.Name) (watcher.NotifyWatcher, error)

	// WatchModelTargetAgentVersion is responsible for watching the target agent
	// version of this model and reporting when a change has happened in the
	// version.
	WatchModelTargetAgentVersion(ctx context.Context) (watcher.NotifyWatcher, error)

	// WatchUnitTargetAgentVersion is responsible for watching the target agent
	// version for unit and reporting when there has been a change via a
	// [watcher.NotifyWatcher]. The following errors can be expected:
	// - [applicationerrors.UnitNotFound] - When no unit exists for the provided name.
	// - [modelerrors.NotFound] - When the model of the unit no longer exists.
	WatchUnitTargetAgentVersion(ctx context.Context, unitName string) (watcher.NotifyWatcher, error)
}

ModelAgentService provides access to the Juju agent version for the model.

type UnitUpgraderAPI

type UnitUpgraderAPI struct {
	*common.ToolsSetter
	// contains filtered or unexported fields
}

UnitUpgraderAPI provides access to the UnitUpgrader API facade.

func NewUnitUpgraderAPI

func NewUnitUpgraderAPI(
	ctx facade.ModelContext,
	modelAgentService ModelAgentService,
	watcherRegistry facade.WatcherRegistry,
) (*UnitUpgraderAPI, error)

NewUnitUpgraderAPI creates a new server-side UnitUpgraderAPI facade.

func (*UnitUpgraderAPI) DesiredVersion

func (u *UnitUpgraderAPI) DesiredVersion(ctx context.Context, args params.Entities) (params.VersionResults, error)

DesiredVersion reports the Agent Version that we want that unit to be running. The desired version is what the unit's assigned machine is running.

func (*UnitUpgraderAPI) Tools

Tools finds the tools necessary for the given agents.

func (*UnitUpgraderAPI) WatchAPIVersion

func (u *UnitUpgraderAPI) WatchAPIVersion(ctx context.Context, args params.Entities) (params.NotifyWatchResults, error)

WatchAPIVersion starts a watcher to track if there is a new version of the API that we want to upgrade the unit agent to.

type Upgrader

type Upgrader interface {
	WatchAPIVersion(ctx context.Context, args params.Entities) (params.NotifyWatchResults, error)
	DesiredVersion(ctx context.Context, args params.Entities) (params.VersionResults, error)
	Tools(ctx context.Context, args params.Entities) (params.ToolsResults, error)
	SetTools(ctx context.Context, args params.EntitiesVersion) (params.ErrorResults, error)
}

type UpgraderAPI

type UpgraderAPI struct {
	*common.ToolsGetter
	*common.ToolsSetter
	// contains filtered or unexported fields
}

UpgraderAPI provides access to the Upgrader API facade.

func NewUpgraderAPI

func NewUpgraderAPI(
	controllerConfigGetter ControllerConfigGetter,
	ctrlSt *state.State,
	st *state.State,
	authorizer facade.Authorizer,
	logger corelogger.Logger,
	cloudService common.CloudService,
	credentialService common.CredentialService,
	modelConfigService common.ModelConfigService,
	modelAgentService ModelAgentService,
	controllerStore objectstore.ObjectStore,
	watcherRegistry facade.WatcherRegistry,
) (*UpgraderAPI, error)

NewUpgraderAPI creates a new server-side UpgraderAPI facade.

func (*UpgraderAPI) DesiredVersion

func (u *UpgraderAPI) DesiredVersion(ctx context.Context, args params.Entities) (params.VersionResults, error)

DesiredVersion reports the Agent Version that we want that agent to be running

func (*UpgraderAPI) WatchAPIVersion

func (u *UpgraderAPI) WatchAPIVersion(ctx context.Context, args params.Entities) (params.NotifyWatchResults, error)

WatchAPIVersion starts a watcher to track if there is a new version of the API that we want to upgrade an application, machine, model or unit to.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL