mirror of https://github.com/portainer/portainer
20 lines
513 B
Go
20 lines
513 B
Go
package edge
|
|
|
|
import portainer "github.com/portainer/portainer/api"
|
|
|
|
// LoadEdgeJobs registers all edge jobs inside corresponding environment(endpoint) tunnel
|
|
func LoadEdgeJobs(dataStore portainer.DataStore, reverseTunnelService portainer.ReverseTunnelService) error {
|
|
edgeJobs, err := dataStore.EdgeJob().EdgeJobs()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
for _, edgeJob := range edgeJobs {
|
|
for endpointID := range edgeJob.Endpoints {
|
|
reverseTunnelService.AddEdgeJob(endpointID, &edgeJob)
|
|
}
|
|
}
|
|
|
|
return nil
|
|
}
|