Restore existing jobs and fix rebase (7c99eff3) issues

This commit is contained in:
Maximilian Paß
2021-06-10 09:26:17 +02:00
parent 0020590c96
commit 25d78df557
23 changed files with 487 additions and 130 deletions

View File

@@ -13,10 +13,6 @@ var log = logging.GetLogger("environment")
// Manager encapsulates API calls to the executor API for creation and deletion of execution environments.
type Manager interface {
// Load fetches all already created execution environments from the executor and registers them at the runner manager.
// It should be called during the startup process (e.g. on creation of the Manager).
Load()
// CreateOrUpdate creates/updates an execution environment on the executor.
// Iff the job was created, the returned boolean is true and the returned error is nil.
CreateOrUpdate(
@@ -30,7 +26,6 @@ type Manager interface {
func NewNomadEnvironmentManager(runnerManager runner.Manager, apiClient nomad.ExecutorAPI) *NomadEnvironmentManager {
environmentManager := &NomadEnvironmentManager{runnerManager, apiClient, *parseJob(defaultJobHCL)}
environmentManager.Load()
return environmentManager
}
@@ -66,11 +61,3 @@ func (m *NomadEnvironmentManager) CreateOrUpdate(
func (m *NomadEnvironmentManager) Delete(id string) {
}
func (m *NomadEnvironmentManager) Load() {
// ToDo: remove create default execution environment for debugging purposes
_, err := m.runnerManager.CreateOrUpdateEnvironment(runner.EnvironmentID(0), 5)
if err != nil {
return
}
}