예제 #1
0
    def _is_image_there(self, image):
        image_obj = Image(image)

        for registry, creds in self.registry_creds['auths'].items():
            # Getting the credentials for the image_obj
            registry_obj = urlparse(registry)
            if registry_obj.netloc != image_obj.registry:
                continue
            image_obj.auth = (creds['username'], creds['password'])

            # Checking if the image is already
            # in the registry
            if image_obj:
                return True

        return False
    def _is_image_there(self, image):
        image_obj = Image(image)

        for registry, creds in self.registry_creds["auths"].items():
            # Getting the credentials for the image_obj
            if "//" not in registry:
                registry = "//" + registry
            registry_obj = urlparse(registry)

            if registry_obj.netloc != image_obj.registry:
                continue
            image_obj.auth = (creds["username"], creds["password"])

            # Checking if the image is already
            # in the registry
            if image_obj:
                return True

        return False