outposts: pass outpost reference instead of PK, implement TaskResult.uid
This commit is contained in:
		| @ -19,8 +19,8 @@ class BaseController: | ||||
|  | ||||
|     outpost: Outpost | ||||
|  | ||||
|     def __init__(self, outpost_pk: str): | ||||
|         self.outpost = Outpost.objects.get(pk=outpost_pk) | ||||
|     def __init__(self, outpost: Outpost): | ||||
|         self.outpost = outpost | ||||
|         self.logger = get_logger( | ||||
|             controller=self.__class__.__name__, outpost=self.outpost | ||||
|         ) | ||||
|  | ||||
| @ -8,6 +8,7 @@ from yaml import safe_dump | ||||
|  | ||||
| from passbook import __version__ | ||||
| from passbook.outposts.controllers.base import BaseController, ControllerException | ||||
| from passbook.outposts.models import Outpost | ||||
|  | ||||
|  | ||||
| class DockerController(BaseController): | ||||
| @ -19,8 +20,8 @@ class DockerController(BaseController): | ||||
|  | ||||
|     image_base = "beryju/passbook" | ||||
|  | ||||
|     def __init__(self, outpost_pk: str) -> None: | ||||
|         super().__init__(outpost_pk) | ||||
|     def __init__(self, outpost: Outpost) -> None: | ||||
|         super().__init__(outpost) | ||||
|         self.client = from_env() | ||||
|  | ||||
|     def _get_env(self) -> Dict[str, str]: | ||||
|  | ||||
| @ -10,13 +10,14 @@ from passbook.outposts.controllers.base import BaseController, ControllerExcepti | ||||
| from passbook.outposts.controllers.k8s.deployment import DeploymentReconciler | ||||
| from passbook.outposts.controllers.k8s.secret import SecretReconciler | ||||
| from passbook.outposts.controllers.k8s.service import ServiceReconciler | ||||
| from passbook.outposts.models import Outpost | ||||
|  | ||||
|  | ||||
| class KubernetesController(BaseController): | ||||
|     """Manage deployment of outpost in kubernetes""" | ||||
|  | ||||
|     def __init__(self, outpost_pk: str) -> None: | ||||
|         super().__init__(outpost_pk) | ||||
|     def __init__(self, outpost: Outpost) -> None: | ||||
|         super().__init__(outpost) | ||||
|         try: | ||||
|             load_incluster_config() | ||||
|         except ConfigException: | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Jens Langhammer
					Jens Langhammer