service

package
v0.0.0-...-b9bb202 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

type Provider interface {
	// SupportsContainerAddresses returns true if the provider is able to
	// allocate addresses for containers. It may return false or an
	// [errors.NotSupported] if container addresses are not supported.
	SupportsContainerAddresses(ctx envcontext.ProviderCallContext) (bool, error)
}

Provider represents an underlying cloud provider.

type Service

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

Service is an agent provisioner service that can be used by the provisioner to retrieve container configuration for provisioning.

func NewService

func NewService(
	st State,
	providerGetter providertracker.ProviderGetter[Provider],
) *Service

NewService returns a new agent provisioner service.

func (*Service) ContainerConfig

func (s *Service) ContainerConfig(ctx context.Context) (container.Config, error)

ContainerConfig returns the container config for the model.

func (*Service) ContainerManagerConfigForType

func (s *Service) ContainerManagerConfigForType(
	ctx context.Context,
	containerType instance.ContainerType,
) (containermanager.Config, error)

ContainerManagerConfigForType returns the container manager config for the given container type.

func (*Service) ContainerNetworkingMethod

func (s *Service) ContainerNetworkingMethod(ctx context.Context) (containermanager.NetworkingMethod, error)

ContainerNetworkingMethod determines the container networking method that should be used, based on the model config key "container-networking-method" and the current provider.

type State

type State interface {
	// GetModelConfigKeyValues returns a model config object populated with
	// values for the provided keys.
	GetModelConfigKeyValues(context.Context, ...string) (map[string]string, error)
	// ModelID returns the UUID of the current model.
	ModelID(ctx context.Context) (model.UUID, error)
}

State provides the service with access to controller/model config.

Jump to

Keyboard shortcuts

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