从minio下载zip文件报错,无响应

1.问题描述:

Traceback (most recent call last):
  File "/storage-initializer/scripts/initializer-entrypoint", line 14, in <module>
    kserve.Storage.download(src_uri, dest_path)
  File "/usr/local/lib/python3.7/site-packages/kserve/storage.py", line 75, in download
    return Storage._download_from_uri(uri, out_dir)
  File "/usr/local/lib/python3.7/site-packages/kserve/storage.py", line 299, in _download_from_uri
    ", ".join(zip_content_types))
RuntimeError: URI: http://minio.storage.svc.cluster.local/wangzy-p/operator/mind/model/mind_20220902.zip did not respond with any of following 'Content-Type': application/x-zip-compressed, application/zip, application/zip-compressed

2.解决方案

fput_object默认是'application/octet-stream',修改为'application/zip'就可以了

def fput_object(self, bucket_name, object_name, file_path,
                content_type='application/octet-stream',
                metadata=None, sse=None, progress=None,
                part_size=DEFAULT_PART_SIZE):

修改为:

client.fput_object(bucket_name, remote_path, local_file, content_type="application/zip")

你可能感兴趣的:(k8s,minio,kubernetes)