mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
feat(host): create disk from encrypted snapshot (#14256)
support create disk from encrypted snapshot, new disk encrypt info must same with snapshot, and should used with libqemuio2.12. area: host,host-image,fetcherfs Signed-off-by: wanyaoqi <wanyaoqi1995@163.com>
This commit is contained in:
+7
-1
@@ -63,7 +63,7 @@ func initFetcherFs() (*FetcherFs, error) {
|
||||
url: opt.Url,
|
||||
}
|
||||
if err := fetcherFs.fetchMetaInfo(); err != nil {
|
||||
return nil, err
|
||||
return nil, errors.Wrapf(err, "fetch meta info")
|
||||
}
|
||||
segs := strings.Split(opt.Url, "/")
|
||||
if len(segs[len(segs)-1]) == 0 {
|
||||
@@ -271,5 +271,11 @@ func (fs *FetcherFs) destory() error {
|
||||
func NewRequestHeader() http.Header {
|
||||
header := http.Header{}
|
||||
header.Set("X-Auth-Token", opt.Token)
|
||||
if len(opt.EncryptKey) > 0 {
|
||||
header.Set("X-Encrypt-Key", opt.EncryptKey)
|
||||
}
|
||||
if len(opt.EncryptAlg) > 0 {
|
||||
header.Set("X-Encrypt-Alg", opt.EncryptAlg)
|
||||
}
|
||||
return header
|
||||
}
|
||||
|
||||
@@ -31,6 +31,10 @@ type Options struct {
|
||||
MountPoint string `help:"mount path of fuse fs" required:"true"`
|
||||
Debug bool `help:"enable debug go fuse"`
|
||||
Foreground bool `help:"run in foreground"`
|
||||
|
||||
// image encrypt info
|
||||
EncryptAlg string `help:"image encrypt alg"`
|
||||
EncryptKey string `help:"image encrypt password"`
|
||||
}
|
||||
|
||||
var opt = &Options{}
|
||||
|
||||
Reference in New Issue
Block a user