protected void OnTestEvent(IResourceEvent <Test> e) { switch (e.Type) { case WatchEventType.Added: this.Logger.LogInformation("Test added"); break; case WatchEventType.Modified: this.Logger.LogInformation("Test modified"); break; case WatchEventType.Deleted: this.Logger.LogInformation("Test deleted"); break; case WatchEventType.Bookmark: this.Logger.LogInformation("Test version changed"); break; case WatchEventType.Error: this.Logger.LogError("Test error"); break; default: throw new NotSupportedException($"The specified watch event type '{e}' is not supported"); } }
/// <inheritdoc /> public void OnEvent(int eventId, IResourceEvent args) { switch (eventId) { case EventIds.Empty: if (_emptiesWithTarget) { Empty(args.Source, args.Args, true); } return; case EventIds.Renew: if (_renewsWithTarget) { Renew(args.Source, args.Args, true); } return; } }
/// <summary> /// Handles the specified <see cref="IResourceEvent{TResource}"/> /// </summary> /// <param name="e">The <see cref="IResourceEvent{TResource}"/> to handle</param> protected virtual void OnEvent(IResourceEvent <TResource> e) { this.Logger.LogDebug("An event of type '{type}' has been received concerning a resource of kind '{kind}' (apiVersion={apiVersion})", e.Type, this.ResourceDefinition.Kind, this.ResourceDefinition.ApiVersion); }