mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Do not create unnecessary tmpfs mount when hint.share = container.
If there is only 1 container that is using an annotated tmpfs mount, then we create a shared master mount but that is never used. In containerMounter.mountSubmounts(), we mount a new tmpfs mount if !hint.isSupported(). PiperOrigin-RevId: 515179844
This commit is contained in:
@@ -184,6 +184,8 @@ func (m *mountHint) setOptions(val string) error {
|
||||
}
|
||||
|
||||
func (m *mountHint) isSupported() bool {
|
||||
// TODO(b/142076984): Only support tmpfs for now. Bind mounts require a
|
||||
// common gofer to mount all shared volumes.
|
||||
return m.mount.Type == tmpfs.Name && m.share == pod
|
||||
}
|
||||
|
||||
|
||||
+1
-3
@@ -919,9 +919,7 @@ func (c *containerMounter) mountTmp(ctx context.Context, conf *config.Config, cr
|
||||
func (c *containerMounter) processHints(conf *config.Config, creds *auth.Credentials) error {
|
||||
ctx := c.k.SupervisorContext()
|
||||
for _, hint := range c.hints.mounts {
|
||||
// TODO(b/142076984): Only support tmpfs for now. Bind mounts require a
|
||||
// common gofer to mount all shared volumes.
|
||||
if hint.mount.Type != tmpfs.Name {
|
||||
if !hint.isSupported() {
|
||||
continue
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user