ci: add base

This commit is contained in:
2026-05-16 20:07:04 +02:00
parent 9b0d6a3279
commit cc32a01246
10 changed files with 579 additions and 28 deletions
+8 -7
View File
@@ -210,7 +210,7 @@ func (c *Controller) reconcileDelete(ctx context.Context, pp *v1alpha1.ProxyProv
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.
if r.StatusCode != http.StatusNotFound {
if r != nil && r.StatusCode != http.StatusNotFound {
return fmt.Errorf("error when calling `ProvidersAPI.ProvidersProxyDestroy`: %w with response %v", err, r)
}
}
@@ -226,13 +226,14 @@ func (c *Controller) reconcileUpdate(ctx context.Context, pp *v1alpha1.ProxyProv
return fmt.Errorf("error parsing PK: %v", err)
}
_, r, err := c.authentik.ProvidersApi.ProvidersAllRetrieve(ctx, int32(pk)).Execute()
if err != nil && r.StatusCode != http.StatusNotFound {
if err != nil {
if r != nil && r.StatusCode == http.StatusNotFound {
// This handles an edge-case, where when the PorxyProvider on Authentik has been deleted, e.g. by mistake. We just remove the PK and return.
// During the next reconciliation, the ProxyProvider will be re-created.
pp.Status.PK = ""
return c.updateProxyProviderStatus(ctx, pp)
}
return fmt.Errorf("error retrieving existing ProxyProvider: %v with response %v", err, r)
} else if r.StatusCode == http.StatusNotFound {
// This handles an edge-case, where when the PorxyProvider on Authentik has been deleted, e.g. by mistake. We just remove the PK and return.
// During the next reconciliation, the ProxyProvider will be re-created.
pp.Status.PK = ""
}
proxyProviderRequest := &authentikapi.PatchedProxyProviderRequest{