Skip to content
Snippets Groups Projects
Commit f8706e5e authored by Shane Hutchins's avatar Shane Hutchins
Browse files

Merge branch 'configmap' into 'master'

adding k8s

See merge request !364
parents ddae6253 b6c0bb99
No related branches found
No related tags found
1 merge request!364adding k8s
Pipeline #187766 failed
#!/usr/bin/env python3
from kubernetes import client, config
from kubernetes.client.rest import ApiException
import logging
logger = logging.getLogger(__name__)
def get_opa_config(namespace="osdu-services", name="opa-config"):
# Configs can be set in Configuration class directly or using helper utility
config.load_kube_config()
v1 = client.CoreV1Api()
pretty = True
try:
api_response = v1.read_namespaced_config_map(namespace=namespace, name=name, pretty=pretty)
except ApiException as err:
logger.error(f"Exception when calling CoreV1Api->list_namespaced_config_map: {err}")
return api_response.data["config"]
if __name__ == '__main__':
data_partition = 'osdu'
name = "opa-config"
r = get_opa_config(data_partition=data_partition, name=name)
if f"osdu/partition/{data_partition}" in r and f"bundle-{data_partition}.tar.gz" in r:
print(f"found '{data_partition}' in configmap {name}")
else:
print(f"not found '{data_partition}' in configmap {name}")
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment