Skip to content
This repository has been archived by the owner on Nov 13, 2024. It is now read-only.

Commit

Permalink
feature: ensure owner reference is set (#69)
Browse files Browse the repository at this point in the history
  • Loading branch information
BlowaXD authored Aug 3, 2023
1 parent 654b137 commit 0c6626c
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using KubeOps.KubernetesClient;
using KubeOps.Operator.Controller;
using KubeOps.Operator.Controller.Results;
using KubeOps.Operator.Entities.Extensions;
using KubeOps.Operator.Events;
using KubeOps.Operator.Rbac;
using Microsoft.AspNetCore.Mvc;
Expand Down Expand Up @@ -46,6 +47,8 @@ public BitwardenSecretController(ILogger<BitwardenSecretController> logger, Kube

// create
secret = await entity.GetSecretAsync(_cliWrapper);
secret.WithOwnerReference(entity);

secret = await _kubernetesClient.Create<V1Secret>(secret);

// created events
Expand All @@ -59,6 +62,8 @@ public BitwardenSecretController(ILogger<BitwardenSecretController> logger, Kube

// update
secret = await entity.GetSecretAsync(_cliWrapper);

secret.WithOwnerReference(entity);
await _kubernetesClient.Update<V1Secret>(secret);

// updated events
Expand Down

0 comments on commit 0c6626c

Please sign in to comment.