adding and removing functions as result of merge conflict
This commit is contained in:
parent
8eb8d83bea
commit
c6aa2be273
3 changed files with 23 additions and 28 deletions
|
|
@ -114,6 +114,29 @@ def get_kubernetes_secret_data(secret_name, namespace):
|
|||
return secret
|
||||
|
||||
|
||||
def get_kubernetes_config_map_data(config_map_name, namespace):
|
||||
"""
|
||||
Get ConfigMap from Kubernetes
|
||||
|
||||
:param config_map_name: Name of the ConfigMap
|
||||
:type config_map_name: string
|
||||
:param namespace: Namespace of the ConfigMap
|
||||
:type namespace: string
|
||||
|
||||
:return: The contents of a kubernetes ConfigMap or None if the cm does not exist.
|
||||
:rtype: dict or None
|
||||
"""
|
||||
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