Skip to content

Commit

Permalink
Make oidc provider transfer more robust (#1237)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeljguarino authored Sep 5, 2023
1 parent bcbb181 commit 0676471
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions apps/core/lib/core/services/clusters/transfer.ex
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,12 @@ defmodule Core.Services.Clusters.Transfer do

defp maybe_reparent_provider(xact, %OIDCProvider{installation_id: inst_id} = provider) do
add_operation(xact, {:oidc, inst_id}, fn %{^inst_id => inst} ->
OIDCProvider.changeset(provider, %{installation_id: inst.id})
|> Core.Repo.update()
case Core.Repo.get_by(OIDCProvider, installation_id: inst.id) do
%OIDCProvider{} = prov -> {:ok, prov}
_ ->
OIDCProvider.changeset(provider, %{installation_id: inst.id})
|> Core.Repo.update()
end
end)
end
defp maybe_reparent_provider(xact, _), do: xact
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3'
services:
db:
image: postgres:latest
image: postgres:14
restart: always
ports:
- 5432:5432
Expand Down

0 comments on commit 0676471

Please sign in to comment.