Compare commits

..

4 Commits

Author SHA1 Message Date
t.behrendt 424af46383 docs: update docs
CI / image check (pull_request) Successful in 57s
CI / install-dependencies (pull_request) Successful in 1m41s
CI / check format (pull_request) Successful in 25s
CI / check lint (pull_request) Successful in 24s
CI / test (pull_request) Successful in 26s
CI / build check (pull_request) Successful in 1m54s
2026-05-18 20:54:56 +02:00
t.behrendt 81529fa35f refactor: consolidate common controller code 2026-05-18 20:54:56 +02:00
t.behrendt 8e8989c576 feat: add bare policy binding controller 2026-05-18 20:54:40 +02:00
t.behrendt 27b55d5a7b feat: add bare application controller 2026-05-18 20:54:34 +02:00
+4 -10
View File
@@ -21,7 +21,6 @@ import (
"fmt"
"net/http"
"slices"
"strconv"
"time"
"golang.org/x/time/rate"
@@ -161,16 +160,11 @@ func (c *ApplicationController) ensureFinalizers(ctx context.Context, app *v1alp
}
func (c *ApplicationController) reconcileDelete(ctx context.Context, app *v1alpha1.Application) error {
pk, err := strconv.ParseInt(app.Status.PK, 10, 32)
r, err := c.authentik.CoreApi.CoreApplicationsDestroy(ctx, app.Status.PK).Execute()
if err != nil {
return fmt.Errorf("error parsing PK: %v", err)
}
r, err := c.authentik.ProvidersApi.ProvidersProxyDestroy(ctx, int32(pk)).Execute()
if err != nil {
// This handles an edge-case, where when the ProxyProvider on Authentik has already been deleted, but the finalizer is still present. We just remove the finalizer and return.
// This handles an edge-case, where when the Application on Authentik has already been deleted, but the finalizer is still present. We just remove the finalizer and return.
if r != nil && r.StatusCode != http.StatusNotFound {
return fmt.Errorf("error when calling `ProvidersAPI.ProvidersProxyDestroy`: %w with response %v", err, r)
return fmt.Errorf("error when calling `CoreAPI.CoreApplicationsDestroy`: %w with response %v", err, r)
}
}
@@ -197,7 +191,7 @@ func (c *ApplicationController) reconcileUpdate(ctx context.Context, app *v1alph
}
resp, r, err := c.authentik.CoreApi.CoreApplicationsPartialUpdate(ctx, app.Spec.Slug).PatchedApplicationRequest(*patchedApplicationRequest).Execute()
if err != nil {
return fmt.Errorf("error when calling `ProvidersAPI.ProvidersProxyPartialUpdate`: %w with response %v", err, r)
return fmt.Errorf("error when calling `CoreAPI.CoreApplicationsPartialUpdate`: %w with response %v", err, r)
}
app.Status.PK = resp.Pk