Files
sunhpc/internal/pkg/config/mounts.go
2026-04-29 22:52:33 +08:00

24 lines
636 B
Go

package config
import (
"gitea.sunhpc.com/kelvin/sunhpc/internal/pkg/util"
)
// A MountEntry represents a bind mount that is applied to an image
// during exec and shell.
type MountEntry struct {
Source string `yaml:"source"`
Dest string `yaml:"dest,omitempty"`
ReadOnlyP *bool `yaml:"readonly,omitempty"`
Options string `yaml:"options,omitempty"` // ignored at the moment
CopyP *bool `yaml:"copy,omitempty"` // temporarily copy the file into the image
}
func (mount MountEntry) ReadOnly() bool {
return util.BoolP(mount.ReadOnlyP)
}
func (mount MountEntry) Copy() bool {
return util.BoolP(mount.CopyP)
}