diff --git a/snapshot/mount_option.go b/snapshot/mount_option.go index 657a6e271f..0e161629a6 100644 --- a/snapshot/mount_option.go +++ b/snapshot/mount_option.go @@ -405,7 +405,7 @@ func EncodeKataVirtualVolumeToBase64(volume KataVirtualVolume) (string, error) { if err != nil { return "", errors.Wrapf(err, "marshal KataVirtualVolume object") } - log.L.Infof("Mount info with kata volume %s", validKataVirtualVolumeJSON) + log.L.Infof("encode kata volume %s", validKataVirtualVolumeJSON) option := base64.StdEncoding.EncodeToString(validKataVirtualVolumeJSON) return option, nil } diff --git a/snapshot/snapshot.go b/snapshot/snapshot.go index 71507032d6..47a1bc7ae2 100644 --- a/snapshot/snapshot.go +++ b/snapshot/snapshot.go @@ -843,16 +843,8 @@ func overlayMount(options []string) []mount.Mount { // `s` and `id` can represent a different layer, it's useful when View an image func (o *snapshotter) mountRemote(ctx context.Context, labels map[string]string, s storage.Snapshot, id string) ([]mount.Mount, error) { var overlayOptions []string - if s.Kind == snapshots.KindActive { - overlayOptions = append(overlayOptions, - fmt.Sprintf("workdir=%s", o.workPath(s.ID)), - fmt.Sprintf("upperdir=%s", o.upperPath(s.ID)), - ) - if _, ok := labels[label.OverlayfsVolatileOpt]; ok { - overlayOptions = append(overlayOptions, "volatile") - } - } else if len(s.ParentIDs) == 1 { - return bindMount(o.upperPath(s.ParentIDs[0]), "ro"), nil + if _, ok := labels[label.OverlayfsVolatileOpt]; ok { + overlayOptions = append(overlayOptions, "volatile") } lowerPaths := make([]string, 0, 8) @@ -862,7 +854,12 @@ func (o *snapshotter) mountRemote(ctx context.Context, labels map[string]string, } lowerPaths = append(lowerPaths, lowerPathNydus) - if s.Kind == snapshots.KindView { + if s.Kind == snapshots.KindActive { + overlayOptions = append(overlayOptions, + fmt.Sprintf("workdir=%s", o.workPath(s.ID)), + fmt.Sprintf("upperdir=%s", o.upperPath(s.ID)), + ) + } else if s.Kind == snapshots.KindView { lowerPathNormal, err := o.lowerPath(s.ID) if err != nil { return nil, errors.Wrapf(err, "failed to locate overlay lowerdir for view snapshot")