Documentation
¶
Index ¶
- Variables
- func Register(kind Kind, create CreateFn) error
- func RegisterEvChan(name Name, get GetEventChanFn, cb EventCbFn) error
- func UnRegisterEvChan(name Name)
- type CreateFn
- type EventCbFn
- type Executor
- type ExecutorWholeConfigs
- func (c *ExecutorWholeConfigs) EnableLabelSchedule() bool
- func (c *ExecutorWholeConfigs) EnableOrgLabelSchedule() bool
- func (c *ExecutorWholeConfigs) EnableWorkspaceLabelSchedule() bool
- func (c *ExecutorWholeConfigs) OrgOpt(org string) *OrgOpt
- func (c *ExecutorWholeConfigs) ProdJobAvailDest() ([]string, bool)
- func (c *ExecutorWholeConfigs) ProjectIDForCompatibility(projectID string) bool
- func (c *ExecutorWholeConfigs) StagingJobAvailDest() ([]string, bool)
- func (c *ExecutorWholeConfigs) WORKSPACETAGSForCompatibility() (string, bool)
- type GetEventChanFn
- type Kind
- type Name
- type NodeLabelSetting
- type OrgOpt
- type StopEventsChans
- type TerminalExecutor
- type WorkspaceOpt
Constants ¶
This section is empty.
Variables ¶
var EvCbMap = map[Name]EventCbFn{}
var EvFuncMap = map[Name]GetEventChanFn{}
var Factory = map[Kind]CreateFn{}
Functions ¶
func RegisterEvChan ¶
func RegisterEvChan(name Name, get GetEventChanFn, cb EventCbFn) error
Get a GetEventChanFn according to an executor's name
func UnRegisterEvChan ¶
func UnRegisterEvChan(name Name)
Types ¶
type CreateFn ¶
type CreateFn func(name Name, clustername string, options map[string]string, moreoptions interface{}) (Executor, error)
Create be used to create a executor instance.
type EventCbFn ¶
type EventCbFn func(k string, v interface{}, t storetypes.ChangeType) error
type Executor ¶
type Executor interface { Kind() Kind Name() Name CleanUpBeforeDelete() Create(ctx context.Context, spec interface{}) (interface{}, error) Destroy(ctx context.Context, spec interface{}) error Status(ctx context.Context, spec interface{}) (apistructs.StatusDesc, error) Remove(ctx context.Context, spec interface{}) error Update(ctx context.Context, spec interface{}) (interface{}, error) Inspect(ctx context.Context, spec interface{}) (interface{}, error) Cancel(ctx context.Context, spec interface{}) (interface{}, error) Precheck(ctx context.Context, spec interface{}) (apistructs.ServiceGroupPrecheckData, error) // only k8s-job executor supported JobVolumeCreate(ctx context.Context, spec interface{}) (string, error) // SetNodeLabels set schedule-labels on nodes // Only k8s, k8sjob, marathon, metronome executor implement this function SetNodeLabels(setting NodeLabelSetting, hosts []string, labels map[string]string) error // executor's capacity // 1. addonoperator CapacityInfo() apistructs.CapacityInfoData ResourceInfo(brief bool) (apistructs.ClusterResourceInfoData, error) // only k8s executor supported KillPod(podname string) error }
Executor defines the all interfaces that must be implemented by a executor instance.
type ExecutorWholeConfigs ¶
type ExecutorWholeConfigs struct { // Common cluster configuration BasicConfig map[string]string // Accurate cluster configuration PlusConfigs *conf.OptPlus }
func (*ExecutorWholeConfigs) EnableLabelSchedule ¶
func (c *ExecutorWholeConfigs) EnableLabelSchedule() bool
EnableLabelSchedule Whether tag scheduling is turned on
func (*ExecutorWholeConfigs) EnableOrgLabelSchedule ¶
func (c *ExecutorWholeConfigs) EnableOrgLabelSchedule() bool
EnableOrgLabelSchedule Whether to enable org-level label scheduling
func (*ExecutorWholeConfigs) EnableWorkspaceLabelSchedule ¶
func (c *ExecutorWholeConfigs) EnableWorkspaceLabelSchedule() bool
EnableWorkspaceLabelSchedule Whether to enable label scheduling at the workspace level
func (*ExecutorWholeConfigs) OrgOpt ¶
func (c *ExecutorWholeConfigs) OrgOpt(org string) *OrgOpt
OrgOpt Take out the configuration of `org' from all configurations
func (*ExecutorWholeConfigs) ProdJobAvailDest ¶
func (c *ExecutorWholeConfigs) ProdJobAvailDest() ([]string, bool)
ProdJobAvailDest prod environment where job can run
func (*ExecutorWholeConfigs) ProjectIDForCompatibility ¶
func (c *ExecutorWholeConfigs) ProjectIDForCompatibility(projectID string) bool
ProjectIDForCompatibility Isolate the configuration used by the project when scheduling, and no longer use it DEPRECATED
func (*ExecutorWholeConfigs) StagingJobAvailDest ¶
func (c *ExecutorWholeConfigs) StagingJobAvailDest() ([]string, bool)
StagingJobAvailDest staging environment where job can run
func (*ExecutorWholeConfigs) WORKSPACETAGSForCompatibility ¶
func (c *ExecutorWholeConfigs) WORKSPACETAGSForCompatibility() (string, bool)
WORKSPACETAGSForCompatibility Compatible with old WORKSPACETAGS tags DEPRECATED
type GetEventChanFn ¶
type GetEventChanFn func(Name) (chan *eventtypes.StatusEvent, chan struct{}, *sync.Map, error)
return executor's event channel according to executor's name
type NodeLabelSetting ¶
type NodeLabelSetting struct {
SoldierURL string
}
type OrgOpt ¶
OrgOpt org level configuration
func (*OrgOpt) WorkspaceOpt ¶
func (c *OrgOpt) WorkspaceOpt(workspace string) *WorkspaceOpt
WorkspaceOpt Take out the configuration of `workspace' from the org configuration
type StopEventsChans ¶
type StopEventsChans struct { StopWatchEventCh chan struct{} StopHandleEventCh chan struct{} }
type TerminalExecutor ¶
type WorkspaceOpt ¶
WorkspaceOpt workspace level configuration
func (*WorkspaceOpt) EnableWorkspaceLabelSchedule ¶
func (c *WorkspaceOpt) EnableWorkspaceLabelSchedule() bool
EnableWorkspaceLabelSchedule Whether to enable workspace label scheduling
func (*WorkspaceOpt) ProdJobAvailDest ¶
func (c *WorkspaceOpt) ProdJobAvailDest() ([]string, bool)
ProdJobAvailDest Environment where prod job can run
func (*WorkspaceOpt) StagingJobAvailDest ¶
func (c *WorkspaceOpt) StagingJobAvailDest() ([]string, bool)
StagingJobAvailDest Environment where staging job can run