diff --git a/passbook/outposts/controllers/k8s/deployment.py b/passbook/outposts/controllers/k8s/deployment.py index dc1ed937a..9b87a4842 100644 --- a/passbook/outposts/controllers/k8s/deployment.py +++ b/passbook/outposts/controllers/k8s/deployment.py @@ -36,7 +36,7 @@ class DeploymentReconciler(KubernetesObjectReconciler[V1Deployment]): def __init__(self, controller: "KubernetesController") -> None: super().__init__(controller) - self.api = AppsV1Api() + self.api = AppsV1Api(controller.client) self.outpost = self.controller.outpost @property diff --git a/passbook/outposts/controllers/k8s/secret.py b/passbook/outposts/controllers/k8s/secret.py index 3f947ad46..42a9cf7d7 100644 --- a/passbook/outposts/controllers/k8s/secret.py +++ b/passbook/outposts/controllers/k8s/secret.py @@ -23,7 +23,7 @@ class SecretReconciler(KubernetesObjectReconciler[V1Secret]): def __init__(self, controller: "KubernetesController") -> None: super().__init__(controller) - self.api = CoreV1Api() + self.api = CoreV1Api(controller.client) @property def name(self) -> str: diff --git a/passbook/outposts/controllers/k8s/service.py b/passbook/outposts/controllers/k8s/service.py index 4937deb42..a00580ea8 100644 --- a/passbook/outposts/controllers/k8s/service.py +++ b/passbook/outposts/controllers/k8s/service.py @@ -18,7 +18,7 @@ class ServiceReconciler(KubernetesObjectReconciler[V1Service]): def __init__(self, controller: "KubernetesController") -> None: super().__init__(controller) - self.api = CoreV1Api() + self.api = CoreV1Api(controller.client) @property def name(self) -> str: diff --git a/passbook/outposts/controllers/kubernetes.py b/passbook/outposts/controllers/kubernetes.py index fc3d231cb..6f750e695 100644 --- a/passbook/outposts/controllers/kubernetes.py +++ b/passbook/outposts/controllers/kubernetes.py @@ -21,7 +21,7 @@ class KubernetesController(BaseController): reconcilers: Dict[str, Type[KubernetesObjectReconciler]] reconcile_order: List[str] - config: ApiClient + client: ApiClient connection: KubernetesServiceConnection def __init__( diff --git a/passbook/outposts/models.py b/passbook/outposts/models.py index b1675bff8..a91b21b44 100644 --- a/passbook/outposts/models.py +++ b/passbook/outposts/models.py @@ -5,7 +5,6 @@ from typing import Dict, Iterable, List, Optional, Type, Union from uuid import uuid4 from dacite import from_dict -from django.conf import settings from django.core.cache import cache from django.db import models, transaction from django.db.models.base import Model @@ -22,7 +21,7 @@ from kubernetes.client.configuration import Configuration from kubernetes.client.exceptions import OpenApiException from kubernetes.config.config_exception import ConfigException from kubernetes.config.incluster_config import load_incluster_config -from kubernetes.config.kube_config import load_kube_config, load_kube_config_from_dict +from kubernetes.config.kube_config import load_kube_config_from_dict from model_utils.managers import InheritanceManager from packaging.version import LegacyVersion, Version, parse from urllib3.exceptions import HTTPError @@ -223,10 +222,7 @@ class KubernetesServiceConnection(OutpostServiceConnection): load_kube_config_from_dict(self.kubeconfig, client_configuration=config) return ApiClient(config) except ConfigException as exc: - if not settings.DEBUG: - raise ServiceConnectionInvalid from exc - load_kube_config(client_configuration=config) - return config + raise ServiceConnectionInvalid from exc class Meta: diff --git a/passbook/providers/proxy/controllers/k8s/ingress.py b/passbook/providers/proxy/controllers/k8s/ingress.py index dd592045e..672f58c95 100644 --- a/passbook/providers/proxy/controllers/k8s/ingress.py +++ b/passbook/providers/proxy/controllers/k8s/ingress.py @@ -30,7 +30,7 @@ class IngressReconciler(KubernetesObjectReconciler[NetworkingV1beta1Ingress]): def __init__(self, controller: "KubernetesController") -> None: super().__init__(controller) - self.api = NetworkingV1beta1Api() + self.api = NetworkingV1beta1Api(controller.client) @property def name(self) -> str: diff --git a/swagger.yaml b/swagger.yaml index adca314d4..58bd8d8ee 100755 --- a/swagger.yaml +++ b/swagger.yaml @@ -1100,25 +1100,6 @@ paths: required: true type: string format: uuid - /flows/instances/{flow_uuid}/cache_count/: - get: - operationId: flows_instances_cache_count - description: Get count of cached flows - parameters: [] - responses: - '200': - description: '' - schema: - $ref: '#/definitions/Flow' - tags: - - flows - parameters: - - name: flow_uuid - in: path - description: A UUID string identifying this Flow. - required: true - type: string - format: uuid /outposts/outposts/: get: operationId: outposts_outposts_list