(self)
return status
Verify the structure of an image repository
Verify the structure of an image repository
Verify the structure of an image repository
def verify_image(self):
        """Verify the structure of an image repository"""
        Msg().out("Info: loading structure", l=Msg.INF)
        structure = self._load_structure(self.cur_tagdir)
        if not structure:
            Msg().err("Error: load of image tag structure failed")
            return False
        Msg().out("Info: verifying layers", l=Msg.INF)
        status = True
        if "ancestry" in structure and "has_json_f" in structure:
            status = self._verify_image_v1(structure)
        elif "manifest" in structure:
            if "fsLayers" in structure["manifest"]:
                status = self._verify_image_v2_s1(structure)
            elif "layers" in structure["manifest"]:
                status = self._verify_image_v2_s2(structure)
        for layer_id in structure["repolayers"]:
            if "layer_f" not in structure["repolayers"][layer_id]:
                Msg().err("Error: layer file not found in structure",
                          layer_id)
                status = False
                continue
            layer_status = self._verify_layer_file(structure, layer_id)
            if not layer_status:
                status = False
                continue
            Msg().out("Info: layer ok:", layer_id, l=Msg.INF)
        return status
def verify_image ( self ) : Msg ( ) . out ( "Info: loading structure" , l = Msg . INF ) structure = self . _load_structure ( self . cur_tagdir ) if not structure : Msg ( ) . err ( "Error: load of image tag structure failed" ) return False Msg ( ) . out ( "Info: verifying layers" , l = Msg . INF ) status = True if "ancestry" in structure and "has_json_f" in structure : status = self . _verify_image_v1 ( structure ) elif "manifest" in structure : if "fsLayers" in structure [ "manifest" ] : status = self . _verify_image_v2_s1 ( structure ) elif "layers" in structure [ "manifest" ] : status = self . _verify_image_v2_s2 ( structure ) for layer_id in structure [ "repolayers" ] : if "layer_f" not in structure [ "repolayers" ] [ layer_id ] : Msg ( ) . err ( "Error: layer file not found in structure" , layer_id ) status = False continue layer_status = self . _verify_layer_file ( structure , layer_id ) if not layer_status : status = False continue Msg ( ) . out ( "Info: layer ok:" , layer_id , l = Msg . INF ) return status