Skip to content

Commit

Permalink
style: format code
Browse files Browse the repository at this point in the history
  • Loading branch information
buehler committed Oct 3, 2023
1 parent c445dc1 commit ddea816
Show file tree
Hide file tree
Showing 14 changed files with 869 additions and 869 deletions.
26 changes: 13 additions & 13 deletions examples/Operator/Finalizer/FinalizerOne.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
using KubeOps.Abstractions.Finalizer;

using Operator.Entities;

namespace Operator.Finalizer;

public class FinalizerOne : IEntityFinalizer<V1TestEntity>
{
public Task FinalizeAsync(V1TestEntity entity)
{
return Task.CompletedTask;
}
}
using KubeOps.Abstractions.Finalizer;

using Operator.Entities;

namespace Operator.Finalizer;

public class FinalizerOne : IEntityFinalizer<V1TestEntity>
{
public Task FinalizeAsync(V1TestEntity entity)
{
return Task.CompletedTask;
}
}
26 changes: 13 additions & 13 deletions examples/Operator/Finalizer/FinalizerTwo.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
using KubeOps.Abstractions.Finalizer;

using Operator.Entities;

namespace Operator.Finalizer;

public class FinalizerTwo : IEntityFinalizer<V1TestEntity>
{
public Task FinalizeAsync(V1TestEntity entity)
{
return Task.CompletedTask;
}
}
using KubeOps.Abstractions.Finalizer;

using Operator.Entities;

namespace Operator.Finalizer;

public class FinalizerTwo : IEntityFinalizer<V1TestEntity>
{
public Task FinalizeAsync(V1TestEntity entity)
{
return Task.CompletedTask;
}
}
82 changes: 41 additions & 41 deletions src/KubeOps.Abstractions/Finalizer/EntityFinalizerAttacher.cs
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
using k8s;
using k8s.Models;

namespace KubeOps.Abstractions.Finalizer;

/// <summary>
/// <para>
/// Injectable delegate for finalizers. This delegate is used to attach a finalizer
/// with its identifier to an entity. When injected, simply call the delegate with
/// the entity to attach the finalizer.
/// </para>
/// <para>
/// As with other (possibly) mutating calls, use the returned entity for further
/// modification and Kubernetes client interactions, since the resource version
/// is updated each time the entity is modified.
/// </para>
/// </summary>
/// <typeparam name="TImplementation">The type of the entity finalizer.</typeparam>
/// <typeparam name="TEntity">The type of the Kubernetes entity.</typeparam>
/// <param name="entity">The instance of the entity, that the finalizer is attached if needed.</param>
/// <returns>A <see cref="Task"/> that resolves when the finalizer was attached.</returns>
/// <example>
/// <code>
/// [EntityRbac(typeof(V1TestEntity), Verbs = RbacVerb.All)]
/// public class V1TestEntityController : IEntityController&lt;V1TestEntity&gt;
/// {
/// private readonly EntityFinalizerAttacher&lt;FinalizerOne, V1TestEntity&gt; _finalizer1;
///
/// public V1TestEntityController(
/// EntityFinalizerAttacher&lt;FinalizerOne, V1TestEntity&gt; finalizer1) => _finalizer1 = finalizer1;
///
/// public async Task ReconcileAsync(V1TestEntity entity)
/// {
/// entity = await _finalizer1(entity);
/// }
/// }
/// </code>
/// </example>
public delegate Task<TEntity> EntityFinalizerAttacher<TImplementation, TEntity>(TEntity entity)
where TImplementation : IEntityFinalizer<TEntity>
where TEntity : IKubernetesObject<V1ObjectMeta>;
using k8s;
using k8s.Models;

namespace KubeOps.Abstractions.Finalizer;

/// <summary>
/// <para>
/// Injectable delegate for finalizers. This delegate is used to attach a finalizer
/// with its identifier to an entity. When injected, simply call the delegate with
/// the entity to attach the finalizer.
/// </para>
/// <para>
/// As with other (possibly) mutating calls, use the returned entity for further
/// modification and Kubernetes client interactions, since the resource version
/// is updated each time the entity is modified.
/// </para>
/// </summary>
/// <typeparam name="TImplementation">The type of the entity finalizer.</typeparam>
/// <typeparam name="TEntity">The type of the Kubernetes entity.</typeparam>
/// <param name="entity">The instance of the entity, that the finalizer is attached if needed.</param>
/// <returns>A <see cref="Task"/> that resolves when the finalizer was attached.</returns>
/// <example>
/// <code>
/// [EntityRbac(typeof(V1TestEntity), Verbs = RbacVerb.All)]
/// public class V1TestEntityController : IEntityController&lt;V1TestEntity&gt;
/// {
/// private readonly EntityFinalizerAttacher&lt;FinalizerOne, V1TestEntity&gt; _finalizer1;
///
/// public V1TestEntityController(
/// EntityFinalizerAttacher&lt;FinalizerOne, V1TestEntity&gt; finalizer1) => _finalizer1 = finalizer1;
///
/// public async Task ReconcileAsync(V1TestEntity entity)
/// {
/// entity = await _finalizer1(entity);
/// }
/// }
/// </code>
/// </example>
public delegate Task<TEntity> EntityFinalizerAttacher<TImplementation, TEntity>(TEntity entity)
where TImplementation : IEntityFinalizer<TEntity>
where TEntity : IKubernetesObject<V1ObjectMeta>;
38 changes: 19 additions & 19 deletions src/KubeOps.Abstractions/Finalizer/IEntityFinalizer{TEntity}.cs
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
using k8s;
using k8s.Models;

namespace KubeOps.Abstractions.Finalizer;

/// <summary>
/// Finalizer for an entity.
/// </summary>
/// <typeparam name="TEntity">The type of the entity.</typeparam>
public interface IEntityFinalizer<in TEntity>
where TEntity : IKubernetesObject<V1ObjectMeta>
{
/// <summary>
/// Finalize an entity that is pending for deletion.
/// </summary>
/// <param name="entity">The kubernetes entity that needs to be finalized.</param>
/// <returns>A task that resolves when the operation is done.</returns>
Task FinalizeAsync(TEntity entity);
}
using k8s;
using k8s.Models;

namespace KubeOps.Abstractions.Finalizer;

/// <summary>
/// Finalizer for an entity.
/// </summary>
/// <typeparam name="TEntity">The type of the entity.</typeparam>
public interface IEntityFinalizer<in TEntity>
where TEntity : IKubernetesObject<V1ObjectMeta>
{
/// <summary>
/// Finalize an entity that is pending for deletion.
/// </summary>
/// <param name="entity">The kubernetes entity that needs to be finalized.</param>
/// <returns>A task that resolves when the operation is done.</returns>
Task FinalizeAsync(TEntity entity);
}
Loading

0 comments on commit ddea816

Please sign in to comment.