super().__init__()
self.set_from_dict(config_dict)
self.set_auto_env("OSMLCM")
+ self.set_auto_env("OSM")
def get(self, key, defaultValue):
return self.to_dict()[key]
class GitopsConfig(OsmConfigman):
- repo_base_url: str = None
- repo_user: str = None
+ git_base_url: str = None
+ user: str = None
pubkey: str = None
- mgmtcluster_kubeconfig: str = "/etc/osm/mgmtcluster-kubeconfig.yaml"
+ mgmtcluster_kubeconfig: str = None
loglevel: str = "DEBUG"
logfile: str = None
logger_name: str = None
gitops:
mgmtcluster_kubeconfig: /etc/osm/mgmtcluster-kubeconfig.yaml
- repo_user: osm-developer
- # repo_base_url: http://git.<IP_ADDRESS>.nip.io
+ user: osm-developer
+ # git_base_url: http://git.<IP_ADDRESS>.nip.io
# pubkey: pubkey
self.logger.info("Msg: {} lcm_tasks: {} ".format(msg, lcm_tasks))
# self._kubeconfig = kubeconfig # TODO: get it from config
- self._kubeconfig = "/etc/osm/mgmtcluster-kubeconfig.yaml"
+ self.gitops_config = config["gitops"]
+ self.logger.debug(f"Config: {self.gitops_config}")
+ self._kubeconfig = self.gitops_config["mgmtcluster_kubeconfig"]
self._kubectl = kubectl.Kubectl(config_file=self._kubeconfig)
- # self._repo_base_url = repo_base_url
- # self._repo_user = repo_user
- # self._pubkey = pubkey
- self._repo_base_url = (
- "http://git.172.21.249.24.nip.io" # TODO: get it from config
- )
- self._repo_user = "osm-developer" # TODO: get it from config
- self._pubkey = "age1wnfvymrm4w9kfz8vn98lmu8c4w9e2wjd2v7u9lx7m3gn6patc4vqpralhx" # TODO: get it from config
+ self._repo_base_url = self.gitops_config["git_base_url"]
+ self._repo_user = self.gitops_config["user"]
+ self._pubkey = self.gitops_config["pubkey"]
self._workflow_debug = "true"
self._workflow_dry_run = "false"
self._workflows = {