示例#1
0
        private async Task OnEventHandlingError(WatcherEvent e, Exception ex)
        {
            var id = KubernetesObjectId.For(e.Item.Metadata());

            if (ex is Microsoft.Rest.HttpOperationException httpEx)
            {
                _logger.LogError($"Microsoft.Rest.HttpOperationException response: {httpEx.Response.Content}");
            }

            _logger.LogError(ex, "Failed to process {eventType} {kind} {@id} due to exception",
                             e.Type, e.Item.Kind, id);
            await _secretsWatcher.Stop();

            foreach (var certificatesWatcher in _certificatesWatchers.Values)
            {
                await certificatesWatcher.Stop();
            }
            _eventQueue.Clear();

            _logger.LogTrace("Watchers restarting");
            await _secretsWatcher.Start();

            foreach (var certificatesWatcher in _certificatesWatchers.Values)
            {
                await certificatesWatcher.Start();
            }
            _logger.LogTrace("Watchers restarted");
        }
        private async Task OnEventHandlingError(WatcherEvent e, Exception ex)
        {
            var id = KubernetesObjectId.For(e.Item.Metadata());

            _logger.LogError(ex, "Failed to process {eventType} {kind} {@id} due to exception",
                             e.Type, e.Item.Kind, id);
            await WatchersStop();

            _eventQueue.Clear();

            _logger.LogInformation("Restarting watchers ");
            await WatchersStart();
        }
示例#3
0
        private async Task OnEventHandlingError(WatcherEvent <V1Secret> e, Exception ex)
        {
            var id = KubernetesObjectId.For(e.Item.Metadata());

            _logger.LogError(ex, "Failed to process {eventType} {kind} {@id} due to exception",
                             e.Type, e.Item.Kind, id);
            await _secretsWatcher.Stop();

            _eventQueue.Clear();

            _logger.LogTrace("Watchers restarting");
            await _secretsWatcher.Start();

            _logger.LogTrace("Watchers restarted");
        }
示例#4
0
        private async Task OnEventHandlingError(WatcherEvent e, Exception ex)
        {
            var id = KubernetesObjectId.For(e.Item.Metadata());

            if (ex is Microsoft.Rest.HttpOperationException httpEx)
            {
                _logger.LogError($"Microsoft.Rest.HttpOperationException response: {httpEx.Response.Content}");
            }

            _logger.LogError(ex, "Failed to process {eventType} {kind} {@id} due to exception",
                             e.Type, e.Item.Kind, id);
            await WatchersStop();

            _eventQueue.Clear();

            _logger.LogInformation("Restarting watchers ");
            await WatchersStart();
        }