Пример #1
0
        public async Task DeployModule(IModuleManagerConfig config)
        {
            _logHandler.AttachTaskIdAndUpdateHandler(config.TaskId, config.UpdateCallback);

            await _logHandler.WriteCmd($"{nameof(ModuleManager)}.{nameof(DeployModule)}", verboseLogging);

            var response = await _kubectlHelper.InstallModule(KubectlHelper.CreateModuleDeployment(
                                                                  config.ImageName,
                                                                  config.ModuleName,
                                                                  config.ModuleReplicas), config.LoadBalancerConfig);

            if (response.IsSuccessful)
            {
                await config.SuccessCallback(config.TaskId, _logHandler);
            }
            else
            {
                await _logHandler.WriteLine(response.Message);

                await config.FailureCallback(config.TaskId, _logHandler);
            }
        }
Пример #2
0
 public void AttachTaskIdAndUpdateHandler(Id taskId, Func<Id, ILogHandler, Task> updateHandler)
 {
     _logHandler.AttachTaskIdAndUpdateHandler(taskId, updateHandler);
 }