Skip to content

Commit

Permalink
refactor(operator): rework event publishing (#626)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: the `IEventManager` is not part
of the operator anymore. To publish events, inject the
`EventPublisher` delegate and use it to publish
events on entities with reason and message.
The name of the events are not base32 encoded but
hex encoded sha512 values now.
  • Loading branch information
buehler committed Oct 5, 2023
1 parent 5cd5da8 commit 8e07bc6
Show file tree
Hide file tree
Showing 29 changed files with 1,298 additions and 1,370 deletions.
Expand Up @@ -36,21 +36,7 @@ public static V1OwnerReference MakeOwnerReference(this IKubernetesObject<V1Objec
kubernetesObject.Metadata.Name,
kubernetesObject.Metadata.Uid);

/// <summary>
/// Create a <see cref="V1ObjectReference"/> of a kubernetes object.
/// </summary>
/// <param name="kubernetesObject">The object that should be translated.</param>
/// <returns>The created <see cref="V1ObjectReference"/>.</returns>
public static V1ObjectReference MakeObjectReference(this IKubernetesObject<V1ObjectMeta> kubernetesObject)
=> new()
{
ApiVersion = kubernetesObject.ApiVersion,
Kind = kubernetesObject.Kind,
Name = kubernetesObject.Metadata.Name,
NamespaceProperty = kubernetesObject.Metadata.NamespaceProperty,
ResourceVersion = kubernetesObject.Metadata.ResourceVersion,
Uid = kubernetesObject.Metadata.Uid,
};


private static IList<V1OwnerReference> EnsureOwnerReferences(this V1ObjectMeta meta) =>
meta.OwnerReferences ??= new List<V1OwnerReference>();
Expand Down
119 changes: 0 additions & 119 deletions _old/src/KubeOps/Operator/Events/EventManager.cs

This file was deleted.

105 changes: 0 additions & 105 deletions _old/src/KubeOps/Operator/Events/IEventManager.cs

This file was deleted.

0 comments on commit 8e07bc6

Please sign in to comment.