2018-06-19 11:15:10 +00:00
|
|
|
package migrator
|
2018-04-26 16:08:46 +00:00
|
|
|
|
2019-03-21 01:20:14 +00:00
|
|
|
import "github.com/portainer/portainer/api"
|
2018-04-26 16:08:46 +00:00
|
|
|
|
|
|
|
func (m *Migrator) updateEndpointsToVersion9() error {
|
2018-06-19 11:15:10 +00:00
|
|
|
legacyEndpoints, err := m.endpointService.Endpoints()
|
2018-04-26 16:08:46 +00:00
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
for _, endpoint := range legacyEndpoints {
|
|
|
|
endpoint.GroupID = portainer.EndpointGroupID(1)
|
2018-06-19 11:15:10 +00:00
|
|
|
err = m.endpointService.UpdateEndpoint(endpoint.ID, &endpoint)
|
2018-04-26 16:08:46 +00:00
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|