Skip to content

Commit

Permalink
Revert "fix disabling cert validation (#124)"
Browse files Browse the repository at this point in the history
This reverts commit a1c5dd0.
  • Loading branch information
m-wcislo authored Dec 19, 2022
1 parent a1c5dd0 commit 0bb4433
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 9 deletions.
6 changes: 0 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## In progress

## [0.8.1] - 2022-12-16
### Added
- Add proxy configuration fetched from `HTTP_PROXY` or `http_proxy` environment variable

### Fixed
Fix disabling cert validation [#124](https://github.com/devopsspiral/KubeLibrary/pull/124)

## [0.8.0] - 2022-10-27
### Added
- Add function list_namespaced_stateful_set_by_pattern [#114](https://github.com/devopsspiral/KubeLibrary/pull/113) by [@siaomingjeng](https://github.com/siaomingjeng)
Expand Down
3 changes: 2 additions & 1 deletion src/KubeLibrary/KubeLibrary.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import json
import re
import ssl
import urllib3

from os import environ
Expand Down Expand Up @@ -275,7 +276,7 @@ def reload_config(self, kube_config=None, context=None, api_url=None, bearer_tok
def _add_api(self, reference, class_name):
self.__dict__[reference] = class_name(self.api_client)
if not self.cert_validation:
self.__dict__[reference].api_client.configuration.verify_ssl = False
self.__dict__[reference].api_client.rest_client.pool_manager.connection_pool_kw['cert_reqs'] = ssl.CERT_NONE

def k8s_api_ping(self):
"""Performs GET on /api/v1/ for simple check of API availability.
Expand Down
2 changes: 1 addition & 1 deletion src/KubeLibrary/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version = "0.8.1"
version = "0.8.0"
3 changes: 2 additions & 1 deletion test/test_KubeLibrary.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import json
import mock
import re
import ssl
import unittest
from KubeLibrary import KubeLibrary
from KubeLibrary.exceptions import BearerTokenWithPrefixException
Expand Down Expand Up @@ -305,7 +306,7 @@ def test_KubeLibrary_inits_without_cert_validation(self):
kl = KubeLibrary(kube_config='test/resources/k3d', cert_validation=False)
for api in TestKubeLibrary.apis:
target = getattr(kl, api)
self.assertEqual(target.api_client.configuration.verify_ssl, False)
self.assertEqual(target.api_client.rest_client.pool_manager.connection_pool_kw['cert_reqs'], ssl.CERT_NONE)

@responses.activate
def test_KubeLibrary_inits_with_bearer_token(self):
Expand Down

0 comments on commit 0bb4433

Please sign in to comment.