def _fix_yaml(self): # Replace image reference if we built it in this run with open(os.path.join(self.ceph_dir, 'operator.yaml')) as file: docs = yaml.load_all(file, Loader=yaml.FullLoader) for doc in docs: try: image = doc['spec']['template']['spec'][ 'containers'][0]['image'] break except KeyError: pass replacements = {image: self.rook_image} recursive_replace(dir=self.ceph_dir, replacements=replacements)
def _fix_yaml(self): # Replacements are to point container paths and/or versions to the # expected ones to test. if converter('@bool', settings.SES.BUILD_ROOK_FROM_GIT): # Replace image reference if we built it in this run with open(os.path.join(self.ceph_dir, 'operator.yaml')) as file: docs = yaml.load_all(file, Loader=yaml.FullLoader) for doc in docs: try: image = doc['spec']['template']['spec'][ 'containers'][0]['image'] break except KeyError: pass logger.info("replacing %s by %s", image, self.rook_image) replacements = {image: self.rook_image} recursive_replace(self.ceph_dir, replacements) with open(os.path.join(self.ceph_dir, 'cluster.yaml')) as file: docs = yaml.load_all(file, Loader=yaml.FullLoader) for doc in docs: try: image = doc['spec']['cephVersion']['image'] break except KeyError: pass logger.info("replacing %s by %s", image, settings( f"SES.{settings.SES.TARGET}.ceph_image")) replacements = {image: settings( f"SES.{settings.SES.TARGET}.ceph_image")} recursive_replace(self.ceph_dir, replacements) else: replacements = settings( f'SES.{settings.SES.TARGET}.yaml_substitutions') recursive_replace(self.ceph_dir, replacements)
def _fix_yaml(self): # Replacements are to point container paths and/or versions to the # expected ones to test. replacements = settings( f'SES.{settings.SES.TARGET}.yaml_substitutions') recursive_replace(self.ceph_dir, replacements)
def _fix_chart_values(self): # Replacements are to point container paths and/or versions to the # expected ones to test. replacements = settings( f'SES.{settings.SES.TARGET}.helm_values_substitutions') recursive_replace(self.helm_dir, replacements)