outpost: revert managed config, make authentik_host field optional

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer
2021-08-08 16:57:56 +02:00
parent a9ef1a3190
commit c025d64ba3
4 changed files with 23 additions and 17 deletions

View File

@ -1,9 +1,12 @@
"""Outpost managed objects"""
from dataclasses import asdict
from authentik.managed.manager import EnsureExists, ObjectManager
from authentik.outposts.models import (
DockerServiceConnection,
KubernetesServiceConnection,
Outpost,
OutpostConfig,
OutpostType,
)
@ -30,12 +33,13 @@ class OutpostManager(ObjectManager):
created_callback=outpost_created,
name="authentik Embedded Outpost",
type=OutpostType.PROXY,
_config={
# We don't use OutpostConfig here to not override authentik_host
"kubernetes_disabled_components": [
"deployment",
"secret",
],
},
_config=asdict(
OutpostConfig(
kubernetes_disabled_components=[
"deployment",
"secret",
],
)
),
),
]

View File

@ -59,7 +59,7 @@ class OutpostConfig:
# update website/docs/outposts/outposts.md
authentik_host: str
authentik_host: str = ""
authentik_host_insecure: bool = False
log_level: str = CONFIG.y("log_level")
@ -312,10 +312,6 @@ class Outpost(ManagedModel):
@property
def config(self) -> OutpostConfig:
"""Load config as OutpostConfig object"""
# When embedded outpost is generated initially, this field isn't set
# (on purpose, as we don't want it to be managed by us)
if "authentik_host" not in self._config:
self._config["authentik_host"] = ""
return from_dict(OutpostConfig, self._config)
@config.setter