caasapplicationprovisioner

package
v0.0.0-...-9ec3720 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2021 License: AGPL-3.0 Imports: 38 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CharmStorageParams

func CharmStorageParams(
	controllerUUID string,
	storageClassName string,
	modelCfg *config.Config,
	poolName string,
	poolManager poolmanager.PoolManager,
	registry storage.ProviderRegistry,
) (*params.KubernetesFilesystemParams, error)

CharmStorageParams returns filesystem parameters needed to provision storage used for a charm operator or workload.

Types

type API

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

func NewCAASApplicationProvisionerAPI

func NewCAASApplicationProvisionerAPI(
	ctrlSt CAASApplicationControllerState,
	st CAASApplicationProvisionerState,
	resources facade.Resources,
	newResourceOpener NewResourceOpenerFunc,
	authorizer facade.Authorizer,
	sb StorageBackend,
	storagePoolManager poolmanager.PoolManager,
	registry storage.ProviderRegistry,
	clock clock.Clock,
) (*API, error)

NewCAASApplicationProvisionerAPI returns a new CAAS operator provisioner API facade.

func (*API) ApplicationCharmURLs

func (a *API) ApplicationCharmURLs(args params.Entities) (params.StringResults, error)

ApplicationCharmURLs finds the CharmURL for an application.

func (*API) ApplicationOCIResources

func (a *API) ApplicationOCIResources(args params.Entities) (params.CAASApplicationOCIResourceResults, error)

ApplicationOCIResources returns the OCI image resources for an application.

func (*API) CAASApplicationGarbageCollect

func (a *API) CAASApplicationGarbageCollect(args params.CAASApplicationGarbageCollectArgs) (params.ErrorResults, error)

CAASApplicationGarbageCollect cleans up units that have gone away permanently. Only observed units will be deleted as new units could have surfaced between the capturing of kuberentes pod state/application state and this call.

func (*API) ProvisioningInfo

ProvisioningInfo returns the info needed to provision a caas application.

func (*API) SetOperatorStatus

func (a *API) SetOperatorStatus(args params.SetStatus) (params.ErrorResults, error)

SetOperatorStatus sets the status of each given entity.

func (*API) Units

func (a *API) Units(args params.Entities) (params.EntitiesResults, error)

Units returns all the units for each application specified.

func (*API) UpdateApplicationsUnits

func (a *API) UpdateApplicationsUnits(args params.UpdateApplicationUnitArgs) (params.UpdateApplicationUnitResults, error)

UpdateApplicationsUnits updates the Juju data model to reflect the given units of the specified application.

type APIGroup

func NewStateCAASApplicationProvisionerAPI

func NewStateCAASApplicationProvisionerAPI(ctx facade.Context) (*APIGroup, error)

NewStateCAASApplicationProvisionerAPI provides the signature required for facade registration.

type Application

type Application interface {
	Charm() (ch Charm, force bool, err error)
	SetOperatorStatus(status.StatusInfo) error
	AllUnits() ([]Unit, error)
	UpdateUnits(unitsOp *state.UpdateUnitsOperation) error
	StorageConstraints() (map[string]state.StorageConstraints, error)
	DeviceConstraints() (map[string]state.DeviceConstraints, error)
	Name() string
	Constraints() (constraints.Value, error)
	Life() state.Life
	Series() string
	SetStatus(statusInfo status.StatusInfo) error
	CharmModifiedVersion() int
	CharmURL() (curl *charm.URL, force bool)
}

type CAASApplicationControllerState

type CAASApplicationControllerState interface {
	ControllerConfig() (controller.Config, error)
	Addresses() ([]string, error)
	ModelUUID() string
	APIHostPortsForAgents() ([]network.SpaceHostPorts, error)
	WatchAPIHostPortsForAgents() state.NotifyWatcher
}

CAASApplicationProvisionerState provides the subset of controller state required by the CAAS operator provisioner facade.

type CAASApplicationProvisionerState

type CAASApplicationProvisionerState interface {
	Model() (Model, error)
	Application(string) (Application, error)
	ResolveConstraints(cons constraints.Value) (constraints.Value, error)
	Resources() (Resources, error)
}

CAASApplicationProvisionerState provides the subset of model state required by the CAAS operator provisioner facade.

type Charm

type Charm interface {
	Meta() *charm.Meta
	URL() *charm.URL
}

type Model

type Model interface {
	UUID() string
	ModelConfig() (*config.Config, error)
	Containers(providerIds ...string) ([]state.CloudContainer, error)
}

type NewResourceOpenerFunc

type NewResourceOpenerFunc func(appName string) (resource.Opener, error)

type Resources

type Resources interface {
	OpenResource(applicationID string, name string) (resource.Resource, io.ReadCloser, error)
}

type StorageBackend

type StorageBackend interface {
	StorageInstance(names.StorageTag) (state.StorageInstance, error)
	Filesystem(names.FilesystemTag) (state.Filesystem, error)
	StorageInstanceFilesystem(names.StorageTag) (state.Filesystem, error)
	UnitStorageAttachments(unit names.UnitTag) ([]state.StorageAttachment, error)
	SetFilesystemInfo(names.FilesystemTag, state.FilesystemInfo) error
	SetFilesystemAttachmentInfo(names.Tag, names.FilesystemTag, state.FilesystemAttachmentInfo) error
	Volume(tag names.VolumeTag) (state.Volume, error)
	StorageInstanceVolume(tag names.StorageTag) (state.Volume, error)
	SetVolumeInfo(names.VolumeTag, state.VolumeInfo) error
	SetVolumeAttachmentInfo(names.Tag, names.VolumeTag, state.VolumeAttachmentInfo) error

	// These are for cleanup up orphaned filesystems when pods are recreated.
	// TODO(caas) - record unit id on the filesystem so we can query by unit
	AllFilesystems() ([]state.Filesystem, error)
	DestroyStorageInstance(tag names.StorageTag, destroyAttachments bool, force bool, maxWait time.Duration) (err error)
	DestroyFilesystem(tag names.FilesystemTag, force bool) (err error)
}

StorageBackend provides the subset of backend storage functionality required by the CAAS app provisioner facade.

type Unit

type Unit interface {
	Tag() names.Tag
	DestroyOperation() *state.DestroyUnitOperation
	EnsureDead() error
	ContainerInfo() (state.CloudContainer, error)
	UpdateOperation(props state.UnitUpdateProperties) *state.UpdateUnitOperation
}

Jump to

Keyboard shortcuts

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