From 7f14ac7fbdd58ae0aef8dd08fe64e854f23f5d26 Mon Sep 17 00:00:00 2001 From: "Aldo \"xoen\" Giambelluca" Date: Thu, 3 Oct 2019 16:39:44 +0100 Subject: [PATCH] PR #756 amendments - better comment for race condition fix - removed unused imports https://github.com/ministryofjustice/analytics-platform-control-panel/pull/756 --- controlpanel/api/kubernetes.py | 4 +++- controlpanel/kubeapi/views.py | 2 -- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/controlpanel/api/kubernetes.py b/controlpanel/api/kubernetes.py index c6787e386..afcc4580c 100644 --- a/controlpanel/api/kubernetes.py +++ b/controlpanel/api/kubernetes.py @@ -23,7 +23,9 @@ def get_config(): config = kubernetes.client.Configuration() - # The deepcopy is to avoid a race conditions on the credentials keys + # A deepcopy of the configuration is used to avoid a race condition + # caused by subsequent calls to Configuration() reusing a singleton + # datastructure # # See: https://github.com/kubernetes-client/python/issues/932 config.api_key_prefix = deepcopy(config.api_key_prefix) diff --git a/controlpanel/kubeapi/views.py b/controlpanel/kubeapi/views.py index 6451f3873..edc713f83 100644 --- a/controlpanel/kubeapi/views.py +++ b/controlpanel/kubeapi/views.py @@ -1,7 +1,5 @@ -from functools import wraps from urllib.parse import urljoin -from django.conf import settings from django.core import exceptions from django.views.decorators.csrf import csrf_exempt from djproxy.views import HttpProxy