outposts: set field_manager
This commit is contained in:
parent
2bab4ebfe8
commit
09f4d812b3
|
@ -22,6 +22,7 @@ from authentik.outposts.controllers.k8s.base import (
|
||||||
KubernetesObjectReconciler,
|
KubernetesObjectReconciler,
|
||||||
NeedsUpdate,
|
NeedsUpdate,
|
||||||
)
|
)
|
||||||
|
from authentik.outposts.controllers.kubernetes import FIELD_MANAGER
|
||||||
from authentik.outposts.models import Outpost
|
from authentik.outposts.models import Outpost
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
|
@ -118,7 +119,9 @@ class DeploymentReconciler(KubernetesObjectReconciler[V1Deployment]):
|
||||||
)
|
)
|
||||||
|
|
||||||
def create(self, reference: V1Deployment):
|
def create(self, reference: V1Deployment):
|
||||||
return self.api.create_namespaced_deployment(self.namespace, reference)
|
return self.api.create_namespaced_deployment(
|
||||||
|
self.namespace, reference, field_manager=FIELD_MANAGER
|
||||||
|
)
|
||||||
|
|
||||||
def delete(self, reference: V1Deployment):
|
def delete(self, reference: V1Deployment):
|
||||||
return self.api.delete_namespaced_deployment(
|
return self.api.delete_namespaced_deployment(
|
||||||
|
|
|
@ -8,6 +8,7 @@ from authentik.outposts.controllers.k8s.base import (
|
||||||
KubernetesObjectReconciler,
|
KubernetesObjectReconciler,
|
||||||
NeedsUpdate,
|
NeedsUpdate,
|
||||||
)
|
)
|
||||||
|
from authentik.outposts.controllers.kubernetes import FIELD_MANAGER
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from authentik.outposts.controllers.kubernetes import KubernetesController
|
from authentik.outposts.controllers.kubernetes import KubernetesController
|
||||||
|
@ -51,7 +52,9 @@ class SecretReconciler(KubernetesObjectReconciler[V1Secret]):
|
||||||
)
|
)
|
||||||
|
|
||||||
def create(self, reference: V1Secret):
|
def create(self, reference: V1Secret):
|
||||||
return self.api.create_namespaced_secret(self.namespace, reference)
|
return self.api.create_namespaced_secret(
|
||||||
|
self.namespace, reference, field_manager=FIELD_MANAGER
|
||||||
|
)
|
||||||
|
|
||||||
def delete(self, reference: V1Secret):
|
def delete(self, reference: V1Secret):
|
||||||
return self.api.delete_namespaced_secret(
|
return self.api.delete_namespaced_secret(
|
||||||
|
|
|
@ -8,6 +8,7 @@ from authentik.outposts.controllers.k8s.base import (
|
||||||
NeedsUpdate,
|
NeedsUpdate,
|
||||||
)
|
)
|
||||||
from authentik.outposts.controllers.k8s.deployment import DeploymentReconciler
|
from authentik.outposts.controllers.k8s.deployment import DeploymentReconciler
|
||||||
|
from authentik.outposts.controllers.kubernetes import FIELD_MANAGER
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from authentik.outposts.controllers.kubernetes import KubernetesController
|
from authentik.outposts.controllers.kubernetes import KubernetesController
|
||||||
|
@ -44,7 +45,9 @@ class ServiceReconciler(KubernetesObjectReconciler[V1Service]):
|
||||||
)
|
)
|
||||||
|
|
||||||
def create(self, reference: V1Service):
|
def create(self, reference: V1Service):
|
||||||
return self.api.create_namespaced_service(self.namespace, reference)
|
return self.api.create_namespaced_service(
|
||||||
|
self.namespace, reference, field_manager=FIELD_MANAGER
|
||||||
|
)
|
||||||
|
|
||||||
def delete(self, reference: V1Service):
|
def delete(self, reference: V1Service):
|
||||||
return self.api.delete_namespaced_service(
|
return self.api.delete_namespaced_service(
|
||||||
|
|
|
@ -14,6 +14,8 @@ from authentik.outposts.controllers.k8s.secret import SecretReconciler
|
||||||
from authentik.outposts.controllers.k8s.service import ServiceReconciler
|
from authentik.outposts.controllers.k8s.service import ServiceReconciler
|
||||||
from authentik.outposts.models import KubernetesServiceConnection, Outpost
|
from authentik.outposts.models import KubernetesServiceConnection, Outpost
|
||||||
|
|
||||||
|
FIELD_MANAGER = "goauthentik.io"
|
||||||
|
|
||||||
|
|
||||||
class KubernetesController(BaseController):
|
class KubernetesController(BaseController):
|
||||||
"""Manage deployment of outpost in kubernetes"""
|
"""Manage deployment of outpost in kubernetes"""
|
||||||
|
|
|
@ -19,6 +19,7 @@ from authentik.outposts.controllers.k8s.base import (
|
||||||
KubernetesObjectReconciler,
|
KubernetesObjectReconciler,
|
||||||
NeedsUpdate,
|
NeedsUpdate,
|
||||||
)
|
)
|
||||||
|
from authentik.outposts.controllers.kubernetes import FIELD_MANAGER
|
||||||
from authentik.providers.proxy.models import ProxyProvider
|
from authentik.providers.proxy.models import ProxyProvider
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
|
@ -124,7 +125,9 @@ class IngressReconciler(KubernetesObjectReconciler[NetworkingV1beta1Ingress]):
|
||||||
)
|
)
|
||||||
|
|
||||||
def create(self, reference: NetworkingV1beta1Ingress):
|
def create(self, reference: NetworkingV1beta1Ingress):
|
||||||
return self.api.create_namespaced_ingress(self.namespace, reference)
|
return self.api.create_namespaced_ingress(
|
||||||
|
self.namespace, reference, field_manager=FIELD_MANAGER
|
||||||
|
)
|
||||||
|
|
||||||
def delete(self, reference: NetworkingV1beta1Ingress):
|
def delete(self, reference: NetworkingV1beta1Ingress):
|
||||||
return self.api.delete_namespaced_ingress(
|
return self.api.delete_namespaced_ingress(
|
||||||
|
|
Reference in New Issue