feat: add rest routes to take the control of flink jobs

This commit is contained in:
2025-01-09 00:22:53 +03:30
parent 4dd82c6380
commit 0df874b222
14 changed files with 1019 additions and 12 deletions

View File

@@ -20,10 +20,16 @@ type Manager struct {
processingJobsIds []types.UID
}
var mgr Manager
func GetManager() Manager {
return mgr
}
func NewManager(client *api.Client, crdInstance *crd.Crd) Manager {
ticker := time.NewTicker(5 * time.Second)
quit := make(chan struct{})
mgr := Manager{
mgr = Manager{
client: client,
managedJobs: map[types.UID]managed_job.ManagedJob{},
processingJobsIds: []types.UID{},
@@ -110,3 +116,11 @@ func (mgr *Manager) cycle(client *api.Client, crdInstance *crd.Crd) {
})
}
}
func (mgr *Manager) GetJobs() map[types.UID]managed_job.ManagedJob {
return mgr.managedJobs
}
func (mgr *Manager) GetJob(id types.UID) managed_job.ManagedJob {
return mgr.managedJobs[id]
}