mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Make gofer mount readonly when overlay is enabled
No writes are expected to the underlying filesystem when using --overlay. PiperOrigin-RevId: 314171457
This commit is contained in:
committed by
gVisor bot
parent
474d9b2609
commit
16100d18cb
+2
-2
@@ -168,7 +168,7 @@ func (g *Gofer) Execute(_ context.Context, f *flag.FlagSet, args ...interface{})
|
||||
// Start with root mount, then add any other additional mount as needed.
|
||||
ats := make([]p9.Attacher, 0, len(spec.Mounts)+1)
|
||||
ap, err := fsgofer.NewAttachPoint("/", fsgofer.Config{
|
||||
ROMount: spec.Root.Readonly,
|
||||
ROMount: spec.Root.Readonly || conf.Overlay,
|
||||
PanicOnWrite: g.panicOnWrite,
|
||||
})
|
||||
if err != nil {
|
||||
@@ -181,7 +181,7 @@ func (g *Gofer) Execute(_ context.Context, f *flag.FlagSet, args ...interface{})
|
||||
for _, m := range spec.Mounts {
|
||||
if specutils.Is9PMount(m) {
|
||||
cfg := fsgofer.Config{
|
||||
ROMount: isReadonlyMount(m.Options),
|
||||
ROMount: isReadonlyMount(m.Options) || conf.Overlay,
|
||||
PanicOnWrite: g.panicOnWrite,
|
||||
HostUDS: conf.FSGoferHostUDS,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user