コード例 #1
0
        /// <inheritdoc/>
        public void Normalize()
        {
            ContainerSpec = ContainerSpec ?? new ServiceContainerSpec();
            Resources     = Resources ?? new ServiceResources();
            RestartPolicy = RestartPolicy ?? new ServiceRestartPolicy();
            Placement     = Placement ?? new ServicePlacement();
            Networks      = Networks ?? new List <ServiceNetwork>();
            EndpointSpec  = EndpointSpec ?? new ServiceEndpointSpec();

            ContainerSpec?.Normalize();
            Resources?.Normalize();
            RestartPolicy?.Normalize();
            Placement?.Normalize();
            LogDriver?.Normalize();
            EndpointSpec?.Normalize();

            foreach (var item in Networks)
            {
                item?.Normalize();
            }
        }
コード例 #2
0
        /// <inheritdoc/>
        public void Normalize()
        {
            Labels         = Labels ?? new Dictionary <string, string>(StringComparer.InvariantCultureIgnoreCase);
            TaskTemplate   = TaskTemplate ?? new ServiceTaskTemplate();
            Mode           = Mode ?? new ServiceSchedulingMode();
            UpdateConfig   = UpdateConfig ?? new ServiceUpdateConfig();
            RollbackConfig = RollbackConfig ?? new ServiceRollbackConfig();
            Networks       = Networks ?? new List <ServiceNetwork>();
            EndpointSpec   = EndpointSpec ?? new ServiceEndpointSpec();

            TaskTemplate?.Normalize();
            Mode?.Normalize();
            UpdateConfig?.Normalize();
            RollbackConfig?.Normalize();

            foreach (var item in Networks)
            {
                item?.Normalize();
            }

            EndpointSpec?.Normalize();
        }