Version: v0.0.0-...-9a03d5f Latest Latest

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

Go to latest
Published: Sep 17, 2021 License: AGPL-3.0 Imports: 22 Imported by: 3




View Source
const (
	JujudOCINamespace = "jujusolutions"
	JujudOCIName      = "jujud-operator"
	JujudbOCIName     = "juju-db"
	JujudbVersion     = "4.4"


This section is empty.


func FinishControllerPodConfig

func FinishControllerPodConfig(pcfg *ControllerPodConfig, cfg *config.Config, agentEnvironment map[string]string)

FinishControllerPodConfig sets fields on a ControllerPodConfig that can be determined by inspecting a plain config.Config and the pod constraints at the last moment before creating podspec. It assumes that the supplied Config comes from an environment that has passed through all the validation checks in the Bootstrap func, and that has set an agent-version (via finding the tools to, use for bootstrap, or otherwise).

func GetJujuOCIImagePath

func GetJujuOCIImagePath(controllerCfg controller.Config, ver version.Number, build int) (string, error)

GetJujuOCIImagePath returns the jujud oci image path.

func ImageForBase

func ImageForBase(imageRepo string, base charm.Base) (string, error)

ImageForBase returns the OCI image path for a generic base. NOTE: resource referenced bases are not resolved via ImageForBase.

func IsJujuOCIImage

func IsJujuOCIImage(imagePath string) bool

IsJujuOCIImage returns true if the image path is for a Juju operator.

func PodLabels

func PodLabels(modelUUID, controllerUUID string, tagger tags.ResourceTagger, jobs []model.MachineJob) map[string]string

PodLabels returns the minimum set of tags that should be set on a pod, if the provider supports them.

func RebuildOldOperatorImagePath

func RebuildOldOperatorImagePath(imagePath string, ver version.Number) (string, error)

RebuildOldOperatorImagePath returns a updated image path for the specified juju version.


type BootstrapConfig

type BootstrapConfig struct {

BootstrapConfig represents bootstrap-specific initialization information for a new juju caas pod. This is only relevant for the bootstrap pod.

func (*BootstrapConfig) VerifyConfig

func (cfg *BootstrapConfig) VerifyConfig() (err error)

VerifyConfig verifies that the BootstrapConfig is valid.

type ControllerConfig

type ControllerConfig struct {

ControllerConfig represents controller-specific initialization information for a new juju caas pod. This is only relevant for controller pod.

type ControllerPodConfig

type ControllerPodConfig struct {
	// Tags is a set of tags/labels to set on the Pod, if supported. This
	// should be populated using the PodLabels method in this package.
	Tags map[string]string

	// Bootstrap contains bootstrap-specific configuration. If this is set,
	// Controller must also be set.
	Bootstrap *BootstrapConfig

	// DisableSSLHostnameVerification can be set to true to tell cloud-init
	// that it shouldn't verify SSL certificates
	DisableSSLHostnameVerification bool

	// ProxySettings encapsulates all proxy-related settings used to access
	// an outside network.
	ProxySettings proxy.Settings

	// Controller contains controller-specific configuration. If this is
	// set, then the instance will be configured as a controller pod.
	Controller *ControllerConfig

	// APIInfo holds the means for the new pod to communicate with the
	// juju state API. Unless the new pod is running a controller (Controller is
	// set), there must be at least one controller address supplied.
	// The entity name must match that of the pod being started,
	// or be empty when starting a controller.
	APIInfo *api.Info

	// ControllerTag identifies the controller.
	ControllerTag names.ControllerTag

	// ControllerName is the controller name.
	ControllerName string

	// JujuVersion is the juju version.
	JujuVersion version.Number

	// OfficialBuild is the build number to use when pulling the juju oci image.
	OfficialBuild int

	// DataDir holds the directory that juju state will be put in the new
	// instance.
	DataDir string

	// LogDir holds the directory that juju logs will be written to.
	LogDir string

	// MetricsSpoolDir represents the spool directory path, where all
	// metrics are stored.
	MetricsSpoolDir string

	// ControllerId identifies the new controller.
	ControllerId string

	// AgentEnvironment defines additional configuration variables to set in
	// the pod agent config.
	AgentEnvironment map[string]string

ControllerPodConfig represents initialization information for a new juju caas controller pod.

func NewBootstrapControllerPodConfig

func NewBootstrapControllerPodConfig(
	config controller.Config,
	series string,
	bootstrapConstraints constraints.Value,
) (*ControllerPodConfig, error)

NewBootstrapControllerPodConfig sets up a basic pod configuration for a bootstrap pod. You'll still need to supply more information, but this takes care of the fixed entries and the ones that are always needed.

func NewControllerPodConfig

func NewControllerPodConfig(
	controllerTag names.ControllerTag,
	series string,
	apiInfo *api.Info,
) (*ControllerPodConfig, error)

NewControllerPodConfig sets up a basic pod configuration. You'll still need to supply more information, but this takes care of the fixed entries and the ones that are always needed.

func (*ControllerPodConfig) APIHostAddrs

func (cfg *ControllerPodConfig) APIHostAddrs() []string

APIHostAddrs returns a list of api server addresses.

func (*ControllerPodConfig) AgentConfig

func (cfg *ControllerPodConfig) AgentConfig(tag names.Tag) (agent.ConfigSetterWriter, error)

AgentConfig returns an agent config.

func (*ControllerPodConfig) GetControllerImagePath

func (cfg *ControllerPodConfig) GetControllerImagePath() (string, error)

GetControllerImagePath returns oci image path of jujud for a controller.

func (*ControllerPodConfig) GetHostedModel

func (cfg *ControllerPodConfig) GetHostedModel() (string, bool)

GetHostedModel checks if hosted model was requested to create.

func (*ControllerPodConfig) GetJujuDbOCIImagePath

func (cfg *ControllerPodConfig) GetJujuDbOCIImagePath() (string, error)

GetJujuDbOCIImagePath returns the juju-db oci image path.

func (*ControllerPodConfig) GetPodName

func (cfg *ControllerPodConfig) GetPodName() string

GetPodName returns pod name.

func (*ControllerPodConfig) VerifyConfig

func (cfg *ControllerPodConfig) VerifyConfig() (err error)

VerifyConfig verifies that the ControllerPodConfig is valid.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL