ci: add base
This commit is contained in:
+8
-7
@@ -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{
|
||||
|
||||
Reference in New Issue
Block a user