// Converts a single gomarathon Application into an api Service
func (c *MarathonConverter) convertToService(app *gomarathon.Application) *api.Service {
	service := new(api.Service)

	service.Id = (strings.Replace(app.ID, "/", ".", -1))[1:]
	service.Name = app.ID
	service.ActualState = "Deploying"
	if app.TasksRunning > 0 {
		service.ActualState = "Running"
	}

	return service
}
Пример #2
0
func (m MarathonDeployer) prepareServiceForDeployment(group string, service *api.Service) {
	var serviceName = sanitizeServiceName(service.Name)

	service.Id = fmt.Sprintf("%s.%s", group, serviceName)
	service.Name = fmt.Sprintf("/%s/%s", group, serviceName)
	service.ActualState = "deploying"
}