return domains of internal apps
This commit is contained in:
parent
a2019a32d0
commit
fd28d5b774
3 changed files with 27 additions and 4 deletions
|
|
@ -85,6 +85,21 @@ def get_kubernetes_secret_data(secret_name, namespace):
|
|||
return None
|
||||
return secret
|
||||
|
||||
def get_kubernetes_config_map_data(config_map_name, namespace):
|
||||
"""
|
||||
Returns the contents of a kubernetes config map.
|
||||
|
||||
Returns None if the config map does not exist.
|
||||
"""
|
||||
api_instance = client.CoreV1Api()
|
||||
try:
|
||||
config_map = api_instance.read_namespaced_config_map(config_map_name, namespace).data
|
||||
except ApiException as ex:
|
||||
# 404 is expected when the optional secret does not exist.
|
||||
if ex.status != 404:
|
||||
raise ex
|
||||
return None
|
||||
return config_map
|
||||
|
||||
def store_kubernetes_secret(secret_dict, namespace, update=False):
|
||||
"""Stores either a new secret in the cluster, or updates an existing one."""
|
||||
|
|
|
|||
Reference in a new issue