Skip to content

Commit

Permalink
add logging to debug issue with already existing cilium netpols
Browse files Browse the repository at this point in the history
  • Loading branch information
QuantumEnigmaa committed Feb 12, 2024
1 parent 96ea389 commit a2a6743
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion service/controller/resource/ciliumnetpol/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ func (r *Resource) EnsureCreated(ctx context.Context, obj interface{}) error {
return microerror.Mask(err)
}

_, err = r.dynamicK8sClient.Resource(resource).Get(ctx, desired.GetName(), metav1.GetOptions{})
ciliumnetpol, err := r.dynamicK8sClient.Resource(resource).Get(ctx, desired.GetName(), metav1.GetOptions{})
r.logger.Log(ciliumnetpol)
if apierrors.IsNotFound(err) {
_, err = r.dynamicK8sClient.Resource(resource).Namespace(desired.GetNamespace()).Create(ctx, desired, metav1.CreateOptions{})
}
Expand Down

0 comments on commit a2a6743

Please sign in to comment.