CORD-3054 Disable kubernetes-client thread pool
Change-Id: I7519cb7e147b378bd9fdf7385d7f46cb1eadbe68
diff --git a/Dockerfile.synchronizer b/Dockerfile.synchronizer
index 4eb50a4..5df9cd9 100644
--- a/Dockerfile.synchronizer
+++ b/Dockerfile.synchronizer
@@ -26,6 +26,11 @@
RUN pip install --no-deps -r /tmp/pip_requirements_kubernetes_service.txt \
&& pip freeze > /var/xos/pip_freeze_pip_up_kubernetes_services_`date -u +%Y%m%dT%H%M%S`
+# Workaround for kubernetes library issue, see CORD-3054
+RUN echo "c82c439bda07f29fd36f23552c4e763f /usr/local/lib/python2.7/dist-packages/kubernetes/client/api_client.py" | md5sum -c -
+COPY api_client.patch /tmp/api_client.patch
+RUN patch -d /usr/local/lib/python2.7/dist-packages/kubernetes/client < /tmp/api_client.patch
+
ENTRYPOINT []
WORKDIR "/opt/xos/synchronizers/kubernetes"
diff --git a/api_client.patch b/api_client.patch
new file mode 100644
index 0000000..864bbb4
--- /dev/null
+++ b/api_client.patch
@@ -0,0 +1,33 @@
+--- api_client.py 2018-05-29 17:59:49.000000000 +0000
++++ api_client.py.new 2018-05-29 17:56:27.000000000 +0000
+@@ -64,7 +64,7 @@
+ configuration = Configuration()
+ self.configuration = configuration
+
+- self.pool = ThreadPool()
++ self.pool = None # NOTE(smbaker): disabled threadpool
+ self.rest_client = RESTClientObject(configuration)
+ self.default_headers = {}
+ if header_name is not None:
+@@ -73,9 +73,10 @@
+ # Set default User-Agent.
+ self.user_agent = 'Swagger-Codegen/6.0.0/python'
+
+- def __del__(self):
+- self.pool.close()
+- self.pool.join()
++# NOTE(smbaker): disabled threadpool
++# def __del__(self):
++# self.pool.close()
++# self.pool.join()
+
+ @property
+ def user_agent(self):
+@@ -320,6 +321,7 @@
+ response_type, auth_settings,
+ _return_http_data_only, collection_formats, _preload_content, _request_timeout)
+ else:
++ raise Exception("Async is not supported") # NOTE(smbaker): disabled thread pool
+ thread = self.pool.apply_async(self.__call_api, (resource_path, method,
+ path_params, query_params,
+ header_params, body,