def _create_configmap_object()

in config_operator/config_operator/k8s/K8sConfigMap.py [0:0]


    def _create_configmap_object(self):

        metadata = client.V1ObjectMeta(
            name=self._configmap_name ,
            namespace=self._namespace,
        )

        data = {}        
        for f in self._git_remote_config.get_files():
            try:
                data[f] = self._git_remote_config.get_file_content(f)
            except UnreadableFileException as e:
                logger.error(f'file {f} cannot be read, ignored', e)
 
        configmap = client.V1ConfigMap(
            api_version="v1",
            kind="ConfigMap",
            data=data,
            metadata=metadata
        )
        return configmap