outpost: only set embedded outpost config on creation

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-08-08 22:23:33 +02:00
parent 665c1aa81b
commit 837fa23af0
1 changed files with 6 additions and 10 deletions

View File

@ -1,6 +1,4 @@
"""Outpost managed objects"""
from dataclasses import asdict
from authentik.managed.manager import EnsureExists, ObjectManager
from authentik.outposts.models import (
DockerServiceConnection,
@ -24,6 +22,12 @@ class OutpostManager(ObjectManager):
outpost.service_connection = KubernetesServiceConnection.objects.first()
elif DockerServiceConnection.objects.exists():
outpost.service_connection = DockerServiceConnection.objects.first()
outpost.config = OutpostConfig(
kubernetes_disabled_components=[
"deployment",
"secret",
]
)
outpost.save()
return [
@ -33,13 +37,5 @@ class OutpostManager(ObjectManager):
created_callback=outpost_created,
name="authentik Embedded Outpost",
type=OutpostType.PROXY,
_config=asdict(
OutpostConfig(
kubernetes_disabled_components=[
"deployment",
"secret",
],
)
),
),
]