[docs]def__init__(self)->None:"""Configuration class for the uptainer Object. Args: None Returns: None """self.name=Noneself.image_repository=Noneself.git_ssh_url=Noneself.git_ssh_privatekey=Noneself.git_values_filename=Noneself.values_key=Noneself.version_match=Noneself.git_branch=None
[docs]defload(self,config:dict[Any,Any])->None:"""Load the config given from the file and inject it into the class vars. Args: config (dict): The config dict given from uptainer.loader.Loader.read_config Returns: None """mandatory_vars=["name","image_repository","git_ssh_url","git_values_filename","values_key","version_match",]foritervarinmandatory_vars:ifconfig[itervar]:setattr(self,itervar,config[itervar])if"git_branch"inconfig:self.git_branch=config["git_branch"]else:self.git_branch="main"if"git_ssh_privatekey"inconfig:self.git_ssh_privatekey=config["git_ssh_privatekey"]else:homedir=environ.get("HOME","/tmp")self.git_ssh_privatekey=f"{homedir}/.ssh/id_rsa"