You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
portainer/app/react/docker/services/common/convertServiceToConfig.ts

16 lines
542 B

import { Service } from 'docker-types/generated/1.41';
import { ServiceUpdateConfig } from '../queries/useUpdateServiceMutation';
export function convertServiceToConfig(service: Service): ServiceUpdateConfig {
return {
Name: service.Spec?.Name || '',
Labels: service.Spec?.Labels || {},
TaskTemplate: service.Spec?.TaskTemplate || {},
Mode: service.Spec?.Mode || {},
UpdateConfig: service.Spec?.UpdateConfig || {},
Networks: service.Spec?.Networks || [],
EndpointSpec: service.Spec?.EndpointSpec || {},
};
}