Add fetching of qe deployments in config tool
This commit is contained in:
parent
2c61c87712
commit
3d4e43c8d1
24 changed files with 484 additions and 18 deletions
|
@ -8,12 +8,13 @@ class TransientDirectoryProvider(FileConfigProvider):
|
|||
from/to the file system, only using temporary directories,
|
||||
deleting old dirs and creating new ones as requested.
|
||||
"""
|
||||
def __init__(self, config_volume, yaml_filename, py_filename):
|
||||
def __init__(self, config_volume, yaml_filename, py_filename, kubernetes=False):
|
||||
# Create a temp directory that will be cleaned up when we change the config path
|
||||
# This should ensure we have no "pollution" of different configs:
|
||||
# no uploaded config should ever affect subsequent config modifications/creations
|
||||
temp_dir = TemporaryDirectory()
|
||||
self.temp_dir = temp_dir
|
||||
self.kubernetes = kubernetes
|
||||
super(TransientDirectoryProvider, self).__init__(temp_dir.name, yaml_filename, py_filename)
|
||||
|
||||
@property
|
||||
|
@ -33,3 +34,9 @@ class TransientDirectoryProvider(FileConfigProvider):
|
|||
|
||||
def get_config_dir_path(self):
|
||||
return self.config_volume
|
||||
|
||||
def save_configuration_to_kubernetes(self):
|
||||
if not self.kubernetes:
|
||||
raise Exception("Not on kubernetes, cannot save configuration.")
|
||||
|
||||
print('do stuf')
|
||||
|
|
|
@ -3,10 +3,10 @@ from config_app.config_util.config.testprovider import TestConfigProvider
|
|||
from config_app.config_util.config.TransientDirectoryProvider import TransientDirectoryProvider
|
||||
|
||||
|
||||
def get_config_provider(config_volume, yaml_filename, py_filename, testing=False):
|
||||
def get_config_provider(config_volume, yaml_filename, py_filename, testing=False, kubernetes=False):
|
||||
""" Loads and returns the config provider for the current environment. """
|
||||
|
||||
if testing:
|
||||
return TestConfigProvider()
|
||||
|
||||
return TransientDirectoryProvider(config_volume, yaml_filename, py_filename)
|
||||
return TransientDirectoryProvider(config_volume, yaml_filename, py_filename, kubernetes=kubernetes)
|
||||
|
|
Reference in a new issue