Skip to content

Commit

Permalink
Add some log messages.
Browse files Browse the repository at this point in the history
  • Loading branch information
wasabii committed Jan 8, 2025
1 parent cb6b934 commit 1e0c36a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Alethic.Auth0.Operator/Controllers/V1ClientController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,19 @@ async Task ApplySecret(V1Client entity, string? clientId, string? clientSecret,
// find existing secret or create
var secret = await ResolveSecretRef(entity.Spec.SecretRef, entity.Spec.SecretRef.NamespaceProperty ?? defaultNamespace, cancellationToken);
if (secret is null)
{
Logger.LogInformation("{EntityTypeName} {EntityNamespace}/{EntityName} referenced secret {SecretName} which does not exist: creating.", EntityTypeName, entity.Namespace(), entity.Name(), entity.Spec.SecretRef.Name);
secret = await Kube.CreateAsync(
new V1Secret(
metadata: new V1ObjectMeta(namespaceProperty: entity.Spec.SecretRef.NamespaceProperty ?? defaultNamespace, name: entity.Spec.SecretRef.Name))
.WithOwnerReference(entity),
cancellationToken);
}

// only apply actual values if we are the owner
if (secret.IsOwnedBy(entity))
{
Logger.LogInformation("{EntityTypeName} {EntityNamespace}/{EntityName} referenced secret {SecretName}: updating.", EntityTypeName, entity.Namespace(), entity.Name(), entity.Spec.SecretRef.Name);
secret.StringData ??= new Dictionary<string, string>();
secret.StringData["clientId"] = null;
secret.StringData["clientSecret"] = null;
Expand Down

0 comments on commit 1e0c36a

Please sign in to comment.