outposts: always check metadata on reconcile
This commit is contained in:
		| @ -93,7 +93,8 @@ class KubernetesObjectReconciler(Generic[T]): | |||||||
|     def reconcile(self, current: T, reference: T): |     def reconcile(self, current: T, reference: T): | ||||||
|         """Check what operations should be done, should be raised as |         """Check what operations should be done, should be raised as | ||||||
|         ReconcileTrigger""" |         ReconcileTrigger""" | ||||||
|         raise NotImplementedError |         if current.metadata.annotations != reference.metadata.annotations: | ||||||
|  |             raise NeedsUpdate() | ||||||
|  |  | ||||||
|     def create(self, reference: T): |     def create(self, reference: T): | ||||||
|         """API Wrapper to create object""" |         """API Wrapper to create object""" | ||||||
|  | |||||||
| @ -44,6 +44,7 @@ class DeploymentReconciler(KubernetesObjectReconciler[V1Deployment]): | |||||||
|         return f"authentik-outpost-{self.controller.outpost.uuid.hex}" |         return f"authentik-outpost-{self.controller.outpost.uuid.hex}" | ||||||
|  |  | ||||||
|     def reconcile(self, current: V1Deployment, reference: V1Deployment): |     def reconcile(self, current: V1Deployment, reference: V1Deployment): | ||||||
|  |         super().reconcile(current, reference) | ||||||
|         if current.spec.replicas != reference.spec.replicas: |         if current.spec.replicas != reference.spec.replicas: | ||||||
|             raise NeedsUpdate() |             raise NeedsUpdate() | ||||||
|         if ( |         if ( | ||||||
|  | |||||||
| @ -31,6 +31,7 @@ class SecretReconciler(KubernetesObjectReconciler[V1Secret]): | |||||||
|         return f"authentik-outpost-{self.controller.outpost.uuid.hex}-api" |         return f"authentik-outpost-{self.controller.outpost.uuid.hex}-api" | ||||||
|  |  | ||||||
|     def reconcile(self, current: V1Secret, reference: V1Secret): |     def reconcile(self, current: V1Secret, reference: V1Secret): | ||||||
|  |         super().reconcile(current, reference) | ||||||
|         for key in reference.data.keys(): |         for key in reference.data.keys(): | ||||||
|             if current.data[key] != reference.data[key]: |             if current.data[key] != reference.data[key]: | ||||||
|                 raise NeedsUpdate() |                 raise NeedsUpdate() | ||||||
|  | |||||||
| @ -26,6 +26,7 @@ class ServiceReconciler(KubernetesObjectReconciler[V1Service]): | |||||||
|         return f"authentik-outpost-{self.controller.outpost.uuid.hex}" |         return f"authentik-outpost-{self.controller.outpost.uuid.hex}" | ||||||
|  |  | ||||||
|     def reconcile(self, current: V1Service, reference: V1Service): |     def reconcile(self, current: V1Service, reference: V1Service): | ||||||
|  |         super().reconcile(current, reference) | ||||||
|         if len(current.spec.ports) != len(reference.spec.ports): |         if len(current.spec.ports) != len(reference.spec.ports): | ||||||
|             raise NeedsUpdate() |             raise NeedsUpdate() | ||||||
|         for port in reference.spec.ports: |         for port in reference.spec.ports: | ||||||
|  | |||||||
| @ -40,6 +40,7 @@ class IngressReconciler(KubernetesObjectReconciler[NetworkingV1beta1Ingress]): | |||||||
|     def reconcile( |     def reconcile( | ||||||
|         self, current: NetworkingV1beta1Ingress, reference: NetworkingV1beta1Ingress |         self, current: NetworkingV1beta1Ingress, reference: NetworkingV1beta1Ingress | ||||||
|     ): |     ): | ||||||
|  |         super().reconcile(current, reference) | ||||||
|         # Create a list of all expected host and tls hosts |         # Create a list of all expected host and tls hosts | ||||||
|         expected_hosts = [] |         expected_hosts = [] | ||||||
|         expected_hosts_tls = [] |         expected_hosts_tls = [] | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user
	 Jens Langhammer
					Jens Langhammer