
Fresh start for the StarlingX automation framework. Change-Id: Ie265e0791024f45f71faad6315c2b91b022934d1
25 lines
591 B
Python
25 lines
591 B
Python
import json5
|
|
|
|
|
|
class K8sConfig:
|
|
"""
|
|
Class to hold configuration of the Cloud Platform's K8s Cluster
|
|
"""
|
|
|
|
def __init__(self, config):
|
|
|
|
try:
|
|
json_data = open(config)
|
|
except FileNotFoundError:
|
|
print(f"Could not find the k8s config file: {config}")
|
|
raise
|
|
|
|
k8s_dict = json5.load(json_data)
|
|
self.kubeconfig = k8s_dict['kubeconfig']
|
|
|
|
def get_kubeconfig(self) -> str:
|
|
"""
|
|
Getter for the KUBECONFIG environment variable on the lab where we want to run.
|
|
"""
|
|
return self.kubeconfig
|