Documentation
¶
Index ¶
Constants ¶
const TemplateAsset = `` /* 21060-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
func Generate ¶
Generate executes the default template asset on File object if no custom template path is provided otherwise it uses the template found in the path.
func HasDirective ¶
HasDirective returns if the directive is present or not.
func SetCurrentConfig ¶
func SetCurrentConfig(config *File)
SetCurrentConfig sets the provided configuration as the current configuration.
Types ¶
type Directives ¶
Directives represents the configuration directives type holding directives mapped to their respective values.
func GetDirectives ¶
func GetDirectives(reader io.Reader) (Directives, error)
GetDirectives parses configuration directives from reader and returns a directive map with associated values.
type File ¶
type File struct { AllowSetuid bool `default:"yes" authorized:"yes,no" directive:"allow setuid"` AllowIpcNs bool `default:"yes" authorized:"yes,no" directive:"allow ipc ns"` AllowPidNs bool `default:"yes" authorized:"yes,no" directive:"allow pid ns"` AllowUserNs bool `default:"yes" authorized:"yes,no" directive:"allow user ns"` AllowUtsNs bool `default:"yes" authorized:"yes,no" directive:"allow uts ns"` ConfigPasswd bool `default:"yes" authorized:"yes,no" directive:"config passwd"` ConfigGroup bool `default:"yes" authorized:"yes,no" directive:"config group"` ConfigResolvConf bool `default:"yes" authorized:"yes,no" directive:"config resolv_conf"` MountProc bool `default:"yes" authorized:"yes,no" directive:"mount proc"` MountSys bool `default:"yes" authorized:"yes,no" directive:"mount sys"` MountDevPts bool `default:"yes" authorized:"yes,no" directive:"mount devpts"` MountHome bool `default:"yes" authorized:"yes,no" directive:"mount home"` MountTmp bool `default:"yes" authorized:"yes,no" directive:"mount tmp"` MountHostfs bool `default:"no" authorized:"yes,no" directive:"mount hostfs"` UserBindControl bool `default:"yes" authorized:"yes,no" directive:"user bind control"` EnableFusemount bool `default:"yes" authorized:"yes,no" directive:"enable fusemount"` EnableUnderlay bool `default:"yes" authorized:"yes,no" directive:"enable underlay"` MountSlave bool `default:"yes" authorized:"yes,no" directive:"mount slave"` AllowContainerSIF bool `default:"yes" authorized:"yes,no" directive:"allow container sif"` AllowContainerEncrypted bool `default:"yes" authorized:"yes,no" directive:"allow container encrypted"` AllowContainerSquashfs bool `default:"yes" authorized:"yes,no" directive:"allow container squashfs"` AllowContainerExtfs bool `default:"yes" authorized:"yes,no" directive:"allow container extfs"` AllowContainerDir bool `default:"yes" authorized:"yes,no" directive:"allow container dir"` AllowKernelSquashfs bool `default:"yes" authorized:"yes,no" directive:"allow kernel squashfs"` AllowKernelExtfs bool `default:"yes" authorized:"yes,no" directive:"allow kernel extfs"` AlwaysUseNv bool `default:"no" authorized:"yes,no" directive:"always use nv"` UseNvCCLI bool `default:"no" authorized:"yes,no" directive:"use nvidia-container-cli"` AlwaysUseRocm bool `default:"no" authorized:"yes,no" directive:"always use rocm"` MaxLoopDevices uint `default:"256" directive:"max loop devices"` SessiondirMaxSize uint `default:"64" directive:"sessiondir max size"` MountDev string `default:"yes" authorized:"yes,no,minimal" directive:"mount dev"` EnableOverlay string `default:"try" authorized:"yes,no,try" directive:"enable overlay"` BindPath []string `default:"/etc/localtime,/etc/hosts" directive:"bind path"` LimitContainerOwners []string `directive:"limit container owners"` LimitContainerGroups []string `directive:"limit container groups"` LimitContainerPaths []string `directive:"limit container paths"` AllowNetUsers []string `directive:"allow net users"` AllowNetGroups []string `directive:"allow net groups"` AllowNetNetworks []string `directive:"allow net networks"` AllowNetnsPaths []string `directive:"allow netns paths"` RootDefaultCapabilities string `default:"full" authorized:"full,file,no" directive:"root default capabilities"` MemoryFSType string `default:"tmpfs" authorized:"tmpfs,ramfs" directive:"memory fs type"` CniConfPath string `directive:"cni configuration path"` CniPluginPath string `directive:"cni plugin path"` CryptsetupPath string `directive:"cryptsetup path"` GoPath string `directive:"go path"` LdconfigPath string `directive:"ldconfig path"` MksquashfsPath string `directive:"mksquashfs path"` MksquashfsProcs uint `default:"0" directive:"mksquashfs procs"` MksquashfsMem string `directive:"mksquashfs mem"` NvidiaContainerCliPath string `directive:"nvidia-container-cli path"` UnsquashfsPath string `directive:"unsquashfs path"` DownloadConcurrency uint `default:"3" directive:"download concurrency"` DownloadPartSize uint `default:"5242880" directive:"download part size"` DownloadBufferSize uint `default:"32768" directive:"download buffer size"` SystemdCgroups bool `default:"yes" authorized:"yes,no" directive:"systemd cgroups"` SIFFUSE bool `default:"no" authorized:"yes,no" directive:"sif fuse"` OCIMode bool `default:"no" authorized:"yes,no" directive:"oci mode"` TmpSandboxAllowed bool `default:"yes" authorized:"yes,no" directive:"tmp sandbox"` }
File describes the singularity.conf file options
func GetConfig ¶
func GetConfig(directives Directives) (*File, error)
GetConfig sets the corresponding interface fields associated with directives.
func GetCurrentConfig ¶
func GetCurrentConfig() *File
GetCurrentConfig returns the current configuration if any.