(self, structure, imagerepo, tag)
return [imagetag]
Load a container image into a repository mimic docker load
Load a container image into a repository mimic docker load
Load a container image into a repository mimic docker load
def _load_image_step2(self, structure, imagerepo, tag):
        """Load a container image into a repository mimic docker load"""
        imagetag = imagerepo + ':' + tag
        (json_config_file, layers) = \
                self._get_from_manifest(structure, imagetag)
        if json_config_file:
            layer_id = json_config_file.replace(".json", "")
            json_file = structure["repoconfigs"][json_config_file]["json_f"]
            self._move_layer_to_v1repo(json_file, layer_id, "container.json")
        top_layer_id = self._find_top_layer_id(structure)
        layers = self._sorted_layers(structure, top_layer_id)
        for layer_id in layers:
            Msg().out("Info: adding layer:", layer_id, l=Msg.INF)
            if str(structure["repolayers"][layer_id]["VERSION"]) != "1.0":
                Msg().err("Error: layer version unknown")
                return []
            for layer_item in ("json_f", "layer_f"):
                filename = str(structure["repolayers"][layer_id][layer_item])
                if not self._move_layer_to_v1repo(filename, layer_id):
                    Msg().err("Error: copying %s file %s"
                              % (layer_item[:-2], filename), l=Msg.VER)
                    return []
        self.localrepo.save_json("ancestry", layers)
        if self._imagerepo:
            imagetag = self._imagerepo + ':' + tag
        return [imagetag]
def _load_image_step2 ( self , structure , imagerepo , tag ) : imagetag = imagerepo + ':' + tag ( json_config_file , layers ) = self . _get_from_manifest ( structure , imagetag ) if json_config_file : layer_id = json_config_file . replace ( ".json" , "" ) json_file = structure [ "repoconfigs" ] [ json_config_file ] [ "json_f" ] self . _move_layer_to_v1repo ( json_file , layer_id , "container.json" ) top_layer_id = self . _find_top_layer_id ( structure ) layers = self . _sorted_layers ( structure , top_layer_id ) for layer_id in layers : Msg ( ) . out ( "Info: adding layer:" , layer_id , l = Msg . INF ) if str ( structure [ "repolayers" ] [ layer_id ] [ "VERSION" ] ) != "1.0" : Msg ( ) . err ( "Error: layer version unknown" ) return [ ] for layer_item in ( "json_f" , "layer_f" ) : filename = str ( structure [ "repolayers" ] [ layer_id ] [ layer_item ] ) if not self . _move_layer_to_v1repo ( filename , layer_id ) : Msg ( ) . err ( "Error: copying %s file %s" % ( layer_item [ : - 2 ] , filename ) , l = Msg . VER ) return [ ] self . localrepo . save_json ( "ancestry" , layers ) if self . _imagerepo : imagetag = self . _imagerepo + ':' + tag return [ imagetag ]