private DefaultServicesTypeService GetDefaultServiceTypeEntry( string namePrefix, ComposeServiceTypeDescription serviceTypeDescription) { // // In order to avoid dns name collisions between services of 2 different applications, service dns names be subdomains // under the application name. // var defaultServiceType = new DefaultServicesTypeService { Name = namePrefix, ServiceDnsName = this.generateDnsNames ? DockerComposeUtils.GetServiceDnsName(this.applicationName, namePrefix) : "", ServicePackageActivationMode = "ExclusiveProcess", Item = new StatelessServiceType() { InstanceCount = serviceTypeDescription.InstanceCount.ToString(), ServiceTypeName = DockerComposeUtils.GetServiceTypeName(namePrefix), SingletonPartition = new ServiceTypeSingletonPartition(), }, }; if (serviceTypeDescription.PlacementConstraints.Count != 0) { defaultServiceType.Item.PlacementConstraints = $"({this.MergePlacementConstraints(serviceTypeDescription.PlacementConstraints)})"; } return(defaultServiceType); }
private ServiceTypeType GetContainerServiceType(string namePrefix) { return(new StatelessServiceTypeType() { ServiceTypeName = DockerComposeUtils.GetServiceTypeName(namePrefix), UseImplicitHost = true }); }