Documentation ¶
Index ¶
- type DefaultWorkerModelsV2
- type GuestCredential
- type HatcheryConfiguration
- type HatcheryVSphere
- func (h *HatcheryVSphere) ApplyConfiguration(cfg interface{}) error
- func (h *HatcheryVSphere) CanSpawn(ctx context.Context, model sdk.WorkerStarterWorkerModel, jobID string, ...) bool
- func (h *HatcheryVSphere) CheckConfiguration(cfg interface{}) error
- func (h *HatcheryVSphere) Configuration() service.HatcheryCommonConfiguration
- func (h *HatcheryVSphere) FindProvisionnedWorker(ctx context.Context, model sdk.WorkerStarterWorkerModel) (*object.VirtualMachine, error)
- func (h *HatcheryVSphere) GetDetaultModelV2Name(ctx context.Context, requirements []sdk.Requirement) string
- func (h *HatcheryVSphere) Init(config interface{}) (cdsclient.ServiceConfig, error)
- func (h *HatcheryVSphere) InitHatchery(ctx context.Context) error
- func (*HatcheryVSphere) ModelType() string
- func (h *HatcheryVSphere) NeedRegistration(ctx context.Context, m *sdk.Model) bool
- func (h *HatcheryVSphere) ProvisionWorkerV1(ctx context.Context, m sdk.Model, workerName string) error
- func (h *HatcheryVSphere) ProvisionWorkerV2(ctx context.Context, vmwareModel string, workerName string) error
- func (h *HatcheryVSphere) Serve(ctx context.Context) error
- func (h *HatcheryVSphere) Signin(ctx context.Context, clientConfig cdsclient.ServiceConfig, ...) error
- func (h *HatcheryVSphere) SpawnWorker(ctx context.Context, spawnArgs hatchery.SpawnArguments) (err error)
- func (h *HatcheryVSphere) Start(ctx context.Context) error
- func (h *HatcheryVSphere) Status(ctx context.Context) *sdk.MonitoringStatus
- func (h *HatcheryVSphere) WorkerModelSecretList(m sdk.Model) (sdk.WorkerModelSecrets, error)
- func (h *HatcheryVSphere) WorkerModelsEnabled() ([]sdk.Model, error)
- func (h *HatcheryVSphere) WorkersStarted(ctx context.Context) ([]string, error)
- type VSphereClient
- type WorkerProvisioningConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DefaultWorkerModelsV2 ¶ added in v0.55.0
type DefaultWorkerModelsV2 struct { WorkerModelV2 string `mapstructure:"workerModelV2" default:"" commented:"true" toml:"workerModelV2" json:"workerModelV2"` Binaries []string `` /* 168-byte string literal not displayed */ }
this is used to run worker model v2 in a job v1
type GuestCredential ¶ added in v0.53.0
type GuestCredential struct { // ModelPath is the CDS worker model name, it's used only by CDS Worker Model v1 ModelPath string `mapstructure:"modelPath" default:"my/model" commented:"true" toml:"modelPath" json:"-"` // ModelVMWare is the model from the VMWare point of view. It's used only by CDS Worker Model v2 ModelVMWare string `mapstructure:"modelVMWare" default:"debian12" commented:"true" toml:"modelVMWare" json:"-"` Username string `mapstructure:"username" commented:"true" toml:"username" json:"-"` Password string `mapstructure:"password" commented:"true" toml:"password" json:"-"` }
type HatcheryConfiguration ¶
type HatcheryConfiguration struct { service.HatcheryCommonConfiguration `mapstructure:"commonConfiguration" toml:"commonConfiguration" json:"commonConfiguration"` VSphereUser string `mapstructure:"user" toml:"user" default:"" commented:"false" comment:"VSphere User" json:"user"` VSphereEndpoint string `` /* 147-byte string literal not displayed */ VSpherePassword string `mapstructure:"password" toml:"password" default:"" commented:"false" comment:"VShpere Password" json:"-"` VSphereDatacenterString string `` /* 137-byte string literal not displayed */ VSphereDatastoreString string `` /* 133-byte string literal not displayed */ VSphereNetworkString string `mapstructure:"networkString" toml:"networkString" default:"" commented:"false" comment:"VShpere Network" json:"networkString"` VSphereCardName string `` /* 133-byte string literal not displayed */ IPRange string `` /* 325-byte string literal not displayed */ Gateway string `` /* 143-byte string literal not displayed */ DNS string `mapstructure:"dns" toml:"dns" default:"" commented:"false" comment:"Optional. DNS IP" json:"dns,omitempty"` SubnetMask string `mapstructure:"subnetMask" toml:"subnetMask" default:"255.255.255.0" commented:"false" comment:"Subnet Mask" json:"subnetMask"` WorkerTTL int `mapstructure:"workerTTL" toml:"workerTTL" default:"120" commented:"false" comment:"Worker TTL (minutes)" json:"workerTTL"` WorkerRegistrationTTL int `` /* 156-byte string literal not displayed */ WorkerProvisioningInterval int `` /* 175-byte string literal not displayed */ WorkerProvisioningPoolSize int `` /* 166-byte string literal not displayed */ WorkerProvisioning []WorkerProvisioningConfig `` /* 147-byte string literal not displayed */ GuestCredentials []GuestCredential `mapstructure:"guestCredentials" toml:"guestCredentials" commented:"true" comment:"List of Guest credentials" json:"-"` DefaultWorkerModelsV2 []DefaultWorkerModelsV2 `` /* 178-byte string literal not displayed */ }
HatcheryConfiguration is the configuration for hatchery
type HatcheryVSphere ¶
type HatcheryVSphere struct { hatcheryCommon.Common Config HatcheryConfiguration IpAddressesMutex sync.Mutex // contains filtered or unexported fields }
HatcheryVSphere spawns vm
func (*HatcheryVSphere) ApplyConfiguration ¶
func (h *HatcheryVSphere) ApplyConfiguration(cfg interface{}) error
ApplyConfiguration apply an object of type HatcheryConfiguration after checking it
func (*HatcheryVSphere) CanSpawn ¶
func (h *HatcheryVSphere) CanSpawn(ctx context.Context, model sdk.WorkerStarterWorkerModel, jobID string, requirements []sdk.Requirement) bool
CanSpawn return wether or not hatchery can spawn model some requirements are not supported This func is called with job v1 and job v2.
func (*HatcheryVSphere) CheckConfiguration ¶
func (h *HatcheryVSphere) CheckConfiguration(cfg interface{}) error
CheckConfiguration checks the validity of the configuration object
func (*HatcheryVSphere) Configuration ¶
func (h *HatcheryVSphere) Configuration() service.HatcheryCommonConfiguration
Configuration returns Hatchery CommonConfiguration
func (*HatcheryVSphere) FindProvisionnedWorker ¶
func (h *HatcheryVSphere) FindProvisionnedWorker(ctx context.Context, model sdk.WorkerStarterWorkerModel) (*object.VirtualMachine, error)
func (*HatcheryVSphere) GetDetaultModelV2Name ¶ added in v0.55.0
func (h *HatcheryVSphere) GetDetaultModelV2Name(ctx context.Context, requirements []sdk.Requirement) string
func (*HatcheryVSphere) Init ¶
func (h *HatcheryVSphere) Init(config interface{}) (cdsclient.ServiceConfig, error)
Init cdsclient config.
func (*HatcheryVSphere) InitHatchery ¶
func (h *HatcheryVSphere) InitHatchery(ctx context.Context) error
InitHatchery create new client for vsphere
func (*HatcheryVSphere) ModelType ¶
func (*HatcheryVSphere) ModelType() string
ModelType returns type of hatchery
func (*HatcheryVSphere) NeedRegistration ¶
NeedRegistration return true if worker model need regsitration
func (*HatcheryVSphere) ProvisionWorkerV1 ¶ added in v0.55.0
func (*HatcheryVSphere) ProvisionWorkerV2 ¶ added in v0.55.0
func (*HatcheryVSphere) Serve ¶
func (h *HatcheryVSphere) Serve(ctx context.Context) error
Serve start the hatchery server
func (*HatcheryVSphere) Signin ¶ added in v0.53.0
func (h *HatcheryVSphere) Signin(ctx context.Context, clientConfig cdsclient.ServiceConfig, srvConfig interface{}) error
func (*HatcheryVSphere) SpawnWorker ¶
func (h *HatcheryVSphere) SpawnWorker(ctx context.Context, spawnArgs hatchery.SpawnArguments) (err error)
SpawnWorker creates a new vm instance
func (*HatcheryVSphere) Start ¶
func (h *HatcheryVSphere) Start(ctx context.Context) error
Start inits client and routines for hatchery
func (*HatcheryVSphere) Status ¶
func (h *HatcheryVSphere) Status(ctx context.Context) *sdk.MonitoringStatus
Status returns sdk.MonitoringStatus, implements interface service.Service
func (*HatcheryVSphere) WorkerModelSecretList ¶
func (h *HatcheryVSphere) WorkerModelSecretList(m sdk.Model) (sdk.WorkerModelSecrets, error)
WorkerModelSecretList returns secret for given model.
func (*HatcheryVSphere) WorkerModelsEnabled ¶
func (h *HatcheryVSphere) WorkerModelsEnabled() ([]sdk.Model, error)
WorkerModelsEnabled returns Worker model enabled
func (*HatcheryVSphere) WorkersStarted ¶
func (h *HatcheryVSphere) WorkersStarted(ctx context.Context) ([]string, error)
WorkersStarted returns the list of workers started but not necessarily registered on CDS yet
type VSphereClient ¶
type VSphereClient interface { ListVirtualMachines(ctx context.Context) ([]mo.VirtualMachine, error) LoadVirtualMachine(ctx context.Context, name string) (*object.VirtualMachine, error) LoadVirtualMachineDevices(ctx context.Context, vm *object.VirtualMachine) (object.VirtualDeviceList, error) StartVirtualMachine(ctx context.Context, vm *object.VirtualMachine) error ShutdownVirtualMachine(ctx context.Context, vm *object.VirtualMachine) error DestroyVirtualMachine(ctx context.Context, vm *object.VirtualMachine) error CloneVirtualMachine(ctx context.Context, vm *object.VirtualMachine, folder *object.Folder, name string, config *types.VirtualMachineCloneSpec) (*types.ManagedObjectReference, error) GetVirtualMachinePowerState(ctx context.Context, vm *object.VirtualMachine) (types.VirtualMachinePowerState, error) NewVirtualMachine(ctx context.Context, cloneSpec *types.VirtualMachineCloneSpec, ref *types.ManagedObjectReference, vmName string) (*object.VirtualMachine, error) RenameVirtualMachine(ctx context.Context, vm *object.VirtualMachine, newName string) error MarkVirtualMachineAsTemplate(ctx context.Context, vm *object.VirtualMachine) error WaitForVirtualMachineShutdown(ctx context.Context, vm *object.VirtualMachine) error WaitForVirtualMachineIP(ctx context.Context, vm *object.VirtualMachine, IPAddress *string, vmName string) error LoadFolder(ctx context.Context) (*object.Folder, error) SetupEthernetCard(ctx context.Context, card *types.VirtualEthernetCard, ethernetCardName string, network object.NetworkReference) error LoadNetwork(ctx context.Context, name string) (object.NetworkReference, error) LoadResourcePool(ctx context.Context) (*object.ResourcePool, error) LoadDatastore(ctx context.Context, name string) (*object.Datastore, error) ProcessManager(ctx context.Context, vm *object.VirtualMachine) (*guest.ProcessManager, error) StartProgramInGuest(ctx context.Context, procman *guest.ProcessManager, req *types.StartProgramInGuest) (*types.StartProgramInGuestResponse, error) LoadVirtualMachineEvents(ctx context.Context, vm *object.VirtualMachine, eventTypes ...string) ([]types.BaseEvent, error) }
func NewVSphereClient ¶
func NewVSphereClient(vclient *govmomi.Client, datacenter string) VSphereClient
type WorkerProvisioningConfig ¶
type WorkerProvisioningConfig struct { // ModelPath is the CDS worker model name, not the model from the VMWare point of view. It's used only by CDS Worker Model v1 ModelPath string `mapstructure:"modelPath" default:"my/model" commented:"true" toml:"modelPath" json:"modelPath"` // ModelVMWare is the model from the VMWare point of view. It's used only by CDS Worker Model v2 ModelVMWare string `mapstructure:"modelVMWare" default:"debian12" commented:"true" toml:"modelVMWare" json:"modelVMWare"` // Number of VM to provision for the current model Number int `mapstructure:"number" commented:"true" toml:"number" json:"number"` }
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package mock_vsphere is a generated GoMock package.
|
Package mock_vsphere is a generated GoMock package. |