Fix Kubernetes config provider for recent changes in Kub API
Kubernetes secret volumes are now mounted as read-only, so we have to write the files *only* via the Kub API Fixes https://jira.coreos.com/browse/QUAY-911
This commit is contained in:
parent
8d5e8fc685
commit
e20295f573
7 changed files with 153 additions and 109 deletions
|
@ -8,7 +8,12 @@ from test.fixtures import *
|
|||
|
||||
class TestKubernetesConfigProvider(KubernetesConfigProvider):
|
||||
def __init__(self):
|
||||
self.config_volume = ''
|
||||
self.yaml_filename = 'yaml_filename'
|
||||
self.py_filename = None
|
||||
|
||||
self.yaml_path = os.path.join(self.config_volume, self.yaml_filename)
|
||||
|
||||
self._service_token = 'service_token'
|
||||
self._execute_k8s_api = Mock()
|
||||
|
||||
|
@ -21,7 +26,6 @@ class TestKubernetesConfigProvider(KubernetesConfigProvider):
|
|||
])
|
||||
def test_get_volume_path(directory, filename, expected):
|
||||
provider = TestKubernetesConfigProvider()
|
||||
|
||||
assert expected == provider.get_volume_path(directory, filename)
|
||||
|
||||
|
||||
|
@ -53,4 +57,4 @@ def test_volume_file_exists(response, key, expected):
|
|||
def test_list_volume_directory(response, expected):
|
||||
provider = TestKubernetesConfigProvider()
|
||||
provider._execute_k8s_api.return_value = response
|
||||
assert expected == provider.list_volume_directory("extra")
|
||||
assert expected == provider.list_volume_directory("extra")
|
||||
|
|
Reference in a new issue