id
int32 0
167k
| repo
stringlengths 5
54
| path
stringlengths 4
155
| func_name
stringlengths 1
118
| original_string
stringlengths 52
85.5k
| language
stringclasses 1
value | code
stringlengths 52
85.5k
| code_tokens
listlengths 21
1.41k
| docstring
stringlengths 6
2.61k
| docstring_tokens
listlengths 3
215
| sha
stringlengths 40
40
| url
stringlengths 85
252
|
---|---|---|---|---|---|---|---|---|---|---|---|
14,400 |
opencontainers/runtime-tools
|
generate/generate.go
|
AddProcessRlimits
|
func (g *Generator) AddProcessRlimits(rType string, rHard uint64, rSoft uint64) {
g.initConfigProcess()
for i, rlimit := range g.Config.Process.Rlimits {
if rlimit.Type == rType {
g.Config.Process.Rlimits[i].Hard = rHard
g.Config.Process.Rlimits[i].Soft = rSoft
return
}
}
newRlimit := rspec.POSIXRlimit{
Type: rType,
Hard: rHard,
Soft: rSoft,
}
g.Config.Process.Rlimits = append(g.Config.Process.Rlimits, newRlimit)
}
|
go
|
func (g *Generator) AddProcessRlimits(rType string, rHard uint64, rSoft uint64) {
g.initConfigProcess()
for i, rlimit := range g.Config.Process.Rlimits {
if rlimit.Type == rType {
g.Config.Process.Rlimits[i].Hard = rHard
g.Config.Process.Rlimits[i].Soft = rSoft
return
}
}
newRlimit := rspec.POSIXRlimit{
Type: rType,
Hard: rHard,
Soft: rSoft,
}
g.Config.Process.Rlimits = append(g.Config.Process.Rlimits, newRlimit)
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"AddProcessRlimits",
"(",
"rType",
"string",
",",
"rHard",
"uint64",
",",
"rSoft",
"uint64",
")",
"{",
"g",
".",
"initConfigProcess",
"(",
")",
"\n",
"for",
"i",
",",
"rlimit",
":=",
"range",
"g",
".",
"Config",
".",
"Process",
".",
"Rlimits",
"{",
"if",
"rlimit",
".",
"Type",
"==",
"rType",
"{",
"g",
".",
"Config",
".",
"Process",
".",
"Rlimits",
"[",
"i",
"]",
".",
"Hard",
"=",
"rHard",
"\n",
"g",
".",
"Config",
".",
"Process",
".",
"Rlimits",
"[",
"i",
"]",
".",
"Soft",
"=",
"rSoft",
"\n",
"return",
"\n",
"}",
"\n",
"}",
"\n\n",
"newRlimit",
":=",
"rspec",
".",
"POSIXRlimit",
"{",
"Type",
":",
"rType",
",",
"Hard",
":",
"rHard",
",",
"Soft",
":",
"rSoft",
",",
"}",
"\n",
"g",
".",
"Config",
".",
"Process",
".",
"Rlimits",
"=",
"append",
"(",
"g",
".",
"Config",
".",
"Process",
".",
"Rlimits",
",",
"newRlimit",
")",
"\n",
"}"
] |
// AddProcessRlimits adds rlimit into g.Config.Process.Rlimits.
|
[
"AddProcessRlimits",
"adds",
"rlimit",
"into",
"g",
".",
"Config",
".",
"Process",
".",
"Rlimits",
"."
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L530-L546
|
14,401 |
opencontainers/runtime-tools
|
generate/generate.go
|
RemoveProcessRlimits
|
func (g *Generator) RemoveProcessRlimits(rType string) {
if g.Config == nil || g.Config.Process == nil {
return
}
for i, rlimit := range g.Config.Process.Rlimits {
if rlimit.Type == rType {
g.Config.Process.Rlimits = append(g.Config.Process.Rlimits[:i], g.Config.Process.Rlimits[i+1:]...)
return
}
}
}
|
go
|
func (g *Generator) RemoveProcessRlimits(rType string) {
if g.Config == nil || g.Config.Process == nil {
return
}
for i, rlimit := range g.Config.Process.Rlimits {
if rlimit.Type == rType {
g.Config.Process.Rlimits = append(g.Config.Process.Rlimits[:i], g.Config.Process.Rlimits[i+1:]...)
return
}
}
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"RemoveProcessRlimits",
"(",
"rType",
"string",
")",
"{",
"if",
"g",
".",
"Config",
"==",
"nil",
"||",
"g",
".",
"Config",
".",
"Process",
"==",
"nil",
"{",
"return",
"\n",
"}",
"\n",
"for",
"i",
",",
"rlimit",
":=",
"range",
"g",
".",
"Config",
".",
"Process",
".",
"Rlimits",
"{",
"if",
"rlimit",
".",
"Type",
"==",
"rType",
"{",
"g",
".",
"Config",
".",
"Process",
".",
"Rlimits",
"=",
"append",
"(",
"g",
".",
"Config",
".",
"Process",
".",
"Rlimits",
"[",
":",
"i",
"]",
",",
"g",
".",
"Config",
".",
"Process",
".",
"Rlimits",
"[",
"i",
"+",
"1",
":",
"]",
"...",
")",
"\n",
"return",
"\n",
"}",
"\n",
"}",
"\n",
"}"
] |
// RemoveProcessRlimits removes a rlimit from g.Config.Process.Rlimits.
|
[
"RemoveProcessRlimits",
"removes",
"a",
"rlimit",
"from",
"g",
".",
"Config",
".",
"Process",
".",
"Rlimits",
"."
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L549-L559
|
14,402 |
opencontainers/runtime-tools
|
generate/generate.go
|
ClearProcessRlimits
|
func (g *Generator) ClearProcessRlimits() {
if g.Config == nil || g.Config.Process == nil {
return
}
g.Config.Process.Rlimits = []rspec.POSIXRlimit{}
}
|
go
|
func (g *Generator) ClearProcessRlimits() {
if g.Config == nil || g.Config.Process == nil {
return
}
g.Config.Process.Rlimits = []rspec.POSIXRlimit{}
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"ClearProcessRlimits",
"(",
")",
"{",
"if",
"g",
".",
"Config",
"==",
"nil",
"||",
"g",
".",
"Config",
".",
"Process",
"==",
"nil",
"{",
"return",
"\n",
"}",
"\n",
"g",
".",
"Config",
".",
"Process",
".",
"Rlimits",
"=",
"[",
"]",
"rspec",
".",
"POSIXRlimit",
"{",
"}",
"\n",
"}"
] |
// ClearProcessRlimits clear g.Config.Process.Rlimits.
|
[
"ClearProcessRlimits",
"clear",
"g",
".",
"Config",
".",
"Process",
".",
"Rlimits",
"."
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L562-L567
|
14,403 |
opencontainers/runtime-tools
|
generate/generate.go
|
ClearProcessAdditionalGids
|
func (g *Generator) ClearProcessAdditionalGids() {
if g.Config == nil || g.Config.Process == nil {
return
}
g.Config.Process.User.AdditionalGids = []uint32{}
}
|
go
|
func (g *Generator) ClearProcessAdditionalGids() {
if g.Config == nil || g.Config.Process == nil {
return
}
g.Config.Process.User.AdditionalGids = []uint32{}
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"ClearProcessAdditionalGids",
"(",
")",
"{",
"if",
"g",
".",
"Config",
"==",
"nil",
"||",
"g",
".",
"Config",
".",
"Process",
"==",
"nil",
"{",
"return",
"\n",
"}",
"\n",
"g",
".",
"Config",
".",
"Process",
".",
"User",
".",
"AdditionalGids",
"=",
"[",
"]",
"uint32",
"{",
"}",
"\n",
"}"
] |
// ClearProcessAdditionalGids clear g.Config.Process.AdditionalGids.
|
[
"ClearProcessAdditionalGids",
"clear",
"g",
".",
"Config",
".",
"Process",
".",
"AdditionalGids",
"."
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L570-L575
|
14,404 |
opencontainers/runtime-tools
|
generate/generate.go
|
AddProcessAdditionalGid
|
func (g *Generator) AddProcessAdditionalGid(gid uint32) {
g.initConfigProcess()
for _, group := range g.Config.Process.User.AdditionalGids {
if group == gid {
return
}
}
g.Config.Process.User.AdditionalGids = append(g.Config.Process.User.AdditionalGids, gid)
}
|
go
|
func (g *Generator) AddProcessAdditionalGid(gid uint32) {
g.initConfigProcess()
for _, group := range g.Config.Process.User.AdditionalGids {
if group == gid {
return
}
}
g.Config.Process.User.AdditionalGids = append(g.Config.Process.User.AdditionalGids, gid)
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"AddProcessAdditionalGid",
"(",
"gid",
"uint32",
")",
"{",
"g",
".",
"initConfigProcess",
"(",
")",
"\n",
"for",
"_",
",",
"group",
":=",
"range",
"g",
".",
"Config",
".",
"Process",
".",
"User",
".",
"AdditionalGids",
"{",
"if",
"group",
"==",
"gid",
"{",
"return",
"\n",
"}",
"\n",
"}",
"\n",
"g",
".",
"Config",
".",
"Process",
".",
"User",
".",
"AdditionalGids",
"=",
"append",
"(",
"g",
".",
"Config",
".",
"Process",
".",
"User",
".",
"AdditionalGids",
",",
"gid",
")",
"\n",
"}"
] |
// AddProcessAdditionalGid adds an additional gid into g.Config.Process.AdditionalGids.
|
[
"AddProcessAdditionalGid",
"adds",
"an",
"additional",
"gid",
"into",
"g",
".",
"Config",
".",
"Process",
".",
"AdditionalGids",
"."
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L578-L586
|
14,405 |
opencontainers/runtime-tools
|
generate/generate.go
|
SetProcessSelinuxLabel
|
func (g *Generator) SetProcessSelinuxLabel(label string) {
g.initConfigProcess()
g.Config.Process.SelinuxLabel = label
}
|
go
|
func (g *Generator) SetProcessSelinuxLabel(label string) {
g.initConfigProcess()
g.Config.Process.SelinuxLabel = label
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"SetProcessSelinuxLabel",
"(",
"label",
"string",
")",
"{",
"g",
".",
"initConfigProcess",
"(",
")",
"\n",
"g",
".",
"Config",
".",
"Process",
".",
"SelinuxLabel",
"=",
"label",
"\n",
"}"
] |
// SetProcessSelinuxLabel sets g.Config.Process.SelinuxLabel.
|
[
"SetProcessSelinuxLabel",
"sets",
"g",
".",
"Config",
".",
"Process",
".",
"SelinuxLabel",
"."
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L589-L592
|
14,406 |
opencontainers/runtime-tools
|
generate/generate.go
|
SetLinuxCgroupsPath
|
func (g *Generator) SetLinuxCgroupsPath(path string) {
g.initConfigLinux()
g.Config.Linux.CgroupsPath = path
}
|
go
|
func (g *Generator) SetLinuxCgroupsPath(path string) {
g.initConfigLinux()
g.Config.Linux.CgroupsPath = path
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"SetLinuxCgroupsPath",
"(",
"path",
"string",
")",
"{",
"g",
".",
"initConfigLinux",
"(",
")",
"\n",
"g",
".",
"Config",
".",
"Linux",
".",
"CgroupsPath",
"=",
"path",
"\n",
"}"
] |
// SetLinuxCgroupsPath sets g.Config.Linux.CgroupsPath.
|
[
"SetLinuxCgroupsPath",
"sets",
"g",
".",
"Config",
".",
"Linux",
".",
"CgroupsPath",
"."
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L595-L598
|
14,407 |
opencontainers/runtime-tools
|
generate/generate.go
|
SetLinuxIntelRdtL3CacheSchema
|
func (g *Generator) SetLinuxIntelRdtL3CacheSchema(schema string) {
g.initConfigLinuxIntelRdt()
g.Config.Linux.IntelRdt.L3CacheSchema = schema
}
|
go
|
func (g *Generator) SetLinuxIntelRdtL3CacheSchema(schema string) {
g.initConfigLinuxIntelRdt()
g.Config.Linux.IntelRdt.L3CacheSchema = schema
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"SetLinuxIntelRdtL3CacheSchema",
"(",
"schema",
"string",
")",
"{",
"g",
".",
"initConfigLinuxIntelRdt",
"(",
")",
"\n",
"g",
".",
"Config",
".",
"Linux",
".",
"IntelRdt",
".",
"L3CacheSchema",
"=",
"schema",
"\n",
"}"
] |
// SetLinuxIntelRdtL3CacheSchema sets g.Config.Linux.IntelRdt.L3CacheSchema
|
[
"SetLinuxIntelRdtL3CacheSchema",
"sets",
"g",
".",
"Config",
".",
"Linux",
".",
"IntelRdt",
".",
"L3CacheSchema"
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L601-L604
|
14,408 |
opencontainers/runtime-tools
|
generate/generate.go
|
SetLinuxMountLabel
|
func (g *Generator) SetLinuxMountLabel(label string) {
g.initConfigLinux()
g.Config.Linux.MountLabel = label
}
|
go
|
func (g *Generator) SetLinuxMountLabel(label string) {
g.initConfigLinux()
g.Config.Linux.MountLabel = label
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"SetLinuxMountLabel",
"(",
"label",
"string",
")",
"{",
"g",
".",
"initConfigLinux",
"(",
")",
"\n",
"g",
".",
"Config",
".",
"Linux",
".",
"MountLabel",
"=",
"label",
"\n",
"}"
] |
// SetLinuxMountLabel sets g.Config.Linux.MountLabel.
|
[
"SetLinuxMountLabel",
"sets",
"g",
".",
"Config",
".",
"Linux",
".",
"MountLabel",
"."
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L607-L610
|
14,409 |
opencontainers/runtime-tools
|
generate/generate.go
|
SetProcessOOMScoreAdj
|
func (g *Generator) SetProcessOOMScoreAdj(adj int) {
g.initConfigProcess()
g.Config.Process.OOMScoreAdj = &adj
}
|
go
|
func (g *Generator) SetProcessOOMScoreAdj(adj int) {
g.initConfigProcess()
g.Config.Process.OOMScoreAdj = &adj
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"SetProcessOOMScoreAdj",
"(",
"adj",
"int",
")",
"{",
"g",
".",
"initConfigProcess",
"(",
")",
"\n",
"g",
".",
"Config",
".",
"Process",
".",
"OOMScoreAdj",
"=",
"&",
"adj",
"\n",
"}"
] |
// SetProcessOOMScoreAdj sets g.Config.Process.OOMScoreAdj.
|
[
"SetProcessOOMScoreAdj",
"sets",
"g",
".",
"Config",
".",
"Process",
".",
"OOMScoreAdj",
"."
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L613-L616
|
14,410 |
opencontainers/runtime-tools
|
generate/generate.go
|
SetLinuxResourcesBlockIOLeafWeight
|
func (g *Generator) SetLinuxResourcesBlockIOLeafWeight(weight uint16) {
g.initConfigLinuxResourcesBlockIO()
g.Config.Linux.Resources.BlockIO.LeafWeight = &weight
}
|
go
|
func (g *Generator) SetLinuxResourcesBlockIOLeafWeight(weight uint16) {
g.initConfigLinuxResourcesBlockIO()
g.Config.Linux.Resources.BlockIO.LeafWeight = &weight
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"SetLinuxResourcesBlockIOLeafWeight",
"(",
"weight",
"uint16",
")",
"{",
"g",
".",
"initConfigLinuxResourcesBlockIO",
"(",
")",
"\n",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"BlockIO",
".",
"LeafWeight",
"=",
"&",
"weight",
"\n",
"}"
] |
// SetLinuxResourcesBlockIOLeafWeight sets g.Config.Linux.Resources.BlockIO.LeafWeight.
|
[
"SetLinuxResourcesBlockIOLeafWeight",
"sets",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"BlockIO",
".",
"LeafWeight",
"."
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L619-L622
|
14,411 |
opencontainers/runtime-tools
|
generate/generate.go
|
SetLinuxResourcesBlockIOWeight
|
func (g *Generator) SetLinuxResourcesBlockIOWeight(weight uint16) {
g.initConfigLinuxResourcesBlockIO()
g.Config.Linux.Resources.BlockIO.Weight = &weight
}
|
go
|
func (g *Generator) SetLinuxResourcesBlockIOWeight(weight uint16) {
g.initConfigLinuxResourcesBlockIO()
g.Config.Linux.Resources.BlockIO.Weight = &weight
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"SetLinuxResourcesBlockIOWeight",
"(",
"weight",
"uint16",
")",
"{",
"g",
".",
"initConfigLinuxResourcesBlockIO",
"(",
")",
"\n",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"BlockIO",
".",
"Weight",
"=",
"&",
"weight",
"\n",
"}"
] |
// SetLinuxResourcesBlockIOWeight sets g.Config.Linux.Resources.BlockIO.Weight.
|
[
"SetLinuxResourcesBlockIOWeight",
"sets",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"BlockIO",
".",
"Weight",
"."
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L663-L666
|
14,412 |
opencontainers/runtime-tools
|
generate/generate.go
|
AddLinuxResourcesBlockIOWeightDevice
|
func (g *Generator) AddLinuxResourcesBlockIOWeightDevice(major int64, minor int64, weight uint16) {
g.initConfigLinuxResourcesBlockIO()
for i, weightDevice := range g.Config.Linux.Resources.BlockIO.WeightDevice {
if weightDevice.Major == major && weightDevice.Minor == minor {
g.Config.Linux.Resources.BlockIO.WeightDevice[i].Weight = &weight
return
}
}
weightDevice := new(rspec.LinuxWeightDevice)
weightDevice.Major = major
weightDevice.Minor = minor
weightDevice.Weight = &weight
g.Config.Linux.Resources.BlockIO.WeightDevice = append(g.Config.Linux.Resources.BlockIO.WeightDevice, *weightDevice)
}
|
go
|
func (g *Generator) AddLinuxResourcesBlockIOWeightDevice(major int64, minor int64, weight uint16) {
g.initConfigLinuxResourcesBlockIO()
for i, weightDevice := range g.Config.Linux.Resources.BlockIO.WeightDevice {
if weightDevice.Major == major && weightDevice.Minor == minor {
g.Config.Linux.Resources.BlockIO.WeightDevice[i].Weight = &weight
return
}
}
weightDevice := new(rspec.LinuxWeightDevice)
weightDevice.Major = major
weightDevice.Minor = minor
weightDevice.Weight = &weight
g.Config.Linux.Resources.BlockIO.WeightDevice = append(g.Config.Linux.Resources.BlockIO.WeightDevice, *weightDevice)
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"AddLinuxResourcesBlockIOWeightDevice",
"(",
"major",
"int64",
",",
"minor",
"int64",
",",
"weight",
"uint16",
")",
"{",
"g",
".",
"initConfigLinuxResourcesBlockIO",
"(",
")",
"\n",
"for",
"i",
",",
"weightDevice",
":=",
"range",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"BlockIO",
".",
"WeightDevice",
"{",
"if",
"weightDevice",
".",
"Major",
"==",
"major",
"&&",
"weightDevice",
".",
"Minor",
"==",
"minor",
"{",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"BlockIO",
".",
"WeightDevice",
"[",
"i",
"]",
".",
"Weight",
"=",
"&",
"weight",
"\n",
"return",
"\n",
"}",
"\n",
"}",
"\n",
"weightDevice",
":=",
"new",
"(",
"rspec",
".",
"LinuxWeightDevice",
")",
"\n",
"weightDevice",
".",
"Major",
"=",
"major",
"\n",
"weightDevice",
".",
"Minor",
"=",
"minor",
"\n",
"weightDevice",
".",
"Weight",
"=",
"&",
"weight",
"\n",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"BlockIO",
".",
"WeightDevice",
"=",
"append",
"(",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"BlockIO",
".",
"WeightDevice",
",",
"*",
"weightDevice",
")",
"\n",
"}"
] |
// AddLinuxResourcesBlockIOWeightDevice adds or sets g.Config.Linux.Resources.BlockIO.WeightDevice.Weight.
|
[
"AddLinuxResourcesBlockIOWeightDevice",
"adds",
"or",
"sets",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"BlockIO",
".",
"WeightDevice",
".",
"Weight",
"."
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L669-L682
|
14,413 |
opencontainers/runtime-tools
|
generate/generate.go
|
DropLinuxResourcesBlockIOWeightDevice
|
func (g *Generator) DropLinuxResourcesBlockIOWeightDevice(major int64, minor int64) {
if g.Config == nil || g.Config.Linux == nil || g.Config.Linux.Resources == nil || g.Config.Linux.Resources.BlockIO == nil {
return
}
for i, weightDevice := range g.Config.Linux.Resources.BlockIO.WeightDevice {
if weightDevice.Major == major && weightDevice.Minor == minor {
if weightDevice.LeafWeight != nil {
newWeightDevice := new(rspec.LinuxWeightDevice)
newWeightDevice.Major = major
newWeightDevice.Minor = minor
newWeightDevice.LeafWeight = weightDevice.LeafWeight
g.Config.Linux.Resources.BlockIO.WeightDevice[i] = *newWeightDevice
} else {
g.Config.Linux.Resources.BlockIO.WeightDevice = append(g.Config.Linux.Resources.BlockIO.WeightDevice[:i], g.Config.Linux.Resources.BlockIO.WeightDevice[i+1:]...)
}
return
}
}
}
|
go
|
func (g *Generator) DropLinuxResourcesBlockIOWeightDevice(major int64, minor int64) {
if g.Config == nil || g.Config.Linux == nil || g.Config.Linux.Resources == nil || g.Config.Linux.Resources.BlockIO == nil {
return
}
for i, weightDevice := range g.Config.Linux.Resources.BlockIO.WeightDevice {
if weightDevice.Major == major && weightDevice.Minor == minor {
if weightDevice.LeafWeight != nil {
newWeightDevice := new(rspec.LinuxWeightDevice)
newWeightDevice.Major = major
newWeightDevice.Minor = minor
newWeightDevice.LeafWeight = weightDevice.LeafWeight
g.Config.Linux.Resources.BlockIO.WeightDevice[i] = *newWeightDevice
} else {
g.Config.Linux.Resources.BlockIO.WeightDevice = append(g.Config.Linux.Resources.BlockIO.WeightDevice[:i], g.Config.Linux.Resources.BlockIO.WeightDevice[i+1:]...)
}
return
}
}
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"DropLinuxResourcesBlockIOWeightDevice",
"(",
"major",
"int64",
",",
"minor",
"int64",
")",
"{",
"if",
"g",
".",
"Config",
"==",
"nil",
"||",
"g",
".",
"Config",
".",
"Linux",
"==",
"nil",
"||",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
"==",
"nil",
"||",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"BlockIO",
"==",
"nil",
"{",
"return",
"\n",
"}",
"\n\n",
"for",
"i",
",",
"weightDevice",
":=",
"range",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"BlockIO",
".",
"WeightDevice",
"{",
"if",
"weightDevice",
".",
"Major",
"==",
"major",
"&&",
"weightDevice",
".",
"Minor",
"==",
"minor",
"{",
"if",
"weightDevice",
".",
"LeafWeight",
"!=",
"nil",
"{",
"newWeightDevice",
":=",
"new",
"(",
"rspec",
".",
"LinuxWeightDevice",
")",
"\n",
"newWeightDevice",
".",
"Major",
"=",
"major",
"\n",
"newWeightDevice",
".",
"Minor",
"=",
"minor",
"\n",
"newWeightDevice",
".",
"LeafWeight",
"=",
"weightDevice",
".",
"LeafWeight",
"\n",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"BlockIO",
".",
"WeightDevice",
"[",
"i",
"]",
"=",
"*",
"newWeightDevice",
"\n",
"}",
"else",
"{",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"BlockIO",
".",
"WeightDevice",
"=",
"append",
"(",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"BlockIO",
".",
"WeightDevice",
"[",
":",
"i",
"]",
",",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"BlockIO",
".",
"WeightDevice",
"[",
"i",
"+",
"1",
":",
"]",
"...",
")",
"\n",
"}",
"\n",
"return",
"\n",
"}",
"\n",
"}",
"\n",
"}"
] |
// DropLinuxResourcesBlockIOWeightDevice drops a item form g.Config.Linux.Resources.BlockIO.WeightDevice.Weight
|
[
"DropLinuxResourcesBlockIOWeightDevice",
"drops",
"a",
"item",
"form",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"BlockIO",
".",
"WeightDevice",
".",
"Weight"
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L685-L704
|
14,414 |
opencontainers/runtime-tools
|
generate/generate.go
|
AddLinuxResourcesBlockIOThrottleReadBpsDevice
|
func (g *Generator) AddLinuxResourcesBlockIOThrottleReadBpsDevice(major int64, minor int64, rate uint64) {
g.initConfigLinuxResourcesBlockIO()
throttleDevices := addOrReplaceBlockIOThrottleDevice(g.Config.Linux.Resources.BlockIO.ThrottleReadBpsDevice, major, minor, rate)
g.Config.Linux.Resources.BlockIO.ThrottleReadBpsDevice = throttleDevices
}
|
go
|
func (g *Generator) AddLinuxResourcesBlockIOThrottleReadBpsDevice(major int64, minor int64, rate uint64) {
g.initConfigLinuxResourcesBlockIO()
throttleDevices := addOrReplaceBlockIOThrottleDevice(g.Config.Linux.Resources.BlockIO.ThrottleReadBpsDevice, major, minor, rate)
g.Config.Linux.Resources.BlockIO.ThrottleReadBpsDevice = throttleDevices
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"AddLinuxResourcesBlockIOThrottleReadBpsDevice",
"(",
"major",
"int64",
",",
"minor",
"int64",
",",
"rate",
"uint64",
")",
"{",
"g",
".",
"initConfigLinuxResourcesBlockIO",
"(",
")",
"\n",
"throttleDevices",
":=",
"addOrReplaceBlockIOThrottleDevice",
"(",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"BlockIO",
".",
"ThrottleReadBpsDevice",
",",
"major",
",",
"minor",
",",
"rate",
")",
"\n",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"BlockIO",
".",
"ThrottleReadBpsDevice",
"=",
"throttleDevices",
"\n",
"}"
] |
// AddLinuxResourcesBlockIOThrottleReadBpsDevice adds or sets g.Config.Linux.Resources.BlockIO.ThrottleReadBpsDevice.
|
[
"AddLinuxResourcesBlockIOThrottleReadBpsDevice",
"adds",
"or",
"sets",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"BlockIO",
".",
"ThrottleReadBpsDevice",
"."
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L707-L711
|
14,415 |
opencontainers/runtime-tools
|
generate/generate.go
|
DropLinuxResourcesBlockIOThrottleReadBpsDevice
|
func (g *Generator) DropLinuxResourcesBlockIOThrottleReadBpsDevice(major int64, minor int64) {
if g.Config == nil || g.Config.Linux == nil || g.Config.Linux.Resources == nil || g.Config.Linux.Resources.BlockIO == nil {
return
}
throttleDevices := dropBlockIOThrottleDevice(g.Config.Linux.Resources.BlockIO.ThrottleReadBpsDevice, major, minor)
g.Config.Linux.Resources.BlockIO.ThrottleReadBpsDevice = throttleDevices
}
|
go
|
func (g *Generator) DropLinuxResourcesBlockIOThrottleReadBpsDevice(major int64, minor int64) {
if g.Config == nil || g.Config.Linux == nil || g.Config.Linux.Resources == nil || g.Config.Linux.Resources.BlockIO == nil {
return
}
throttleDevices := dropBlockIOThrottleDevice(g.Config.Linux.Resources.BlockIO.ThrottleReadBpsDevice, major, minor)
g.Config.Linux.Resources.BlockIO.ThrottleReadBpsDevice = throttleDevices
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"DropLinuxResourcesBlockIOThrottleReadBpsDevice",
"(",
"major",
"int64",
",",
"minor",
"int64",
")",
"{",
"if",
"g",
".",
"Config",
"==",
"nil",
"||",
"g",
".",
"Config",
".",
"Linux",
"==",
"nil",
"||",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
"==",
"nil",
"||",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"BlockIO",
"==",
"nil",
"{",
"return",
"\n",
"}",
"\n\n",
"throttleDevices",
":=",
"dropBlockIOThrottleDevice",
"(",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"BlockIO",
".",
"ThrottleReadBpsDevice",
",",
"major",
",",
"minor",
")",
"\n",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"BlockIO",
".",
"ThrottleReadBpsDevice",
"=",
"throttleDevices",
"\n",
"}"
] |
// DropLinuxResourcesBlockIOThrottleReadBpsDevice drops a item from g.Config.Linux.Resources.BlockIO.ThrottleReadBpsDevice.
|
[
"DropLinuxResourcesBlockIOThrottleReadBpsDevice",
"drops",
"a",
"item",
"from",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"BlockIO",
".",
"ThrottleReadBpsDevice",
"."
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L714-L721
|
14,416 |
opencontainers/runtime-tools
|
generate/generate.go
|
AddLinuxResourcesBlockIOThrottleReadIOPSDevice
|
func (g *Generator) AddLinuxResourcesBlockIOThrottleReadIOPSDevice(major int64, minor int64, rate uint64) {
g.initConfigLinuxResourcesBlockIO()
throttleDevices := addOrReplaceBlockIOThrottleDevice(g.Config.Linux.Resources.BlockIO.ThrottleReadIOPSDevice, major, minor, rate)
g.Config.Linux.Resources.BlockIO.ThrottleReadIOPSDevice = throttleDevices
}
|
go
|
func (g *Generator) AddLinuxResourcesBlockIOThrottleReadIOPSDevice(major int64, minor int64, rate uint64) {
g.initConfigLinuxResourcesBlockIO()
throttleDevices := addOrReplaceBlockIOThrottleDevice(g.Config.Linux.Resources.BlockIO.ThrottleReadIOPSDevice, major, minor, rate)
g.Config.Linux.Resources.BlockIO.ThrottleReadIOPSDevice = throttleDevices
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"AddLinuxResourcesBlockIOThrottleReadIOPSDevice",
"(",
"major",
"int64",
",",
"minor",
"int64",
",",
"rate",
"uint64",
")",
"{",
"g",
".",
"initConfigLinuxResourcesBlockIO",
"(",
")",
"\n",
"throttleDevices",
":=",
"addOrReplaceBlockIOThrottleDevice",
"(",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"BlockIO",
".",
"ThrottleReadIOPSDevice",
",",
"major",
",",
"minor",
",",
"rate",
")",
"\n",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"BlockIO",
".",
"ThrottleReadIOPSDevice",
"=",
"throttleDevices",
"\n",
"}"
] |
// AddLinuxResourcesBlockIOThrottleReadIOPSDevice adds or sets g.Config.Linux.Resources.BlockIO.ThrottleReadIOPSDevice.
|
[
"AddLinuxResourcesBlockIOThrottleReadIOPSDevice",
"adds",
"or",
"sets",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"BlockIO",
".",
"ThrottleReadIOPSDevice",
"."
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L724-L728
|
14,417 |
opencontainers/runtime-tools
|
generate/generate.go
|
DropLinuxResourcesBlockIOThrottleReadIOPSDevice
|
func (g *Generator) DropLinuxResourcesBlockIOThrottleReadIOPSDevice(major int64, minor int64) {
if g.Config == nil || g.Config.Linux == nil || g.Config.Linux.Resources == nil || g.Config.Linux.Resources.BlockIO == nil {
return
}
throttleDevices := dropBlockIOThrottleDevice(g.Config.Linux.Resources.BlockIO.ThrottleReadIOPSDevice, major, minor)
g.Config.Linux.Resources.BlockIO.ThrottleReadIOPSDevice = throttleDevices
}
|
go
|
func (g *Generator) DropLinuxResourcesBlockIOThrottleReadIOPSDevice(major int64, minor int64) {
if g.Config == nil || g.Config.Linux == nil || g.Config.Linux.Resources == nil || g.Config.Linux.Resources.BlockIO == nil {
return
}
throttleDevices := dropBlockIOThrottleDevice(g.Config.Linux.Resources.BlockIO.ThrottleReadIOPSDevice, major, minor)
g.Config.Linux.Resources.BlockIO.ThrottleReadIOPSDevice = throttleDevices
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"DropLinuxResourcesBlockIOThrottleReadIOPSDevice",
"(",
"major",
"int64",
",",
"minor",
"int64",
")",
"{",
"if",
"g",
".",
"Config",
"==",
"nil",
"||",
"g",
".",
"Config",
".",
"Linux",
"==",
"nil",
"||",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
"==",
"nil",
"||",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"BlockIO",
"==",
"nil",
"{",
"return",
"\n",
"}",
"\n\n",
"throttleDevices",
":=",
"dropBlockIOThrottleDevice",
"(",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"BlockIO",
".",
"ThrottleReadIOPSDevice",
",",
"major",
",",
"minor",
")",
"\n",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"BlockIO",
".",
"ThrottleReadIOPSDevice",
"=",
"throttleDevices",
"\n",
"}"
] |
// DropLinuxResourcesBlockIOThrottleReadIOPSDevice drops a item from g.Config.Linux.Resources.BlockIO.ThrottleReadIOPSDevice.
|
[
"DropLinuxResourcesBlockIOThrottleReadIOPSDevice",
"drops",
"a",
"item",
"from",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"BlockIO",
".",
"ThrottleReadIOPSDevice",
"."
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L731-L738
|
14,418 |
opencontainers/runtime-tools
|
generate/generate.go
|
AddLinuxResourcesBlockIOThrottleWriteBpsDevice
|
func (g *Generator) AddLinuxResourcesBlockIOThrottleWriteBpsDevice(major int64, minor int64, rate uint64) {
g.initConfigLinuxResourcesBlockIO()
throttleDevices := addOrReplaceBlockIOThrottleDevice(g.Config.Linux.Resources.BlockIO.ThrottleWriteBpsDevice, major, minor, rate)
g.Config.Linux.Resources.BlockIO.ThrottleWriteBpsDevice = throttleDevices
}
|
go
|
func (g *Generator) AddLinuxResourcesBlockIOThrottleWriteBpsDevice(major int64, minor int64, rate uint64) {
g.initConfigLinuxResourcesBlockIO()
throttleDevices := addOrReplaceBlockIOThrottleDevice(g.Config.Linux.Resources.BlockIO.ThrottleWriteBpsDevice, major, minor, rate)
g.Config.Linux.Resources.BlockIO.ThrottleWriteBpsDevice = throttleDevices
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"AddLinuxResourcesBlockIOThrottleWriteBpsDevice",
"(",
"major",
"int64",
",",
"minor",
"int64",
",",
"rate",
"uint64",
")",
"{",
"g",
".",
"initConfigLinuxResourcesBlockIO",
"(",
")",
"\n",
"throttleDevices",
":=",
"addOrReplaceBlockIOThrottleDevice",
"(",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"BlockIO",
".",
"ThrottleWriteBpsDevice",
",",
"major",
",",
"minor",
",",
"rate",
")",
"\n",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"BlockIO",
".",
"ThrottleWriteBpsDevice",
"=",
"throttleDevices",
"\n",
"}"
] |
// AddLinuxResourcesBlockIOThrottleWriteBpsDevice adds or sets g.Config.Linux.Resources.BlockIO.ThrottleWriteBpsDevice.
|
[
"AddLinuxResourcesBlockIOThrottleWriteBpsDevice",
"adds",
"or",
"sets",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"BlockIO",
".",
"ThrottleWriteBpsDevice",
"."
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L741-L745
|
14,419 |
opencontainers/runtime-tools
|
generate/generate.go
|
DropLinuxResourcesBlockIOThrottleWriteBpsDevice
|
func (g *Generator) DropLinuxResourcesBlockIOThrottleWriteBpsDevice(major int64, minor int64) {
if g.Config == nil || g.Config.Linux == nil || g.Config.Linux.Resources == nil || g.Config.Linux.Resources.BlockIO == nil {
return
}
throttleDevices := dropBlockIOThrottleDevice(g.Config.Linux.Resources.BlockIO.ThrottleWriteBpsDevice, major, minor)
g.Config.Linux.Resources.BlockIO.ThrottleWriteBpsDevice = throttleDevices
}
|
go
|
func (g *Generator) DropLinuxResourcesBlockIOThrottleWriteBpsDevice(major int64, minor int64) {
if g.Config == nil || g.Config.Linux == nil || g.Config.Linux.Resources == nil || g.Config.Linux.Resources.BlockIO == nil {
return
}
throttleDevices := dropBlockIOThrottleDevice(g.Config.Linux.Resources.BlockIO.ThrottleWriteBpsDevice, major, minor)
g.Config.Linux.Resources.BlockIO.ThrottleWriteBpsDevice = throttleDevices
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"DropLinuxResourcesBlockIOThrottleWriteBpsDevice",
"(",
"major",
"int64",
",",
"minor",
"int64",
")",
"{",
"if",
"g",
".",
"Config",
"==",
"nil",
"||",
"g",
".",
"Config",
".",
"Linux",
"==",
"nil",
"||",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
"==",
"nil",
"||",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"BlockIO",
"==",
"nil",
"{",
"return",
"\n",
"}",
"\n\n",
"throttleDevices",
":=",
"dropBlockIOThrottleDevice",
"(",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"BlockIO",
".",
"ThrottleWriteBpsDevice",
",",
"major",
",",
"minor",
")",
"\n",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"BlockIO",
".",
"ThrottleWriteBpsDevice",
"=",
"throttleDevices",
"\n",
"}"
] |
// DropLinuxResourcesBlockIOThrottleWriteBpsDevice drops a item from g.Config.Linux.Resources.BlockIO.ThrottleWriteBpsDevice.
|
[
"DropLinuxResourcesBlockIOThrottleWriteBpsDevice",
"drops",
"a",
"item",
"from",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"BlockIO",
".",
"ThrottleWriteBpsDevice",
"."
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L748-L755
|
14,420 |
opencontainers/runtime-tools
|
generate/generate.go
|
AddLinuxResourcesBlockIOThrottleWriteIOPSDevice
|
func (g *Generator) AddLinuxResourcesBlockIOThrottleWriteIOPSDevice(major int64, minor int64, rate uint64) {
g.initConfigLinuxResourcesBlockIO()
throttleDevices := addOrReplaceBlockIOThrottleDevice(g.Config.Linux.Resources.BlockIO.ThrottleWriteIOPSDevice, major, minor, rate)
g.Config.Linux.Resources.BlockIO.ThrottleWriteIOPSDevice = throttleDevices
}
|
go
|
func (g *Generator) AddLinuxResourcesBlockIOThrottleWriteIOPSDevice(major int64, minor int64, rate uint64) {
g.initConfigLinuxResourcesBlockIO()
throttleDevices := addOrReplaceBlockIOThrottleDevice(g.Config.Linux.Resources.BlockIO.ThrottleWriteIOPSDevice, major, minor, rate)
g.Config.Linux.Resources.BlockIO.ThrottleWriteIOPSDevice = throttleDevices
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"AddLinuxResourcesBlockIOThrottleWriteIOPSDevice",
"(",
"major",
"int64",
",",
"minor",
"int64",
",",
"rate",
"uint64",
")",
"{",
"g",
".",
"initConfigLinuxResourcesBlockIO",
"(",
")",
"\n",
"throttleDevices",
":=",
"addOrReplaceBlockIOThrottleDevice",
"(",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"BlockIO",
".",
"ThrottleWriteIOPSDevice",
",",
"major",
",",
"minor",
",",
"rate",
")",
"\n",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"BlockIO",
".",
"ThrottleWriteIOPSDevice",
"=",
"throttleDevices",
"\n",
"}"
] |
// AddLinuxResourcesBlockIOThrottleWriteIOPSDevice adds or sets g.Config.Linux.Resources.BlockIO.ThrottleWriteIOPSDevice.
|
[
"AddLinuxResourcesBlockIOThrottleWriteIOPSDevice",
"adds",
"or",
"sets",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"BlockIO",
".",
"ThrottleWriteIOPSDevice",
"."
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L758-L762
|
14,421 |
opencontainers/runtime-tools
|
generate/generate.go
|
DropLinuxResourcesBlockIOThrottleWriteIOPSDevice
|
func (g *Generator) DropLinuxResourcesBlockIOThrottleWriteIOPSDevice(major int64, minor int64) {
if g.Config == nil || g.Config.Linux == nil || g.Config.Linux.Resources == nil || g.Config.Linux.Resources.BlockIO == nil {
return
}
throttleDevices := dropBlockIOThrottleDevice(g.Config.Linux.Resources.BlockIO.ThrottleWriteIOPSDevice, major, minor)
g.Config.Linux.Resources.BlockIO.ThrottleWriteIOPSDevice = throttleDevices
}
|
go
|
func (g *Generator) DropLinuxResourcesBlockIOThrottleWriteIOPSDevice(major int64, minor int64) {
if g.Config == nil || g.Config.Linux == nil || g.Config.Linux.Resources == nil || g.Config.Linux.Resources.BlockIO == nil {
return
}
throttleDevices := dropBlockIOThrottleDevice(g.Config.Linux.Resources.BlockIO.ThrottleWriteIOPSDevice, major, minor)
g.Config.Linux.Resources.BlockIO.ThrottleWriteIOPSDevice = throttleDevices
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"DropLinuxResourcesBlockIOThrottleWriteIOPSDevice",
"(",
"major",
"int64",
",",
"minor",
"int64",
")",
"{",
"if",
"g",
".",
"Config",
"==",
"nil",
"||",
"g",
".",
"Config",
".",
"Linux",
"==",
"nil",
"||",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
"==",
"nil",
"||",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"BlockIO",
"==",
"nil",
"{",
"return",
"\n",
"}",
"\n\n",
"throttleDevices",
":=",
"dropBlockIOThrottleDevice",
"(",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"BlockIO",
".",
"ThrottleWriteIOPSDevice",
",",
"major",
",",
"minor",
")",
"\n",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"BlockIO",
".",
"ThrottleWriteIOPSDevice",
"=",
"throttleDevices",
"\n",
"}"
] |
// DropLinuxResourcesBlockIOThrottleWriteIOPSDevice drops a item from g.Config.Linux.Resources.BlockIO.ThrottleWriteIOPSDevice.
|
[
"DropLinuxResourcesBlockIOThrottleWriteIOPSDevice",
"drops",
"a",
"item",
"from",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"BlockIO",
".",
"ThrottleWriteIOPSDevice",
"."
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L765-L772
|
14,422 |
opencontainers/runtime-tools
|
generate/generate.go
|
SetLinuxResourcesCPUShares
|
func (g *Generator) SetLinuxResourcesCPUShares(shares uint64) {
g.InitConfigLinuxResourcesCPU()
g.Config.Linux.Resources.CPU.Shares = &shares
}
|
go
|
func (g *Generator) SetLinuxResourcesCPUShares(shares uint64) {
g.InitConfigLinuxResourcesCPU()
g.Config.Linux.Resources.CPU.Shares = &shares
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"SetLinuxResourcesCPUShares",
"(",
"shares",
"uint64",
")",
"{",
"g",
".",
"InitConfigLinuxResourcesCPU",
"(",
")",
"\n",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"CPU",
".",
"Shares",
"=",
"&",
"shares",
"\n",
"}"
] |
// SetLinuxResourcesCPUShares sets g.Config.Linux.Resources.CPU.Shares.
|
[
"SetLinuxResourcesCPUShares",
"sets",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"CPU",
".",
"Shares",
"."
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L775-L778
|
14,423 |
opencontainers/runtime-tools
|
generate/generate.go
|
SetLinuxResourcesCPUQuota
|
func (g *Generator) SetLinuxResourcesCPUQuota(quota int64) {
g.InitConfigLinuxResourcesCPU()
g.Config.Linux.Resources.CPU.Quota = "a
}
|
go
|
func (g *Generator) SetLinuxResourcesCPUQuota(quota int64) {
g.InitConfigLinuxResourcesCPU()
g.Config.Linux.Resources.CPU.Quota = "a
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"SetLinuxResourcesCPUQuota",
"(",
"quota",
"int64",
")",
"{",
"g",
".",
"InitConfigLinuxResourcesCPU",
"(",
")",
"\n",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"CPU",
".",
"Quota",
"=",
"&",
"quota",
"\n",
"}"
] |
// SetLinuxResourcesCPUQuota sets g.Config.Linux.Resources.CPU.Quota.
|
[
"SetLinuxResourcesCPUQuota",
"sets",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"CPU",
".",
"Quota",
"."
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L781-L784
|
14,424 |
opencontainers/runtime-tools
|
generate/generate.go
|
SetLinuxResourcesCPUPeriod
|
func (g *Generator) SetLinuxResourcesCPUPeriod(period uint64) {
g.InitConfigLinuxResourcesCPU()
g.Config.Linux.Resources.CPU.Period = &period
}
|
go
|
func (g *Generator) SetLinuxResourcesCPUPeriod(period uint64) {
g.InitConfigLinuxResourcesCPU()
g.Config.Linux.Resources.CPU.Period = &period
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"SetLinuxResourcesCPUPeriod",
"(",
"period",
"uint64",
")",
"{",
"g",
".",
"InitConfigLinuxResourcesCPU",
"(",
")",
"\n",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"CPU",
".",
"Period",
"=",
"&",
"period",
"\n",
"}"
] |
// SetLinuxResourcesCPUPeriod sets g.Config.Linux.Resources.CPU.Period.
|
[
"SetLinuxResourcesCPUPeriod",
"sets",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"CPU",
".",
"Period",
"."
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L787-L790
|
14,425 |
opencontainers/runtime-tools
|
generate/generate.go
|
SetLinuxResourcesCPURealtimeRuntime
|
func (g *Generator) SetLinuxResourcesCPURealtimeRuntime(time int64) {
g.InitConfigLinuxResourcesCPU()
g.Config.Linux.Resources.CPU.RealtimeRuntime = &time
}
|
go
|
func (g *Generator) SetLinuxResourcesCPURealtimeRuntime(time int64) {
g.InitConfigLinuxResourcesCPU()
g.Config.Linux.Resources.CPU.RealtimeRuntime = &time
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"SetLinuxResourcesCPURealtimeRuntime",
"(",
"time",
"int64",
")",
"{",
"g",
".",
"InitConfigLinuxResourcesCPU",
"(",
")",
"\n",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"CPU",
".",
"RealtimeRuntime",
"=",
"&",
"time",
"\n",
"}"
] |
// SetLinuxResourcesCPURealtimeRuntime sets g.Config.Linux.Resources.CPU.RealtimeRuntime.
|
[
"SetLinuxResourcesCPURealtimeRuntime",
"sets",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"CPU",
".",
"RealtimeRuntime",
"."
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L793-L796
|
14,426 |
opencontainers/runtime-tools
|
generate/generate.go
|
SetLinuxResourcesCPURealtimePeriod
|
func (g *Generator) SetLinuxResourcesCPURealtimePeriod(period uint64) {
g.InitConfigLinuxResourcesCPU()
g.Config.Linux.Resources.CPU.RealtimePeriod = &period
}
|
go
|
func (g *Generator) SetLinuxResourcesCPURealtimePeriod(period uint64) {
g.InitConfigLinuxResourcesCPU()
g.Config.Linux.Resources.CPU.RealtimePeriod = &period
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"SetLinuxResourcesCPURealtimePeriod",
"(",
"period",
"uint64",
")",
"{",
"g",
".",
"InitConfigLinuxResourcesCPU",
"(",
")",
"\n",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"CPU",
".",
"RealtimePeriod",
"=",
"&",
"period",
"\n",
"}"
] |
// SetLinuxResourcesCPURealtimePeriod sets g.Config.Linux.Resources.CPU.RealtimePeriod.
|
[
"SetLinuxResourcesCPURealtimePeriod",
"sets",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"CPU",
".",
"RealtimePeriod",
"."
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L799-L802
|
14,427 |
opencontainers/runtime-tools
|
generate/generate.go
|
SetLinuxResourcesCPUCpus
|
func (g *Generator) SetLinuxResourcesCPUCpus(cpus string) {
g.InitConfigLinuxResourcesCPU()
g.Config.Linux.Resources.CPU.Cpus = cpus
}
|
go
|
func (g *Generator) SetLinuxResourcesCPUCpus(cpus string) {
g.InitConfigLinuxResourcesCPU()
g.Config.Linux.Resources.CPU.Cpus = cpus
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"SetLinuxResourcesCPUCpus",
"(",
"cpus",
"string",
")",
"{",
"g",
".",
"InitConfigLinuxResourcesCPU",
"(",
")",
"\n",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"CPU",
".",
"Cpus",
"=",
"cpus",
"\n",
"}"
] |
// SetLinuxResourcesCPUCpus sets g.Config.Linux.Resources.CPU.Cpus.
|
[
"SetLinuxResourcesCPUCpus",
"sets",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"CPU",
".",
"Cpus",
"."
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L805-L808
|
14,428 |
opencontainers/runtime-tools
|
generate/generate.go
|
SetLinuxResourcesCPUMems
|
func (g *Generator) SetLinuxResourcesCPUMems(mems string) {
g.InitConfigLinuxResourcesCPU()
g.Config.Linux.Resources.CPU.Mems = mems
}
|
go
|
func (g *Generator) SetLinuxResourcesCPUMems(mems string) {
g.InitConfigLinuxResourcesCPU()
g.Config.Linux.Resources.CPU.Mems = mems
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"SetLinuxResourcesCPUMems",
"(",
"mems",
"string",
")",
"{",
"g",
".",
"InitConfigLinuxResourcesCPU",
"(",
")",
"\n",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"CPU",
".",
"Mems",
"=",
"mems",
"\n",
"}"
] |
// SetLinuxResourcesCPUMems sets g.Config.Linux.Resources.CPU.Mems.
|
[
"SetLinuxResourcesCPUMems",
"sets",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"CPU",
".",
"Mems",
"."
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L811-L814
|
14,429 |
opencontainers/runtime-tools
|
generate/generate.go
|
AddLinuxResourcesHugepageLimit
|
func (g *Generator) AddLinuxResourcesHugepageLimit(pageSize string, limit uint64) {
hugepageLimit := rspec.LinuxHugepageLimit{
Pagesize: pageSize,
Limit: limit,
}
g.initConfigLinuxResources()
for i, pageLimit := range g.Config.Linux.Resources.HugepageLimits {
if pageLimit.Pagesize == pageSize {
g.Config.Linux.Resources.HugepageLimits[i].Limit = limit
return
}
}
g.Config.Linux.Resources.HugepageLimits = append(g.Config.Linux.Resources.HugepageLimits, hugepageLimit)
}
|
go
|
func (g *Generator) AddLinuxResourcesHugepageLimit(pageSize string, limit uint64) {
hugepageLimit := rspec.LinuxHugepageLimit{
Pagesize: pageSize,
Limit: limit,
}
g.initConfigLinuxResources()
for i, pageLimit := range g.Config.Linux.Resources.HugepageLimits {
if pageLimit.Pagesize == pageSize {
g.Config.Linux.Resources.HugepageLimits[i].Limit = limit
return
}
}
g.Config.Linux.Resources.HugepageLimits = append(g.Config.Linux.Resources.HugepageLimits, hugepageLimit)
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"AddLinuxResourcesHugepageLimit",
"(",
"pageSize",
"string",
",",
"limit",
"uint64",
")",
"{",
"hugepageLimit",
":=",
"rspec",
".",
"LinuxHugepageLimit",
"{",
"Pagesize",
":",
"pageSize",
",",
"Limit",
":",
"limit",
",",
"}",
"\n\n",
"g",
".",
"initConfigLinuxResources",
"(",
")",
"\n",
"for",
"i",
",",
"pageLimit",
":=",
"range",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"HugepageLimits",
"{",
"if",
"pageLimit",
".",
"Pagesize",
"==",
"pageSize",
"{",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"HugepageLimits",
"[",
"i",
"]",
".",
"Limit",
"=",
"limit",
"\n",
"return",
"\n",
"}",
"\n",
"}",
"\n",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"HugepageLimits",
"=",
"append",
"(",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"HugepageLimits",
",",
"hugepageLimit",
")",
"\n",
"}"
] |
// AddLinuxResourcesHugepageLimit adds or sets g.Config.Linux.Resources.HugepageLimits.
|
[
"AddLinuxResourcesHugepageLimit",
"adds",
"or",
"sets",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"HugepageLimits",
"."
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L817-L831
|
14,430 |
opencontainers/runtime-tools
|
generate/generate.go
|
DropLinuxResourcesHugepageLimit
|
func (g *Generator) DropLinuxResourcesHugepageLimit(pageSize string) {
if g.Config == nil || g.Config.Linux == nil || g.Config.Linux.Resources == nil {
return
}
for i, pageLimit := range g.Config.Linux.Resources.HugepageLimits {
if pageLimit.Pagesize == pageSize {
g.Config.Linux.Resources.HugepageLimits = append(g.Config.Linux.Resources.HugepageLimits[:i], g.Config.Linux.Resources.HugepageLimits[i+1:]...)
return
}
}
}
|
go
|
func (g *Generator) DropLinuxResourcesHugepageLimit(pageSize string) {
if g.Config == nil || g.Config.Linux == nil || g.Config.Linux.Resources == nil {
return
}
for i, pageLimit := range g.Config.Linux.Resources.HugepageLimits {
if pageLimit.Pagesize == pageSize {
g.Config.Linux.Resources.HugepageLimits = append(g.Config.Linux.Resources.HugepageLimits[:i], g.Config.Linux.Resources.HugepageLimits[i+1:]...)
return
}
}
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"DropLinuxResourcesHugepageLimit",
"(",
"pageSize",
"string",
")",
"{",
"if",
"g",
".",
"Config",
"==",
"nil",
"||",
"g",
".",
"Config",
".",
"Linux",
"==",
"nil",
"||",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
"==",
"nil",
"{",
"return",
"\n",
"}",
"\n\n",
"for",
"i",
",",
"pageLimit",
":=",
"range",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"HugepageLimits",
"{",
"if",
"pageLimit",
".",
"Pagesize",
"==",
"pageSize",
"{",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"HugepageLimits",
"=",
"append",
"(",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"HugepageLimits",
"[",
":",
"i",
"]",
",",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"HugepageLimits",
"[",
"i",
"+",
"1",
":",
"]",
"...",
")",
"\n",
"return",
"\n",
"}",
"\n",
"}",
"\n",
"}"
] |
// DropLinuxResourcesHugepageLimit drops a hugepage limit from g.Config.Linux.Resources.HugepageLimits.
|
[
"DropLinuxResourcesHugepageLimit",
"drops",
"a",
"hugepage",
"limit",
"from",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"HugepageLimits",
"."
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L834-L845
|
14,431 |
opencontainers/runtime-tools
|
generate/generate.go
|
SetLinuxResourcesMemoryLimit
|
func (g *Generator) SetLinuxResourcesMemoryLimit(limit int64) {
g.initConfigLinuxResourcesMemory()
g.Config.Linux.Resources.Memory.Limit = &limit
}
|
go
|
func (g *Generator) SetLinuxResourcesMemoryLimit(limit int64) {
g.initConfigLinuxResourcesMemory()
g.Config.Linux.Resources.Memory.Limit = &limit
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"SetLinuxResourcesMemoryLimit",
"(",
"limit",
"int64",
")",
"{",
"g",
".",
"initConfigLinuxResourcesMemory",
"(",
")",
"\n",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"Memory",
".",
"Limit",
"=",
"&",
"limit",
"\n",
"}"
] |
// SetLinuxResourcesMemoryLimit sets g.Config.Linux.Resources.Memory.Limit.
|
[
"SetLinuxResourcesMemoryLimit",
"sets",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"Memory",
".",
"Limit",
"."
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L848-L851
|
14,432 |
opencontainers/runtime-tools
|
generate/generate.go
|
SetLinuxResourcesMemoryReservation
|
func (g *Generator) SetLinuxResourcesMemoryReservation(reservation int64) {
g.initConfigLinuxResourcesMemory()
g.Config.Linux.Resources.Memory.Reservation = &reservation
}
|
go
|
func (g *Generator) SetLinuxResourcesMemoryReservation(reservation int64) {
g.initConfigLinuxResourcesMemory()
g.Config.Linux.Resources.Memory.Reservation = &reservation
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"SetLinuxResourcesMemoryReservation",
"(",
"reservation",
"int64",
")",
"{",
"g",
".",
"initConfigLinuxResourcesMemory",
"(",
")",
"\n",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"Memory",
".",
"Reservation",
"=",
"&",
"reservation",
"\n",
"}"
] |
// SetLinuxResourcesMemoryReservation sets g.Config.Linux.Resources.Memory.Reservation.
|
[
"SetLinuxResourcesMemoryReservation",
"sets",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"Memory",
".",
"Reservation",
"."
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L854-L857
|
14,433 |
opencontainers/runtime-tools
|
generate/generate.go
|
SetLinuxResourcesMemorySwap
|
func (g *Generator) SetLinuxResourcesMemorySwap(swap int64) {
g.initConfigLinuxResourcesMemory()
g.Config.Linux.Resources.Memory.Swap = &swap
}
|
go
|
func (g *Generator) SetLinuxResourcesMemorySwap(swap int64) {
g.initConfigLinuxResourcesMemory()
g.Config.Linux.Resources.Memory.Swap = &swap
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"SetLinuxResourcesMemorySwap",
"(",
"swap",
"int64",
")",
"{",
"g",
".",
"initConfigLinuxResourcesMemory",
"(",
")",
"\n",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"Memory",
".",
"Swap",
"=",
"&",
"swap",
"\n",
"}"
] |
// SetLinuxResourcesMemorySwap sets g.Config.Linux.Resources.Memory.Swap.
|
[
"SetLinuxResourcesMemorySwap",
"sets",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"Memory",
".",
"Swap",
"."
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L860-L863
|
14,434 |
opencontainers/runtime-tools
|
generate/generate.go
|
SetLinuxResourcesMemoryKernel
|
func (g *Generator) SetLinuxResourcesMemoryKernel(kernel int64) {
g.initConfigLinuxResourcesMemory()
g.Config.Linux.Resources.Memory.Kernel = &kernel
}
|
go
|
func (g *Generator) SetLinuxResourcesMemoryKernel(kernel int64) {
g.initConfigLinuxResourcesMemory()
g.Config.Linux.Resources.Memory.Kernel = &kernel
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"SetLinuxResourcesMemoryKernel",
"(",
"kernel",
"int64",
")",
"{",
"g",
".",
"initConfigLinuxResourcesMemory",
"(",
")",
"\n",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"Memory",
".",
"Kernel",
"=",
"&",
"kernel",
"\n",
"}"
] |
// SetLinuxResourcesMemoryKernel sets g.Config.Linux.Resources.Memory.Kernel.
|
[
"SetLinuxResourcesMemoryKernel",
"sets",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"Memory",
".",
"Kernel",
"."
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L866-L869
|
14,435 |
opencontainers/runtime-tools
|
generate/generate.go
|
SetLinuxResourcesMemoryKernelTCP
|
func (g *Generator) SetLinuxResourcesMemoryKernelTCP(kernelTCP int64) {
g.initConfigLinuxResourcesMemory()
g.Config.Linux.Resources.Memory.KernelTCP = &kernelTCP
}
|
go
|
func (g *Generator) SetLinuxResourcesMemoryKernelTCP(kernelTCP int64) {
g.initConfigLinuxResourcesMemory()
g.Config.Linux.Resources.Memory.KernelTCP = &kernelTCP
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"SetLinuxResourcesMemoryKernelTCP",
"(",
"kernelTCP",
"int64",
")",
"{",
"g",
".",
"initConfigLinuxResourcesMemory",
"(",
")",
"\n",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"Memory",
".",
"KernelTCP",
"=",
"&",
"kernelTCP",
"\n",
"}"
] |
// SetLinuxResourcesMemoryKernelTCP sets g.Config.Linux.Resources.Memory.KernelTCP.
|
[
"SetLinuxResourcesMemoryKernelTCP",
"sets",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"Memory",
".",
"KernelTCP",
"."
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L872-L875
|
14,436 |
opencontainers/runtime-tools
|
generate/generate.go
|
SetLinuxResourcesMemorySwappiness
|
func (g *Generator) SetLinuxResourcesMemorySwappiness(swappiness uint64) {
g.initConfigLinuxResourcesMemory()
g.Config.Linux.Resources.Memory.Swappiness = &swappiness
}
|
go
|
func (g *Generator) SetLinuxResourcesMemorySwappiness(swappiness uint64) {
g.initConfigLinuxResourcesMemory()
g.Config.Linux.Resources.Memory.Swappiness = &swappiness
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"SetLinuxResourcesMemorySwappiness",
"(",
"swappiness",
"uint64",
")",
"{",
"g",
".",
"initConfigLinuxResourcesMemory",
"(",
")",
"\n",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"Memory",
".",
"Swappiness",
"=",
"&",
"swappiness",
"\n",
"}"
] |
// SetLinuxResourcesMemorySwappiness sets g.Config.Linux.Resources.Memory.Swappiness.
|
[
"SetLinuxResourcesMemorySwappiness",
"sets",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"Memory",
".",
"Swappiness",
"."
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L878-L881
|
14,437 |
opencontainers/runtime-tools
|
generate/generate.go
|
SetLinuxResourcesMemoryDisableOOMKiller
|
func (g *Generator) SetLinuxResourcesMemoryDisableOOMKiller(disable bool) {
g.initConfigLinuxResourcesMemory()
g.Config.Linux.Resources.Memory.DisableOOMKiller = &disable
}
|
go
|
func (g *Generator) SetLinuxResourcesMemoryDisableOOMKiller(disable bool) {
g.initConfigLinuxResourcesMemory()
g.Config.Linux.Resources.Memory.DisableOOMKiller = &disable
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"SetLinuxResourcesMemoryDisableOOMKiller",
"(",
"disable",
"bool",
")",
"{",
"g",
".",
"initConfigLinuxResourcesMemory",
"(",
")",
"\n",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"Memory",
".",
"DisableOOMKiller",
"=",
"&",
"disable",
"\n",
"}"
] |
// SetLinuxResourcesMemoryDisableOOMKiller sets g.Config.Linux.Resources.Memory.DisableOOMKiller.
|
[
"SetLinuxResourcesMemoryDisableOOMKiller",
"sets",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"Memory",
".",
"DisableOOMKiller",
"."
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L884-L887
|
14,438 |
opencontainers/runtime-tools
|
generate/generate.go
|
SetLinuxResourcesNetworkClassID
|
func (g *Generator) SetLinuxResourcesNetworkClassID(classid uint32) {
g.initConfigLinuxResourcesNetwork()
g.Config.Linux.Resources.Network.ClassID = &classid
}
|
go
|
func (g *Generator) SetLinuxResourcesNetworkClassID(classid uint32) {
g.initConfigLinuxResourcesNetwork()
g.Config.Linux.Resources.Network.ClassID = &classid
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"SetLinuxResourcesNetworkClassID",
"(",
"classid",
"uint32",
")",
"{",
"g",
".",
"initConfigLinuxResourcesNetwork",
"(",
")",
"\n",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"Network",
".",
"ClassID",
"=",
"&",
"classid",
"\n",
"}"
] |
// SetLinuxResourcesNetworkClassID sets g.Config.Linux.Resources.Network.ClassID.
|
[
"SetLinuxResourcesNetworkClassID",
"sets",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"Network",
".",
"ClassID",
"."
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L890-L893
|
14,439 |
opencontainers/runtime-tools
|
generate/generate.go
|
AddLinuxResourcesNetworkPriorities
|
func (g *Generator) AddLinuxResourcesNetworkPriorities(name string, prio uint32) {
g.initConfigLinuxResourcesNetwork()
for i, netPriority := range g.Config.Linux.Resources.Network.Priorities {
if netPriority.Name == name {
g.Config.Linux.Resources.Network.Priorities[i].Priority = prio
return
}
}
interfacePrio := new(rspec.LinuxInterfacePriority)
interfacePrio.Name = name
interfacePrio.Priority = prio
g.Config.Linux.Resources.Network.Priorities = append(g.Config.Linux.Resources.Network.Priorities, *interfacePrio)
}
|
go
|
func (g *Generator) AddLinuxResourcesNetworkPriorities(name string, prio uint32) {
g.initConfigLinuxResourcesNetwork()
for i, netPriority := range g.Config.Linux.Resources.Network.Priorities {
if netPriority.Name == name {
g.Config.Linux.Resources.Network.Priorities[i].Priority = prio
return
}
}
interfacePrio := new(rspec.LinuxInterfacePriority)
interfacePrio.Name = name
interfacePrio.Priority = prio
g.Config.Linux.Resources.Network.Priorities = append(g.Config.Linux.Resources.Network.Priorities, *interfacePrio)
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"AddLinuxResourcesNetworkPriorities",
"(",
"name",
"string",
",",
"prio",
"uint32",
")",
"{",
"g",
".",
"initConfigLinuxResourcesNetwork",
"(",
")",
"\n",
"for",
"i",
",",
"netPriority",
":=",
"range",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"Network",
".",
"Priorities",
"{",
"if",
"netPriority",
".",
"Name",
"==",
"name",
"{",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"Network",
".",
"Priorities",
"[",
"i",
"]",
".",
"Priority",
"=",
"prio",
"\n",
"return",
"\n",
"}",
"\n",
"}",
"\n",
"interfacePrio",
":=",
"new",
"(",
"rspec",
".",
"LinuxInterfacePriority",
")",
"\n",
"interfacePrio",
".",
"Name",
"=",
"name",
"\n",
"interfacePrio",
".",
"Priority",
"=",
"prio",
"\n",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"Network",
".",
"Priorities",
"=",
"append",
"(",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"Network",
".",
"Priorities",
",",
"*",
"interfacePrio",
")",
"\n",
"}"
] |
// AddLinuxResourcesNetworkPriorities adds or sets g.Config.Linux.Resources.Network.Priorities.
|
[
"AddLinuxResourcesNetworkPriorities",
"adds",
"or",
"sets",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"Network",
".",
"Priorities",
"."
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L896-L908
|
14,440 |
opencontainers/runtime-tools
|
generate/generate.go
|
DropLinuxResourcesNetworkPriorities
|
func (g *Generator) DropLinuxResourcesNetworkPriorities(name string) {
if g.Config == nil || g.Config.Linux == nil || g.Config.Linux.Resources == nil || g.Config.Linux.Resources.Network == nil {
return
}
for i, netPriority := range g.Config.Linux.Resources.Network.Priorities {
if netPriority.Name == name {
g.Config.Linux.Resources.Network.Priorities = append(g.Config.Linux.Resources.Network.Priorities[:i], g.Config.Linux.Resources.Network.Priorities[i+1:]...)
return
}
}
}
|
go
|
func (g *Generator) DropLinuxResourcesNetworkPriorities(name string) {
if g.Config == nil || g.Config.Linux == nil || g.Config.Linux.Resources == nil || g.Config.Linux.Resources.Network == nil {
return
}
for i, netPriority := range g.Config.Linux.Resources.Network.Priorities {
if netPriority.Name == name {
g.Config.Linux.Resources.Network.Priorities = append(g.Config.Linux.Resources.Network.Priorities[:i], g.Config.Linux.Resources.Network.Priorities[i+1:]...)
return
}
}
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"DropLinuxResourcesNetworkPriorities",
"(",
"name",
"string",
")",
"{",
"if",
"g",
".",
"Config",
"==",
"nil",
"||",
"g",
".",
"Config",
".",
"Linux",
"==",
"nil",
"||",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
"==",
"nil",
"||",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"Network",
"==",
"nil",
"{",
"return",
"\n",
"}",
"\n\n",
"for",
"i",
",",
"netPriority",
":=",
"range",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"Network",
".",
"Priorities",
"{",
"if",
"netPriority",
".",
"Name",
"==",
"name",
"{",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"Network",
".",
"Priorities",
"=",
"append",
"(",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"Network",
".",
"Priorities",
"[",
":",
"i",
"]",
",",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"Network",
".",
"Priorities",
"[",
"i",
"+",
"1",
":",
"]",
"...",
")",
"\n",
"return",
"\n",
"}",
"\n",
"}",
"\n",
"}"
] |
// DropLinuxResourcesNetworkPriorities drops one item from g.Config.Linux.Resources.Network.Priorities.
|
[
"DropLinuxResourcesNetworkPriorities",
"drops",
"one",
"item",
"from",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"Network",
".",
"Priorities",
"."
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L911-L922
|
14,441 |
opencontainers/runtime-tools
|
generate/generate.go
|
SetLinuxResourcesPidsLimit
|
func (g *Generator) SetLinuxResourcesPidsLimit(limit int64) {
g.initConfigLinuxResourcesPids()
g.Config.Linux.Resources.Pids.Limit = limit
}
|
go
|
func (g *Generator) SetLinuxResourcesPidsLimit(limit int64) {
g.initConfigLinuxResourcesPids()
g.Config.Linux.Resources.Pids.Limit = limit
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"SetLinuxResourcesPidsLimit",
"(",
"limit",
"int64",
")",
"{",
"g",
".",
"initConfigLinuxResourcesPids",
"(",
")",
"\n",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"Pids",
".",
"Limit",
"=",
"limit",
"\n",
"}"
] |
// SetLinuxResourcesPidsLimit sets g.Config.Linux.Resources.Pids.Limit.
|
[
"SetLinuxResourcesPidsLimit",
"sets",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"Pids",
".",
"Limit",
"."
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L925-L928
|
14,442 |
opencontainers/runtime-tools
|
generate/generate.go
|
ClearLinuxSysctl
|
func (g *Generator) ClearLinuxSysctl() {
if g.Config == nil || g.Config.Linux == nil {
return
}
g.Config.Linux.Sysctl = make(map[string]string)
}
|
go
|
func (g *Generator) ClearLinuxSysctl() {
if g.Config == nil || g.Config.Linux == nil {
return
}
g.Config.Linux.Sysctl = make(map[string]string)
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"ClearLinuxSysctl",
"(",
")",
"{",
"if",
"g",
".",
"Config",
"==",
"nil",
"||",
"g",
".",
"Config",
".",
"Linux",
"==",
"nil",
"{",
"return",
"\n",
"}",
"\n",
"g",
".",
"Config",
".",
"Linux",
".",
"Sysctl",
"=",
"make",
"(",
"map",
"[",
"string",
"]",
"string",
")",
"\n",
"}"
] |
// ClearLinuxSysctl clears g.Config.Linux.Sysctl.
|
[
"ClearLinuxSysctl",
"clears",
"g",
".",
"Config",
".",
"Linux",
".",
"Sysctl",
"."
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L931-L936
|
14,443 |
opencontainers/runtime-tools
|
generate/generate.go
|
AddLinuxSysctl
|
func (g *Generator) AddLinuxSysctl(key, value string) {
g.initConfigLinuxSysctl()
g.Config.Linux.Sysctl[key] = value
}
|
go
|
func (g *Generator) AddLinuxSysctl(key, value string) {
g.initConfigLinuxSysctl()
g.Config.Linux.Sysctl[key] = value
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"AddLinuxSysctl",
"(",
"key",
",",
"value",
"string",
")",
"{",
"g",
".",
"initConfigLinuxSysctl",
"(",
")",
"\n",
"g",
".",
"Config",
".",
"Linux",
".",
"Sysctl",
"[",
"key",
"]",
"=",
"value",
"\n",
"}"
] |
// AddLinuxSysctl adds a new sysctl config into g.Config.Linux.Sysctl.
|
[
"AddLinuxSysctl",
"adds",
"a",
"new",
"sysctl",
"config",
"into",
"g",
".",
"Config",
".",
"Linux",
".",
"Sysctl",
"."
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L939-L942
|
14,444 |
opencontainers/runtime-tools
|
generate/generate.go
|
RemoveLinuxSysctl
|
func (g *Generator) RemoveLinuxSysctl(key string) {
if g.Config == nil || g.Config.Linux == nil || g.Config.Linux.Sysctl == nil {
return
}
delete(g.Config.Linux.Sysctl, key)
}
|
go
|
func (g *Generator) RemoveLinuxSysctl(key string) {
if g.Config == nil || g.Config.Linux == nil || g.Config.Linux.Sysctl == nil {
return
}
delete(g.Config.Linux.Sysctl, key)
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"RemoveLinuxSysctl",
"(",
"key",
"string",
")",
"{",
"if",
"g",
".",
"Config",
"==",
"nil",
"||",
"g",
".",
"Config",
".",
"Linux",
"==",
"nil",
"||",
"g",
".",
"Config",
".",
"Linux",
".",
"Sysctl",
"==",
"nil",
"{",
"return",
"\n",
"}",
"\n",
"delete",
"(",
"g",
".",
"Config",
".",
"Linux",
".",
"Sysctl",
",",
"key",
")",
"\n",
"}"
] |
// RemoveLinuxSysctl removes a sysctl config from g.Config.Linux.Sysctl.
|
[
"RemoveLinuxSysctl",
"removes",
"a",
"sysctl",
"config",
"from",
"g",
".",
"Config",
".",
"Linux",
".",
"Sysctl",
"."
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L945-L950
|
14,445 |
opencontainers/runtime-tools
|
generate/generate.go
|
ClearLinuxUIDMappings
|
func (g *Generator) ClearLinuxUIDMappings() {
if g.Config == nil || g.Config.Linux == nil {
return
}
g.Config.Linux.UIDMappings = []rspec.LinuxIDMapping{}
}
|
go
|
func (g *Generator) ClearLinuxUIDMappings() {
if g.Config == nil || g.Config.Linux == nil {
return
}
g.Config.Linux.UIDMappings = []rspec.LinuxIDMapping{}
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"ClearLinuxUIDMappings",
"(",
")",
"{",
"if",
"g",
".",
"Config",
"==",
"nil",
"||",
"g",
".",
"Config",
".",
"Linux",
"==",
"nil",
"{",
"return",
"\n",
"}",
"\n",
"g",
".",
"Config",
".",
"Linux",
".",
"UIDMappings",
"=",
"[",
"]",
"rspec",
".",
"LinuxIDMapping",
"{",
"}",
"\n",
"}"
] |
// ClearLinuxUIDMappings clear g.Config.Linux.UIDMappings.
|
[
"ClearLinuxUIDMappings",
"clear",
"g",
".",
"Config",
".",
"Linux",
".",
"UIDMappings",
"."
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L953-L958
|
14,446 |
opencontainers/runtime-tools
|
generate/generate.go
|
AddLinuxUIDMapping
|
func (g *Generator) AddLinuxUIDMapping(hid, cid, size uint32) {
idMapping := rspec.LinuxIDMapping{
HostID: hid,
ContainerID: cid,
Size: size,
}
g.initConfigLinux()
g.Config.Linux.UIDMappings = append(g.Config.Linux.UIDMappings, idMapping)
}
|
go
|
func (g *Generator) AddLinuxUIDMapping(hid, cid, size uint32) {
idMapping := rspec.LinuxIDMapping{
HostID: hid,
ContainerID: cid,
Size: size,
}
g.initConfigLinux()
g.Config.Linux.UIDMappings = append(g.Config.Linux.UIDMappings, idMapping)
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"AddLinuxUIDMapping",
"(",
"hid",
",",
"cid",
",",
"size",
"uint32",
")",
"{",
"idMapping",
":=",
"rspec",
".",
"LinuxIDMapping",
"{",
"HostID",
":",
"hid",
",",
"ContainerID",
":",
"cid",
",",
"Size",
":",
"size",
",",
"}",
"\n\n",
"g",
".",
"initConfigLinux",
"(",
")",
"\n",
"g",
".",
"Config",
".",
"Linux",
".",
"UIDMappings",
"=",
"append",
"(",
"g",
".",
"Config",
".",
"Linux",
".",
"UIDMappings",
",",
"idMapping",
")",
"\n",
"}"
] |
// AddLinuxUIDMapping adds uidMap into g.Config.Linux.UIDMappings.
|
[
"AddLinuxUIDMapping",
"adds",
"uidMap",
"into",
"g",
".",
"Config",
".",
"Linux",
".",
"UIDMappings",
"."
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L961-L970
|
14,447 |
opencontainers/runtime-tools
|
generate/generate.go
|
ClearLinuxGIDMappings
|
func (g *Generator) ClearLinuxGIDMappings() {
if g.Config == nil || g.Config.Linux == nil {
return
}
g.Config.Linux.GIDMappings = []rspec.LinuxIDMapping{}
}
|
go
|
func (g *Generator) ClearLinuxGIDMappings() {
if g.Config == nil || g.Config.Linux == nil {
return
}
g.Config.Linux.GIDMappings = []rspec.LinuxIDMapping{}
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"ClearLinuxGIDMappings",
"(",
")",
"{",
"if",
"g",
".",
"Config",
"==",
"nil",
"||",
"g",
".",
"Config",
".",
"Linux",
"==",
"nil",
"{",
"return",
"\n",
"}",
"\n",
"g",
".",
"Config",
".",
"Linux",
".",
"GIDMappings",
"=",
"[",
"]",
"rspec",
".",
"LinuxIDMapping",
"{",
"}",
"\n",
"}"
] |
// ClearLinuxGIDMappings clear g.Config.Linux.GIDMappings.
|
[
"ClearLinuxGIDMappings",
"clear",
"g",
".",
"Config",
".",
"Linux",
".",
"GIDMappings",
"."
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L973-L978
|
14,448 |
opencontainers/runtime-tools
|
generate/generate.go
|
SetLinuxRootPropagation
|
func (g *Generator) SetLinuxRootPropagation(rp string) error {
switch rp {
case "":
case "private":
case "rprivate":
case "slave":
case "rslave":
case "shared":
case "rshared":
case "unbindable":
case "runbindable":
default:
return fmt.Errorf("rootfs-propagation %q must be empty or one of (r)private|(r)slave|(r)shared|(r)unbindable", rp)
}
g.initConfigLinux()
g.Config.Linux.RootfsPropagation = rp
return nil
}
|
go
|
func (g *Generator) SetLinuxRootPropagation(rp string) error {
switch rp {
case "":
case "private":
case "rprivate":
case "slave":
case "rslave":
case "shared":
case "rshared":
case "unbindable":
case "runbindable":
default:
return fmt.Errorf("rootfs-propagation %q must be empty or one of (r)private|(r)slave|(r)shared|(r)unbindable", rp)
}
g.initConfigLinux()
g.Config.Linux.RootfsPropagation = rp
return nil
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"SetLinuxRootPropagation",
"(",
"rp",
"string",
")",
"error",
"{",
"switch",
"rp",
"{",
"case",
"\"",
"\"",
":",
"case",
"\"",
"\"",
":",
"case",
"\"",
"\"",
":",
"case",
"\"",
"\"",
":",
"case",
"\"",
"\"",
":",
"case",
"\"",
"\"",
":",
"case",
"\"",
"\"",
":",
"case",
"\"",
"\"",
":",
"case",
"\"",
"\"",
":",
"default",
":",
"return",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"rp",
")",
"\n",
"}",
"\n",
"g",
".",
"initConfigLinux",
"(",
")",
"\n",
"g",
".",
"Config",
".",
"Linux",
".",
"RootfsPropagation",
"=",
"rp",
"\n",
"return",
"nil",
"\n",
"}"
] |
// SetLinuxRootPropagation sets g.Config.Linux.RootfsPropagation.
|
[
"SetLinuxRootPropagation",
"sets",
"g",
".",
"Config",
".",
"Linux",
".",
"RootfsPropagation",
"."
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L993-L1010
|
14,449 |
opencontainers/runtime-tools
|
generate/generate.go
|
ClearPreStartHooks
|
func (g *Generator) ClearPreStartHooks() {
if g.Config == nil || g.Config.Hooks == nil {
return
}
g.Config.Hooks.Prestart = []rspec.Hook{}
}
|
go
|
func (g *Generator) ClearPreStartHooks() {
if g.Config == nil || g.Config.Hooks == nil {
return
}
g.Config.Hooks.Prestart = []rspec.Hook{}
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"ClearPreStartHooks",
"(",
")",
"{",
"if",
"g",
".",
"Config",
"==",
"nil",
"||",
"g",
".",
"Config",
".",
"Hooks",
"==",
"nil",
"{",
"return",
"\n",
"}",
"\n",
"g",
".",
"Config",
".",
"Hooks",
".",
"Prestart",
"=",
"[",
"]",
"rspec",
".",
"Hook",
"{",
"}",
"\n",
"}"
] |
// ClearPreStartHooks clear g.Config.Hooks.Prestart.
|
[
"ClearPreStartHooks",
"clear",
"g",
".",
"Config",
".",
"Hooks",
".",
"Prestart",
"."
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L1013-L1018
|
14,450 |
opencontainers/runtime-tools
|
generate/generate.go
|
AddPreStartHook
|
func (g *Generator) AddPreStartHook(preStartHook rspec.Hook) error {
g.initConfigHooks()
g.Config.Hooks.Prestart = append(g.Config.Hooks.Prestart, preStartHook)
return nil
}
|
go
|
func (g *Generator) AddPreStartHook(preStartHook rspec.Hook) error {
g.initConfigHooks()
g.Config.Hooks.Prestart = append(g.Config.Hooks.Prestart, preStartHook)
return nil
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"AddPreStartHook",
"(",
"preStartHook",
"rspec",
".",
"Hook",
")",
"error",
"{",
"g",
".",
"initConfigHooks",
"(",
")",
"\n",
"g",
".",
"Config",
".",
"Hooks",
".",
"Prestart",
"=",
"append",
"(",
"g",
".",
"Config",
".",
"Hooks",
".",
"Prestart",
",",
"preStartHook",
")",
"\n",
"return",
"nil",
"\n",
"}"
] |
// AddPreStartHook add a prestart hook into g.Config.Hooks.Prestart.
|
[
"AddPreStartHook",
"add",
"a",
"prestart",
"hook",
"into",
"g",
".",
"Config",
".",
"Hooks",
".",
"Prestart",
"."
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L1021-L1025
|
14,451 |
opencontainers/runtime-tools
|
generate/generate.go
|
ClearPostStopHooks
|
func (g *Generator) ClearPostStopHooks() {
if g.Config == nil || g.Config.Hooks == nil {
return
}
g.Config.Hooks.Poststop = []rspec.Hook{}
}
|
go
|
func (g *Generator) ClearPostStopHooks() {
if g.Config == nil || g.Config.Hooks == nil {
return
}
g.Config.Hooks.Poststop = []rspec.Hook{}
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"ClearPostStopHooks",
"(",
")",
"{",
"if",
"g",
".",
"Config",
"==",
"nil",
"||",
"g",
".",
"Config",
".",
"Hooks",
"==",
"nil",
"{",
"return",
"\n",
"}",
"\n",
"g",
".",
"Config",
".",
"Hooks",
".",
"Poststop",
"=",
"[",
"]",
"rspec",
".",
"Hook",
"{",
"}",
"\n",
"}"
] |
// ClearPostStopHooks clear g.Config.Hooks.Poststop.
|
[
"ClearPostStopHooks",
"clear",
"g",
".",
"Config",
".",
"Hooks",
".",
"Poststop",
"."
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L1028-L1033
|
14,452 |
opencontainers/runtime-tools
|
generate/generate.go
|
AddPostStopHook
|
func (g *Generator) AddPostStopHook(postStopHook rspec.Hook) error {
g.initConfigHooks()
g.Config.Hooks.Poststop = append(g.Config.Hooks.Poststop, postStopHook)
return nil
}
|
go
|
func (g *Generator) AddPostStopHook(postStopHook rspec.Hook) error {
g.initConfigHooks()
g.Config.Hooks.Poststop = append(g.Config.Hooks.Poststop, postStopHook)
return nil
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"AddPostStopHook",
"(",
"postStopHook",
"rspec",
".",
"Hook",
")",
"error",
"{",
"g",
".",
"initConfigHooks",
"(",
")",
"\n",
"g",
".",
"Config",
".",
"Hooks",
".",
"Poststop",
"=",
"append",
"(",
"g",
".",
"Config",
".",
"Hooks",
".",
"Poststop",
",",
"postStopHook",
")",
"\n",
"return",
"nil",
"\n",
"}"
] |
// AddPostStopHook adds a poststop hook into g.Config.Hooks.Poststop.
|
[
"AddPostStopHook",
"adds",
"a",
"poststop",
"hook",
"into",
"g",
".",
"Config",
".",
"Hooks",
".",
"Poststop",
"."
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L1036-L1040
|
14,453 |
opencontainers/runtime-tools
|
generate/generate.go
|
ClearPostStartHooks
|
func (g *Generator) ClearPostStartHooks() {
if g.Config == nil || g.Config.Hooks == nil {
return
}
g.Config.Hooks.Poststart = []rspec.Hook{}
}
|
go
|
func (g *Generator) ClearPostStartHooks() {
if g.Config == nil || g.Config.Hooks == nil {
return
}
g.Config.Hooks.Poststart = []rspec.Hook{}
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"ClearPostStartHooks",
"(",
")",
"{",
"if",
"g",
".",
"Config",
"==",
"nil",
"||",
"g",
".",
"Config",
".",
"Hooks",
"==",
"nil",
"{",
"return",
"\n",
"}",
"\n",
"g",
".",
"Config",
".",
"Hooks",
".",
"Poststart",
"=",
"[",
"]",
"rspec",
".",
"Hook",
"{",
"}",
"\n",
"}"
] |
// ClearPostStartHooks clear g.Config.Hooks.Poststart.
|
[
"ClearPostStartHooks",
"clear",
"g",
".",
"Config",
".",
"Hooks",
".",
"Poststart",
"."
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L1043-L1048
|
14,454 |
opencontainers/runtime-tools
|
generate/generate.go
|
AddPostStartHook
|
func (g *Generator) AddPostStartHook(postStartHook rspec.Hook) error {
g.initConfigHooks()
g.Config.Hooks.Poststart = append(g.Config.Hooks.Poststart, postStartHook)
return nil
}
|
go
|
func (g *Generator) AddPostStartHook(postStartHook rspec.Hook) error {
g.initConfigHooks()
g.Config.Hooks.Poststart = append(g.Config.Hooks.Poststart, postStartHook)
return nil
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"AddPostStartHook",
"(",
"postStartHook",
"rspec",
".",
"Hook",
")",
"error",
"{",
"g",
".",
"initConfigHooks",
"(",
")",
"\n",
"g",
".",
"Config",
".",
"Hooks",
".",
"Poststart",
"=",
"append",
"(",
"g",
".",
"Config",
".",
"Hooks",
".",
"Poststart",
",",
"postStartHook",
")",
"\n",
"return",
"nil",
"\n",
"}"
] |
// AddPostStartHook adds a poststart hook into g.Config.Hooks.Poststart.
|
[
"AddPostStartHook",
"adds",
"a",
"poststart",
"hook",
"into",
"g",
".",
"Config",
".",
"Hooks",
".",
"Poststart",
"."
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L1051-L1055
|
14,455 |
opencontainers/runtime-tools
|
generate/generate.go
|
AddMount
|
func (g *Generator) AddMount(mnt rspec.Mount) {
g.initConfig()
g.Config.Mounts = append(g.Config.Mounts, mnt)
}
|
go
|
func (g *Generator) AddMount(mnt rspec.Mount) {
g.initConfig()
g.Config.Mounts = append(g.Config.Mounts, mnt)
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"AddMount",
"(",
"mnt",
"rspec",
".",
"Mount",
")",
"{",
"g",
".",
"initConfig",
"(",
")",
"\n\n",
"g",
".",
"Config",
".",
"Mounts",
"=",
"append",
"(",
"g",
".",
"Config",
".",
"Mounts",
",",
"mnt",
")",
"\n",
"}"
] |
// AddMount adds a mount into g.Config.Mounts.
|
[
"AddMount",
"adds",
"a",
"mount",
"into",
"g",
".",
"Config",
".",
"Mounts",
"."
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L1058-L1062
|
14,456 |
opencontainers/runtime-tools
|
generate/generate.go
|
RemoveMount
|
func (g *Generator) RemoveMount(dest string) {
g.initConfig()
for index, mount := range g.Config.Mounts {
if mount.Destination == dest {
g.Config.Mounts = append(g.Config.Mounts[:index], g.Config.Mounts[index+1:]...)
return
}
}
}
|
go
|
func (g *Generator) RemoveMount(dest string) {
g.initConfig()
for index, mount := range g.Config.Mounts {
if mount.Destination == dest {
g.Config.Mounts = append(g.Config.Mounts[:index], g.Config.Mounts[index+1:]...)
return
}
}
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"RemoveMount",
"(",
"dest",
"string",
")",
"{",
"g",
".",
"initConfig",
"(",
")",
"\n\n",
"for",
"index",
",",
"mount",
":=",
"range",
"g",
".",
"Config",
".",
"Mounts",
"{",
"if",
"mount",
".",
"Destination",
"==",
"dest",
"{",
"g",
".",
"Config",
".",
"Mounts",
"=",
"append",
"(",
"g",
".",
"Config",
".",
"Mounts",
"[",
":",
"index",
"]",
",",
"g",
".",
"Config",
".",
"Mounts",
"[",
"index",
"+",
"1",
":",
"]",
"...",
")",
"\n",
"return",
"\n",
"}",
"\n",
"}",
"\n",
"}"
] |
// RemoveMount removes a mount point on the dest directory
|
[
"RemoveMount",
"removes",
"a",
"mount",
"point",
"on",
"the",
"dest",
"directory"
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L1065-L1074
|
14,457 |
opencontainers/runtime-tools
|
generate/generate.go
|
Mounts
|
func (g *Generator) Mounts() []rspec.Mount {
g.initConfig()
return g.Config.Mounts
}
|
go
|
func (g *Generator) Mounts() []rspec.Mount {
g.initConfig()
return g.Config.Mounts
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"Mounts",
"(",
")",
"[",
"]",
"rspec",
".",
"Mount",
"{",
"g",
".",
"initConfig",
"(",
")",
"\n\n",
"return",
"g",
".",
"Config",
".",
"Mounts",
"\n",
"}"
] |
// Mounts returns the list of mounts
|
[
"Mounts",
"returns",
"the",
"list",
"of",
"mounts"
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L1077-L1081
|
14,458 |
opencontainers/runtime-tools
|
generate/generate.go
|
ClearMounts
|
func (g *Generator) ClearMounts() {
if g.Config == nil {
return
}
g.Config.Mounts = []rspec.Mount{}
}
|
go
|
func (g *Generator) ClearMounts() {
if g.Config == nil {
return
}
g.Config.Mounts = []rspec.Mount{}
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"ClearMounts",
"(",
")",
"{",
"if",
"g",
".",
"Config",
"==",
"nil",
"{",
"return",
"\n",
"}",
"\n",
"g",
".",
"Config",
".",
"Mounts",
"=",
"[",
"]",
"rspec",
".",
"Mount",
"{",
"}",
"\n",
"}"
] |
// ClearMounts clear g.Config.Mounts
|
[
"ClearMounts",
"clear",
"g",
".",
"Config",
".",
"Mounts"
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L1084-L1089
|
14,459 |
opencontainers/runtime-tools
|
generate/generate.go
|
SetupPrivileged
|
func (g *Generator) SetupPrivileged(privileged bool) {
if privileged { // Add all capabilities in privileged mode.
var finalCapList []string
for _, cap := range capability.List() {
if g.HostSpecific && cap > validate.LastCap() {
continue
}
finalCapList = append(finalCapList, fmt.Sprintf("CAP_%s", strings.ToUpper(cap.String())))
}
g.initConfigLinux()
g.initConfigProcessCapabilities()
g.ClearProcessCapabilities()
g.Config.Process.Capabilities.Bounding = append(g.Config.Process.Capabilities.Bounding, finalCapList...)
g.Config.Process.Capabilities.Effective = append(g.Config.Process.Capabilities.Effective, finalCapList...)
g.Config.Process.Capabilities.Inheritable = append(g.Config.Process.Capabilities.Inheritable, finalCapList...)
g.Config.Process.Capabilities.Permitted = append(g.Config.Process.Capabilities.Permitted, finalCapList...)
g.Config.Process.Capabilities.Ambient = append(g.Config.Process.Capabilities.Ambient, finalCapList...)
g.Config.Process.SelinuxLabel = ""
g.Config.Process.ApparmorProfile = ""
g.Config.Linux.Seccomp = nil
}
}
|
go
|
func (g *Generator) SetupPrivileged(privileged bool) {
if privileged { // Add all capabilities in privileged mode.
var finalCapList []string
for _, cap := range capability.List() {
if g.HostSpecific && cap > validate.LastCap() {
continue
}
finalCapList = append(finalCapList, fmt.Sprintf("CAP_%s", strings.ToUpper(cap.String())))
}
g.initConfigLinux()
g.initConfigProcessCapabilities()
g.ClearProcessCapabilities()
g.Config.Process.Capabilities.Bounding = append(g.Config.Process.Capabilities.Bounding, finalCapList...)
g.Config.Process.Capabilities.Effective = append(g.Config.Process.Capabilities.Effective, finalCapList...)
g.Config.Process.Capabilities.Inheritable = append(g.Config.Process.Capabilities.Inheritable, finalCapList...)
g.Config.Process.Capabilities.Permitted = append(g.Config.Process.Capabilities.Permitted, finalCapList...)
g.Config.Process.Capabilities.Ambient = append(g.Config.Process.Capabilities.Ambient, finalCapList...)
g.Config.Process.SelinuxLabel = ""
g.Config.Process.ApparmorProfile = ""
g.Config.Linux.Seccomp = nil
}
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"SetupPrivileged",
"(",
"privileged",
"bool",
")",
"{",
"if",
"privileged",
"{",
"// Add all capabilities in privileged mode.",
"var",
"finalCapList",
"[",
"]",
"string",
"\n",
"for",
"_",
",",
"cap",
":=",
"range",
"capability",
".",
"List",
"(",
")",
"{",
"if",
"g",
".",
"HostSpecific",
"&&",
"cap",
">",
"validate",
".",
"LastCap",
"(",
")",
"{",
"continue",
"\n",
"}",
"\n",
"finalCapList",
"=",
"append",
"(",
"finalCapList",
",",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"strings",
".",
"ToUpper",
"(",
"cap",
".",
"String",
"(",
")",
")",
")",
")",
"\n",
"}",
"\n",
"g",
".",
"initConfigLinux",
"(",
")",
"\n",
"g",
".",
"initConfigProcessCapabilities",
"(",
")",
"\n",
"g",
".",
"ClearProcessCapabilities",
"(",
")",
"\n",
"g",
".",
"Config",
".",
"Process",
".",
"Capabilities",
".",
"Bounding",
"=",
"append",
"(",
"g",
".",
"Config",
".",
"Process",
".",
"Capabilities",
".",
"Bounding",
",",
"finalCapList",
"...",
")",
"\n",
"g",
".",
"Config",
".",
"Process",
".",
"Capabilities",
".",
"Effective",
"=",
"append",
"(",
"g",
".",
"Config",
".",
"Process",
".",
"Capabilities",
".",
"Effective",
",",
"finalCapList",
"...",
")",
"\n",
"g",
".",
"Config",
".",
"Process",
".",
"Capabilities",
".",
"Inheritable",
"=",
"append",
"(",
"g",
".",
"Config",
".",
"Process",
".",
"Capabilities",
".",
"Inheritable",
",",
"finalCapList",
"...",
")",
"\n",
"g",
".",
"Config",
".",
"Process",
".",
"Capabilities",
".",
"Permitted",
"=",
"append",
"(",
"g",
".",
"Config",
".",
"Process",
".",
"Capabilities",
".",
"Permitted",
",",
"finalCapList",
"...",
")",
"\n",
"g",
".",
"Config",
".",
"Process",
".",
"Capabilities",
".",
"Ambient",
"=",
"append",
"(",
"g",
".",
"Config",
".",
"Process",
".",
"Capabilities",
".",
"Ambient",
",",
"finalCapList",
"...",
")",
"\n",
"g",
".",
"Config",
".",
"Process",
".",
"SelinuxLabel",
"=",
"\"",
"\"",
"\n",
"g",
".",
"Config",
".",
"Process",
".",
"ApparmorProfile",
"=",
"\"",
"\"",
"\n",
"g",
".",
"Config",
".",
"Linux",
".",
"Seccomp",
"=",
"nil",
"\n",
"}",
"\n",
"}"
] |
// SetupPrivileged sets up the privilege-related fields inside g.Config.
|
[
"SetupPrivileged",
"sets",
"up",
"the",
"privilege",
"-",
"related",
"fields",
"inside",
"g",
".",
"Config",
"."
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L1092-L1113
|
14,460 |
opencontainers/runtime-tools
|
generate/generate.go
|
ClearProcessCapabilities
|
func (g *Generator) ClearProcessCapabilities() {
if g.Config == nil || g.Config.Process == nil || g.Config.Process.Capabilities == nil {
return
}
g.Config.Process.Capabilities.Bounding = []string{}
g.Config.Process.Capabilities.Effective = []string{}
g.Config.Process.Capabilities.Inheritable = []string{}
g.Config.Process.Capabilities.Permitted = []string{}
g.Config.Process.Capabilities.Ambient = []string{}
}
|
go
|
func (g *Generator) ClearProcessCapabilities() {
if g.Config == nil || g.Config.Process == nil || g.Config.Process.Capabilities == nil {
return
}
g.Config.Process.Capabilities.Bounding = []string{}
g.Config.Process.Capabilities.Effective = []string{}
g.Config.Process.Capabilities.Inheritable = []string{}
g.Config.Process.Capabilities.Permitted = []string{}
g.Config.Process.Capabilities.Ambient = []string{}
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"ClearProcessCapabilities",
"(",
")",
"{",
"if",
"g",
".",
"Config",
"==",
"nil",
"||",
"g",
".",
"Config",
".",
"Process",
"==",
"nil",
"||",
"g",
".",
"Config",
".",
"Process",
".",
"Capabilities",
"==",
"nil",
"{",
"return",
"\n",
"}",
"\n",
"g",
".",
"Config",
".",
"Process",
".",
"Capabilities",
".",
"Bounding",
"=",
"[",
"]",
"string",
"{",
"}",
"\n",
"g",
".",
"Config",
".",
"Process",
".",
"Capabilities",
".",
"Effective",
"=",
"[",
"]",
"string",
"{",
"}",
"\n",
"g",
".",
"Config",
".",
"Process",
".",
"Capabilities",
".",
"Inheritable",
"=",
"[",
"]",
"string",
"{",
"}",
"\n",
"g",
".",
"Config",
".",
"Process",
".",
"Capabilities",
".",
"Permitted",
"=",
"[",
"]",
"string",
"{",
"}",
"\n",
"g",
".",
"Config",
".",
"Process",
".",
"Capabilities",
".",
"Ambient",
"=",
"[",
"]",
"string",
"{",
"}",
"\n",
"}"
] |
// ClearProcessCapabilities clear g.Config.Process.Capabilities.
|
[
"ClearProcessCapabilities",
"clear",
"g",
".",
"Config",
".",
"Process",
".",
"Capabilities",
"."
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L1116-L1125
|
14,461 |
opencontainers/runtime-tools
|
generate/generate.go
|
AddProcessCapability
|
func (g *Generator) AddProcessCapability(c string) error {
cp := strings.ToUpper(c)
if err := validate.CapValid(cp, g.HostSpecific); err != nil {
return err
}
g.initConfigProcessCapabilities()
var foundAmbient, foundBounding, foundEffective, foundInheritable, foundPermitted bool
for _, cap := range g.Config.Process.Capabilities.Ambient {
if strings.ToUpper(cap) == cp {
foundAmbient = true
break
}
}
if !foundAmbient {
g.Config.Process.Capabilities.Ambient = append(g.Config.Process.Capabilities.Ambient, cp)
}
for _, cap := range g.Config.Process.Capabilities.Bounding {
if strings.ToUpper(cap) == cp {
foundBounding = true
break
}
}
if !foundBounding {
g.Config.Process.Capabilities.Bounding = append(g.Config.Process.Capabilities.Bounding, cp)
}
for _, cap := range g.Config.Process.Capabilities.Effective {
if strings.ToUpper(cap) == cp {
foundEffective = true
break
}
}
if !foundEffective {
g.Config.Process.Capabilities.Effective = append(g.Config.Process.Capabilities.Effective, cp)
}
for _, cap := range g.Config.Process.Capabilities.Inheritable {
if strings.ToUpper(cap) == cp {
foundInheritable = true
break
}
}
if !foundInheritable {
g.Config.Process.Capabilities.Inheritable = append(g.Config.Process.Capabilities.Inheritable, cp)
}
for _, cap := range g.Config.Process.Capabilities.Permitted {
if strings.ToUpper(cap) == cp {
foundPermitted = true
break
}
}
if !foundPermitted {
g.Config.Process.Capabilities.Permitted = append(g.Config.Process.Capabilities.Permitted, cp)
}
return nil
}
|
go
|
func (g *Generator) AddProcessCapability(c string) error {
cp := strings.ToUpper(c)
if err := validate.CapValid(cp, g.HostSpecific); err != nil {
return err
}
g.initConfigProcessCapabilities()
var foundAmbient, foundBounding, foundEffective, foundInheritable, foundPermitted bool
for _, cap := range g.Config.Process.Capabilities.Ambient {
if strings.ToUpper(cap) == cp {
foundAmbient = true
break
}
}
if !foundAmbient {
g.Config.Process.Capabilities.Ambient = append(g.Config.Process.Capabilities.Ambient, cp)
}
for _, cap := range g.Config.Process.Capabilities.Bounding {
if strings.ToUpper(cap) == cp {
foundBounding = true
break
}
}
if !foundBounding {
g.Config.Process.Capabilities.Bounding = append(g.Config.Process.Capabilities.Bounding, cp)
}
for _, cap := range g.Config.Process.Capabilities.Effective {
if strings.ToUpper(cap) == cp {
foundEffective = true
break
}
}
if !foundEffective {
g.Config.Process.Capabilities.Effective = append(g.Config.Process.Capabilities.Effective, cp)
}
for _, cap := range g.Config.Process.Capabilities.Inheritable {
if strings.ToUpper(cap) == cp {
foundInheritable = true
break
}
}
if !foundInheritable {
g.Config.Process.Capabilities.Inheritable = append(g.Config.Process.Capabilities.Inheritable, cp)
}
for _, cap := range g.Config.Process.Capabilities.Permitted {
if strings.ToUpper(cap) == cp {
foundPermitted = true
break
}
}
if !foundPermitted {
g.Config.Process.Capabilities.Permitted = append(g.Config.Process.Capabilities.Permitted, cp)
}
return nil
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"AddProcessCapability",
"(",
"c",
"string",
")",
"error",
"{",
"cp",
":=",
"strings",
".",
"ToUpper",
"(",
"c",
")",
"\n",
"if",
"err",
":=",
"validate",
".",
"CapValid",
"(",
"cp",
",",
"g",
".",
"HostSpecific",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"g",
".",
"initConfigProcessCapabilities",
"(",
")",
"\n\n",
"var",
"foundAmbient",
",",
"foundBounding",
",",
"foundEffective",
",",
"foundInheritable",
",",
"foundPermitted",
"bool",
"\n",
"for",
"_",
",",
"cap",
":=",
"range",
"g",
".",
"Config",
".",
"Process",
".",
"Capabilities",
".",
"Ambient",
"{",
"if",
"strings",
".",
"ToUpper",
"(",
"cap",
")",
"==",
"cp",
"{",
"foundAmbient",
"=",
"true",
"\n",
"break",
"\n",
"}",
"\n",
"}",
"\n",
"if",
"!",
"foundAmbient",
"{",
"g",
".",
"Config",
".",
"Process",
".",
"Capabilities",
".",
"Ambient",
"=",
"append",
"(",
"g",
".",
"Config",
".",
"Process",
".",
"Capabilities",
".",
"Ambient",
",",
"cp",
")",
"\n",
"}",
"\n\n",
"for",
"_",
",",
"cap",
":=",
"range",
"g",
".",
"Config",
".",
"Process",
".",
"Capabilities",
".",
"Bounding",
"{",
"if",
"strings",
".",
"ToUpper",
"(",
"cap",
")",
"==",
"cp",
"{",
"foundBounding",
"=",
"true",
"\n",
"break",
"\n",
"}",
"\n",
"}",
"\n",
"if",
"!",
"foundBounding",
"{",
"g",
".",
"Config",
".",
"Process",
".",
"Capabilities",
".",
"Bounding",
"=",
"append",
"(",
"g",
".",
"Config",
".",
"Process",
".",
"Capabilities",
".",
"Bounding",
",",
"cp",
")",
"\n",
"}",
"\n\n",
"for",
"_",
",",
"cap",
":=",
"range",
"g",
".",
"Config",
".",
"Process",
".",
"Capabilities",
".",
"Effective",
"{",
"if",
"strings",
".",
"ToUpper",
"(",
"cap",
")",
"==",
"cp",
"{",
"foundEffective",
"=",
"true",
"\n",
"break",
"\n",
"}",
"\n",
"}",
"\n",
"if",
"!",
"foundEffective",
"{",
"g",
".",
"Config",
".",
"Process",
".",
"Capabilities",
".",
"Effective",
"=",
"append",
"(",
"g",
".",
"Config",
".",
"Process",
".",
"Capabilities",
".",
"Effective",
",",
"cp",
")",
"\n",
"}",
"\n\n",
"for",
"_",
",",
"cap",
":=",
"range",
"g",
".",
"Config",
".",
"Process",
".",
"Capabilities",
".",
"Inheritable",
"{",
"if",
"strings",
".",
"ToUpper",
"(",
"cap",
")",
"==",
"cp",
"{",
"foundInheritable",
"=",
"true",
"\n",
"break",
"\n",
"}",
"\n",
"}",
"\n",
"if",
"!",
"foundInheritable",
"{",
"g",
".",
"Config",
".",
"Process",
".",
"Capabilities",
".",
"Inheritable",
"=",
"append",
"(",
"g",
".",
"Config",
".",
"Process",
".",
"Capabilities",
".",
"Inheritable",
",",
"cp",
")",
"\n",
"}",
"\n\n",
"for",
"_",
",",
"cap",
":=",
"range",
"g",
".",
"Config",
".",
"Process",
".",
"Capabilities",
".",
"Permitted",
"{",
"if",
"strings",
".",
"ToUpper",
"(",
"cap",
")",
"==",
"cp",
"{",
"foundPermitted",
"=",
"true",
"\n",
"break",
"\n",
"}",
"\n",
"}",
"\n",
"if",
"!",
"foundPermitted",
"{",
"g",
".",
"Config",
".",
"Process",
".",
"Capabilities",
".",
"Permitted",
"=",
"append",
"(",
"g",
".",
"Config",
".",
"Process",
".",
"Capabilities",
".",
"Permitted",
",",
"cp",
")",
"\n",
"}",
"\n\n",
"return",
"nil",
"\n",
"}"
] |
// AddProcessCapability adds a process capability into all 5 capability sets.
|
[
"AddProcessCapability",
"adds",
"a",
"process",
"capability",
"into",
"all",
"5",
"capability",
"sets",
"."
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L1128-L1188
|
14,462 |
opencontainers/runtime-tools
|
generate/generate.go
|
AddProcessCapabilityAmbient
|
func (g *Generator) AddProcessCapabilityAmbient(c string) error {
cp := strings.ToUpper(c)
if err := validate.CapValid(cp, g.HostSpecific); err != nil {
return err
}
g.initConfigProcessCapabilities()
var foundAmbient bool
for _, cap := range g.Config.Process.Capabilities.Ambient {
if strings.ToUpper(cap) == cp {
foundAmbient = true
break
}
}
if !foundAmbient {
g.Config.Process.Capabilities.Ambient = append(g.Config.Process.Capabilities.Ambient, cp)
}
return nil
}
|
go
|
func (g *Generator) AddProcessCapabilityAmbient(c string) error {
cp := strings.ToUpper(c)
if err := validate.CapValid(cp, g.HostSpecific); err != nil {
return err
}
g.initConfigProcessCapabilities()
var foundAmbient bool
for _, cap := range g.Config.Process.Capabilities.Ambient {
if strings.ToUpper(cap) == cp {
foundAmbient = true
break
}
}
if !foundAmbient {
g.Config.Process.Capabilities.Ambient = append(g.Config.Process.Capabilities.Ambient, cp)
}
return nil
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"AddProcessCapabilityAmbient",
"(",
"c",
"string",
")",
"error",
"{",
"cp",
":=",
"strings",
".",
"ToUpper",
"(",
"c",
")",
"\n",
"if",
"err",
":=",
"validate",
".",
"CapValid",
"(",
"cp",
",",
"g",
".",
"HostSpecific",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"g",
".",
"initConfigProcessCapabilities",
"(",
")",
"\n\n",
"var",
"foundAmbient",
"bool",
"\n",
"for",
"_",
",",
"cap",
":=",
"range",
"g",
".",
"Config",
".",
"Process",
".",
"Capabilities",
".",
"Ambient",
"{",
"if",
"strings",
".",
"ToUpper",
"(",
"cap",
")",
"==",
"cp",
"{",
"foundAmbient",
"=",
"true",
"\n",
"break",
"\n",
"}",
"\n",
"}",
"\n\n",
"if",
"!",
"foundAmbient",
"{",
"g",
".",
"Config",
".",
"Process",
".",
"Capabilities",
".",
"Ambient",
"=",
"append",
"(",
"g",
".",
"Config",
".",
"Process",
".",
"Capabilities",
".",
"Ambient",
",",
"cp",
")",
"\n",
"}",
"\n\n",
"return",
"nil",
"\n",
"}"
] |
// AddProcessCapabilityAmbient adds a process capability into g.Config.Process.Capabilities.Ambient.
|
[
"AddProcessCapabilityAmbient",
"adds",
"a",
"process",
"capability",
"into",
"g",
".",
"Config",
".",
"Process",
".",
"Capabilities",
".",
"Ambient",
"."
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L1191-L1212
|
14,463 |
opencontainers/runtime-tools
|
generate/generate.go
|
AddProcessCapabilityBounding
|
func (g *Generator) AddProcessCapabilityBounding(c string) error {
cp := strings.ToUpper(c)
if err := validate.CapValid(cp, g.HostSpecific); err != nil {
return err
}
g.initConfigProcessCapabilities()
var foundBounding bool
for _, cap := range g.Config.Process.Capabilities.Bounding {
if strings.ToUpper(cap) == cp {
foundBounding = true
break
}
}
if !foundBounding {
g.Config.Process.Capabilities.Bounding = append(g.Config.Process.Capabilities.Bounding, cp)
}
return nil
}
|
go
|
func (g *Generator) AddProcessCapabilityBounding(c string) error {
cp := strings.ToUpper(c)
if err := validate.CapValid(cp, g.HostSpecific); err != nil {
return err
}
g.initConfigProcessCapabilities()
var foundBounding bool
for _, cap := range g.Config.Process.Capabilities.Bounding {
if strings.ToUpper(cap) == cp {
foundBounding = true
break
}
}
if !foundBounding {
g.Config.Process.Capabilities.Bounding = append(g.Config.Process.Capabilities.Bounding, cp)
}
return nil
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"AddProcessCapabilityBounding",
"(",
"c",
"string",
")",
"error",
"{",
"cp",
":=",
"strings",
".",
"ToUpper",
"(",
"c",
")",
"\n",
"if",
"err",
":=",
"validate",
".",
"CapValid",
"(",
"cp",
",",
"g",
".",
"HostSpecific",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"g",
".",
"initConfigProcessCapabilities",
"(",
")",
"\n\n",
"var",
"foundBounding",
"bool",
"\n",
"for",
"_",
",",
"cap",
":=",
"range",
"g",
".",
"Config",
".",
"Process",
".",
"Capabilities",
".",
"Bounding",
"{",
"if",
"strings",
".",
"ToUpper",
"(",
"cap",
")",
"==",
"cp",
"{",
"foundBounding",
"=",
"true",
"\n",
"break",
"\n",
"}",
"\n",
"}",
"\n",
"if",
"!",
"foundBounding",
"{",
"g",
".",
"Config",
".",
"Process",
".",
"Capabilities",
".",
"Bounding",
"=",
"append",
"(",
"g",
".",
"Config",
".",
"Process",
".",
"Capabilities",
".",
"Bounding",
",",
"cp",
")",
"\n",
"}",
"\n\n",
"return",
"nil",
"\n",
"}"
] |
// AddProcessCapabilityBounding adds a process capability into g.Config.Process.Capabilities.Bounding.
|
[
"AddProcessCapabilityBounding",
"adds",
"a",
"process",
"capability",
"into",
"g",
".",
"Config",
".",
"Process",
".",
"Capabilities",
".",
"Bounding",
"."
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L1215-L1235
|
14,464 |
opencontainers/runtime-tools
|
generate/generate.go
|
AddProcessCapabilityEffective
|
func (g *Generator) AddProcessCapabilityEffective(c string) error {
cp := strings.ToUpper(c)
if err := validate.CapValid(cp, g.HostSpecific); err != nil {
return err
}
g.initConfigProcessCapabilities()
var foundEffective bool
for _, cap := range g.Config.Process.Capabilities.Effective {
if strings.ToUpper(cap) == cp {
foundEffective = true
break
}
}
if !foundEffective {
g.Config.Process.Capabilities.Effective = append(g.Config.Process.Capabilities.Effective, cp)
}
return nil
}
|
go
|
func (g *Generator) AddProcessCapabilityEffective(c string) error {
cp := strings.ToUpper(c)
if err := validate.CapValid(cp, g.HostSpecific); err != nil {
return err
}
g.initConfigProcessCapabilities()
var foundEffective bool
for _, cap := range g.Config.Process.Capabilities.Effective {
if strings.ToUpper(cap) == cp {
foundEffective = true
break
}
}
if !foundEffective {
g.Config.Process.Capabilities.Effective = append(g.Config.Process.Capabilities.Effective, cp)
}
return nil
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"AddProcessCapabilityEffective",
"(",
"c",
"string",
")",
"error",
"{",
"cp",
":=",
"strings",
".",
"ToUpper",
"(",
"c",
")",
"\n",
"if",
"err",
":=",
"validate",
".",
"CapValid",
"(",
"cp",
",",
"g",
".",
"HostSpecific",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"g",
".",
"initConfigProcessCapabilities",
"(",
")",
"\n\n",
"var",
"foundEffective",
"bool",
"\n",
"for",
"_",
",",
"cap",
":=",
"range",
"g",
".",
"Config",
".",
"Process",
".",
"Capabilities",
".",
"Effective",
"{",
"if",
"strings",
".",
"ToUpper",
"(",
"cap",
")",
"==",
"cp",
"{",
"foundEffective",
"=",
"true",
"\n",
"break",
"\n",
"}",
"\n",
"}",
"\n",
"if",
"!",
"foundEffective",
"{",
"g",
".",
"Config",
".",
"Process",
".",
"Capabilities",
".",
"Effective",
"=",
"append",
"(",
"g",
".",
"Config",
".",
"Process",
".",
"Capabilities",
".",
"Effective",
",",
"cp",
")",
"\n",
"}",
"\n\n",
"return",
"nil",
"\n",
"}"
] |
// AddProcessCapabilityEffective adds a process capability into g.Config.Process.Capabilities.Effective.
|
[
"AddProcessCapabilityEffective",
"adds",
"a",
"process",
"capability",
"into",
"g",
".",
"Config",
".",
"Process",
".",
"Capabilities",
".",
"Effective",
"."
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L1238-L1258
|
14,465 |
opencontainers/runtime-tools
|
generate/generate.go
|
AddProcessCapabilityInheritable
|
func (g *Generator) AddProcessCapabilityInheritable(c string) error {
cp := strings.ToUpper(c)
if err := validate.CapValid(cp, g.HostSpecific); err != nil {
return err
}
g.initConfigProcessCapabilities()
var foundInheritable bool
for _, cap := range g.Config.Process.Capabilities.Inheritable {
if strings.ToUpper(cap) == cp {
foundInheritable = true
break
}
}
if !foundInheritable {
g.Config.Process.Capabilities.Inheritable = append(g.Config.Process.Capabilities.Inheritable, cp)
}
return nil
}
|
go
|
func (g *Generator) AddProcessCapabilityInheritable(c string) error {
cp := strings.ToUpper(c)
if err := validate.CapValid(cp, g.HostSpecific); err != nil {
return err
}
g.initConfigProcessCapabilities()
var foundInheritable bool
for _, cap := range g.Config.Process.Capabilities.Inheritable {
if strings.ToUpper(cap) == cp {
foundInheritable = true
break
}
}
if !foundInheritable {
g.Config.Process.Capabilities.Inheritable = append(g.Config.Process.Capabilities.Inheritable, cp)
}
return nil
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"AddProcessCapabilityInheritable",
"(",
"c",
"string",
")",
"error",
"{",
"cp",
":=",
"strings",
".",
"ToUpper",
"(",
"c",
")",
"\n",
"if",
"err",
":=",
"validate",
".",
"CapValid",
"(",
"cp",
",",
"g",
".",
"HostSpecific",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"g",
".",
"initConfigProcessCapabilities",
"(",
")",
"\n\n",
"var",
"foundInheritable",
"bool",
"\n",
"for",
"_",
",",
"cap",
":=",
"range",
"g",
".",
"Config",
".",
"Process",
".",
"Capabilities",
".",
"Inheritable",
"{",
"if",
"strings",
".",
"ToUpper",
"(",
"cap",
")",
"==",
"cp",
"{",
"foundInheritable",
"=",
"true",
"\n",
"break",
"\n",
"}",
"\n",
"}",
"\n",
"if",
"!",
"foundInheritable",
"{",
"g",
".",
"Config",
".",
"Process",
".",
"Capabilities",
".",
"Inheritable",
"=",
"append",
"(",
"g",
".",
"Config",
".",
"Process",
".",
"Capabilities",
".",
"Inheritable",
",",
"cp",
")",
"\n",
"}",
"\n\n",
"return",
"nil",
"\n",
"}"
] |
// AddProcessCapabilityInheritable adds a process capability into g.Config.Process.Capabilities.Inheritable.
|
[
"AddProcessCapabilityInheritable",
"adds",
"a",
"process",
"capability",
"into",
"g",
".",
"Config",
".",
"Process",
".",
"Capabilities",
".",
"Inheritable",
"."
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L1261-L1281
|
14,466 |
opencontainers/runtime-tools
|
generate/generate.go
|
AddProcessCapabilityPermitted
|
func (g *Generator) AddProcessCapabilityPermitted(c string) error {
cp := strings.ToUpper(c)
if err := validate.CapValid(cp, g.HostSpecific); err != nil {
return err
}
g.initConfigProcessCapabilities()
var foundPermitted bool
for _, cap := range g.Config.Process.Capabilities.Permitted {
if strings.ToUpper(cap) == cp {
foundPermitted = true
break
}
}
if !foundPermitted {
g.Config.Process.Capabilities.Permitted = append(g.Config.Process.Capabilities.Permitted, cp)
}
return nil
}
|
go
|
func (g *Generator) AddProcessCapabilityPermitted(c string) error {
cp := strings.ToUpper(c)
if err := validate.CapValid(cp, g.HostSpecific); err != nil {
return err
}
g.initConfigProcessCapabilities()
var foundPermitted bool
for _, cap := range g.Config.Process.Capabilities.Permitted {
if strings.ToUpper(cap) == cp {
foundPermitted = true
break
}
}
if !foundPermitted {
g.Config.Process.Capabilities.Permitted = append(g.Config.Process.Capabilities.Permitted, cp)
}
return nil
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"AddProcessCapabilityPermitted",
"(",
"c",
"string",
")",
"error",
"{",
"cp",
":=",
"strings",
".",
"ToUpper",
"(",
"c",
")",
"\n",
"if",
"err",
":=",
"validate",
".",
"CapValid",
"(",
"cp",
",",
"g",
".",
"HostSpecific",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"g",
".",
"initConfigProcessCapabilities",
"(",
")",
"\n\n",
"var",
"foundPermitted",
"bool",
"\n",
"for",
"_",
",",
"cap",
":=",
"range",
"g",
".",
"Config",
".",
"Process",
".",
"Capabilities",
".",
"Permitted",
"{",
"if",
"strings",
".",
"ToUpper",
"(",
"cap",
")",
"==",
"cp",
"{",
"foundPermitted",
"=",
"true",
"\n",
"break",
"\n",
"}",
"\n",
"}",
"\n",
"if",
"!",
"foundPermitted",
"{",
"g",
".",
"Config",
".",
"Process",
".",
"Capabilities",
".",
"Permitted",
"=",
"append",
"(",
"g",
".",
"Config",
".",
"Process",
".",
"Capabilities",
".",
"Permitted",
",",
"cp",
")",
"\n",
"}",
"\n\n",
"return",
"nil",
"\n",
"}"
] |
// AddProcessCapabilityPermitted adds a process capability into g.Config.Process.Capabilities.Permitted.
|
[
"AddProcessCapabilityPermitted",
"adds",
"a",
"process",
"capability",
"into",
"g",
".",
"Config",
".",
"Process",
".",
"Capabilities",
".",
"Permitted",
"."
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L1284-L1304
|
14,467 |
opencontainers/runtime-tools
|
generate/generate.go
|
DropProcessCapability
|
func (g *Generator) DropProcessCapability(c string) error {
if g.Config == nil || g.Config.Process == nil || g.Config.Process.Capabilities == nil {
return nil
}
cp := strings.ToUpper(c)
for i, cap := range g.Config.Process.Capabilities.Ambient {
if strings.ToUpper(cap) == cp {
g.Config.Process.Capabilities.Ambient = removeFunc(g.Config.Process.Capabilities.Ambient, i)
}
}
for i, cap := range g.Config.Process.Capabilities.Bounding {
if strings.ToUpper(cap) == cp {
g.Config.Process.Capabilities.Bounding = removeFunc(g.Config.Process.Capabilities.Bounding, i)
}
}
for i, cap := range g.Config.Process.Capabilities.Effective {
if strings.ToUpper(cap) == cp {
g.Config.Process.Capabilities.Effective = removeFunc(g.Config.Process.Capabilities.Effective, i)
}
}
for i, cap := range g.Config.Process.Capabilities.Inheritable {
if strings.ToUpper(cap) == cp {
g.Config.Process.Capabilities.Inheritable = removeFunc(g.Config.Process.Capabilities.Inheritable, i)
}
}
for i, cap := range g.Config.Process.Capabilities.Permitted {
if strings.ToUpper(cap) == cp {
g.Config.Process.Capabilities.Permitted = removeFunc(g.Config.Process.Capabilities.Permitted, i)
}
}
return validate.CapValid(cp, false)
}
|
go
|
func (g *Generator) DropProcessCapability(c string) error {
if g.Config == nil || g.Config.Process == nil || g.Config.Process.Capabilities == nil {
return nil
}
cp := strings.ToUpper(c)
for i, cap := range g.Config.Process.Capabilities.Ambient {
if strings.ToUpper(cap) == cp {
g.Config.Process.Capabilities.Ambient = removeFunc(g.Config.Process.Capabilities.Ambient, i)
}
}
for i, cap := range g.Config.Process.Capabilities.Bounding {
if strings.ToUpper(cap) == cp {
g.Config.Process.Capabilities.Bounding = removeFunc(g.Config.Process.Capabilities.Bounding, i)
}
}
for i, cap := range g.Config.Process.Capabilities.Effective {
if strings.ToUpper(cap) == cp {
g.Config.Process.Capabilities.Effective = removeFunc(g.Config.Process.Capabilities.Effective, i)
}
}
for i, cap := range g.Config.Process.Capabilities.Inheritable {
if strings.ToUpper(cap) == cp {
g.Config.Process.Capabilities.Inheritable = removeFunc(g.Config.Process.Capabilities.Inheritable, i)
}
}
for i, cap := range g.Config.Process.Capabilities.Permitted {
if strings.ToUpper(cap) == cp {
g.Config.Process.Capabilities.Permitted = removeFunc(g.Config.Process.Capabilities.Permitted, i)
}
}
return validate.CapValid(cp, false)
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"DropProcessCapability",
"(",
"c",
"string",
")",
"error",
"{",
"if",
"g",
".",
"Config",
"==",
"nil",
"||",
"g",
".",
"Config",
".",
"Process",
"==",
"nil",
"||",
"g",
".",
"Config",
".",
"Process",
".",
"Capabilities",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n\n",
"cp",
":=",
"strings",
".",
"ToUpper",
"(",
"c",
")",
"\n",
"for",
"i",
",",
"cap",
":=",
"range",
"g",
".",
"Config",
".",
"Process",
".",
"Capabilities",
".",
"Ambient",
"{",
"if",
"strings",
".",
"ToUpper",
"(",
"cap",
")",
"==",
"cp",
"{",
"g",
".",
"Config",
".",
"Process",
".",
"Capabilities",
".",
"Ambient",
"=",
"removeFunc",
"(",
"g",
".",
"Config",
".",
"Process",
".",
"Capabilities",
".",
"Ambient",
",",
"i",
")",
"\n",
"}",
"\n",
"}",
"\n",
"for",
"i",
",",
"cap",
":=",
"range",
"g",
".",
"Config",
".",
"Process",
".",
"Capabilities",
".",
"Bounding",
"{",
"if",
"strings",
".",
"ToUpper",
"(",
"cap",
")",
"==",
"cp",
"{",
"g",
".",
"Config",
".",
"Process",
".",
"Capabilities",
".",
"Bounding",
"=",
"removeFunc",
"(",
"g",
".",
"Config",
".",
"Process",
".",
"Capabilities",
".",
"Bounding",
",",
"i",
")",
"\n",
"}",
"\n",
"}",
"\n",
"for",
"i",
",",
"cap",
":=",
"range",
"g",
".",
"Config",
".",
"Process",
".",
"Capabilities",
".",
"Effective",
"{",
"if",
"strings",
".",
"ToUpper",
"(",
"cap",
")",
"==",
"cp",
"{",
"g",
".",
"Config",
".",
"Process",
".",
"Capabilities",
".",
"Effective",
"=",
"removeFunc",
"(",
"g",
".",
"Config",
".",
"Process",
".",
"Capabilities",
".",
"Effective",
",",
"i",
")",
"\n",
"}",
"\n",
"}",
"\n",
"for",
"i",
",",
"cap",
":=",
"range",
"g",
".",
"Config",
".",
"Process",
".",
"Capabilities",
".",
"Inheritable",
"{",
"if",
"strings",
".",
"ToUpper",
"(",
"cap",
")",
"==",
"cp",
"{",
"g",
".",
"Config",
".",
"Process",
".",
"Capabilities",
".",
"Inheritable",
"=",
"removeFunc",
"(",
"g",
".",
"Config",
".",
"Process",
".",
"Capabilities",
".",
"Inheritable",
",",
"i",
")",
"\n",
"}",
"\n",
"}",
"\n",
"for",
"i",
",",
"cap",
":=",
"range",
"g",
".",
"Config",
".",
"Process",
".",
"Capabilities",
".",
"Permitted",
"{",
"if",
"strings",
".",
"ToUpper",
"(",
"cap",
")",
"==",
"cp",
"{",
"g",
".",
"Config",
".",
"Process",
".",
"Capabilities",
".",
"Permitted",
"=",
"removeFunc",
"(",
"g",
".",
"Config",
".",
"Process",
".",
"Capabilities",
".",
"Permitted",
",",
"i",
")",
"\n",
"}",
"\n",
"}",
"\n\n",
"return",
"validate",
".",
"CapValid",
"(",
"cp",
",",
"false",
")",
"\n",
"}"
] |
// DropProcessCapability drops a process capability from all 5 capability sets.
|
[
"DropProcessCapability",
"drops",
"a",
"process",
"capability",
"from",
"all",
"5",
"capability",
"sets",
"."
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L1307-L1340
|
14,468 |
opencontainers/runtime-tools
|
generate/generate.go
|
DropProcessCapabilityAmbient
|
func (g *Generator) DropProcessCapabilityAmbient(c string) error {
if g.Config == nil || g.Config.Process == nil || g.Config.Process.Capabilities == nil {
return nil
}
cp := strings.ToUpper(c)
for i, cap := range g.Config.Process.Capabilities.Ambient {
if strings.ToUpper(cap) == cp {
g.Config.Process.Capabilities.Ambient = removeFunc(g.Config.Process.Capabilities.Ambient, i)
}
}
return validate.CapValid(cp, false)
}
|
go
|
func (g *Generator) DropProcessCapabilityAmbient(c string) error {
if g.Config == nil || g.Config.Process == nil || g.Config.Process.Capabilities == nil {
return nil
}
cp := strings.ToUpper(c)
for i, cap := range g.Config.Process.Capabilities.Ambient {
if strings.ToUpper(cap) == cp {
g.Config.Process.Capabilities.Ambient = removeFunc(g.Config.Process.Capabilities.Ambient, i)
}
}
return validate.CapValid(cp, false)
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"DropProcessCapabilityAmbient",
"(",
"c",
"string",
")",
"error",
"{",
"if",
"g",
".",
"Config",
"==",
"nil",
"||",
"g",
".",
"Config",
".",
"Process",
"==",
"nil",
"||",
"g",
".",
"Config",
".",
"Process",
".",
"Capabilities",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n\n",
"cp",
":=",
"strings",
".",
"ToUpper",
"(",
"c",
")",
"\n",
"for",
"i",
",",
"cap",
":=",
"range",
"g",
".",
"Config",
".",
"Process",
".",
"Capabilities",
".",
"Ambient",
"{",
"if",
"strings",
".",
"ToUpper",
"(",
"cap",
")",
"==",
"cp",
"{",
"g",
".",
"Config",
".",
"Process",
".",
"Capabilities",
".",
"Ambient",
"=",
"removeFunc",
"(",
"g",
".",
"Config",
".",
"Process",
".",
"Capabilities",
".",
"Ambient",
",",
"i",
")",
"\n",
"}",
"\n",
"}",
"\n\n",
"return",
"validate",
".",
"CapValid",
"(",
"cp",
",",
"false",
")",
"\n",
"}"
] |
// DropProcessCapabilityAmbient drops a process capability from g.Config.Process.Capabilities.Ambient.
|
[
"DropProcessCapabilityAmbient",
"drops",
"a",
"process",
"capability",
"from",
"g",
".",
"Config",
".",
"Process",
".",
"Capabilities",
".",
"Ambient",
"."
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L1343-L1356
|
14,469 |
opencontainers/runtime-tools
|
generate/generate.go
|
ClearLinuxNamespaces
|
func (g *Generator) ClearLinuxNamespaces() {
if g.Config == nil || g.Config.Linux == nil {
return
}
g.Config.Linux.Namespaces = []rspec.LinuxNamespace{}
}
|
go
|
func (g *Generator) ClearLinuxNamespaces() {
if g.Config == nil || g.Config.Linux == nil {
return
}
g.Config.Linux.Namespaces = []rspec.LinuxNamespace{}
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"ClearLinuxNamespaces",
"(",
")",
"{",
"if",
"g",
".",
"Config",
"==",
"nil",
"||",
"g",
".",
"Config",
".",
"Linux",
"==",
"nil",
"{",
"return",
"\n",
"}",
"\n",
"g",
".",
"Config",
".",
"Linux",
".",
"Namespaces",
"=",
"[",
"]",
"rspec",
".",
"LinuxNamespace",
"{",
"}",
"\n",
"}"
] |
// ClearLinuxNamespaces clear g.Config.Linux.Namespaces.
|
[
"ClearLinuxNamespaces",
"clear",
"g",
".",
"Config",
".",
"Linux",
".",
"Namespaces",
"."
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L1444-L1449
|
14,470 |
opencontainers/runtime-tools
|
generate/generate.go
|
AddOrReplaceLinuxNamespace
|
func (g *Generator) AddOrReplaceLinuxNamespace(ns string, path string) error {
namespace, err := mapStrToNamespace(ns, path)
if err != nil {
return err
}
g.initConfigLinux()
for i, ns := range g.Config.Linux.Namespaces {
if ns.Type == namespace.Type {
g.Config.Linux.Namespaces[i] = namespace
return nil
}
}
g.Config.Linux.Namespaces = append(g.Config.Linux.Namespaces, namespace)
return nil
}
|
go
|
func (g *Generator) AddOrReplaceLinuxNamespace(ns string, path string) error {
namespace, err := mapStrToNamespace(ns, path)
if err != nil {
return err
}
g.initConfigLinux()
for i, ns := range g.Config.Linux.Namespaces {
if ns.Type == namespace.Type {
g.Config.Linux.Namespaces[i] = namespace
return nil
}
}
g.Config.Linux.Namespaces = append(g.Config.Linux.Namespaces, namespace)
return nil
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"AddOrReplaceLinuxNamespace",
"(",
"ns",
"string",
",",
"path",
"string",
")",
"error",
"{",
"namespace",
",",
"err",
":=",
"mapStrToNamespace",
"(",
"ns",
",",
"path",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"g",
".",
"initConfigLinux",
"(",
")",
"\n",
"for",
"i",
",",
"ns",
":=",
"range",
"g",
".",
"Config",
".",
"Linux",
".",
"Namespaces",
"{",
"if",
"ns",
".",
"Type",
"==",
"namespace",
".",
"Type",
"{",
"g",
".",
"Config",
".",
"Linux",
".",
"Namespaces",
"[",
"i",
"]",
"=",
"namespace",
"\n",
"return",
"nil",
"\n",
"}",
"\n",
"}",
"\n",
"g",
".",
"Config",
".",
"Linux",
".",
"Namespaces",
"=",
"append",
"(",
"g",
".",
"Config",
".",
"Linux",
".",
"Namespaces",
",",
"namespace",
")",
"\n",
"return",
"nil",
"\n",
"}"
] |
// AddOrReplaceLinuxNamespace adds or replaces a namespace inside
// g.Config.Linux.Namespaces.
|
[
"AddOrReplaceLinuxNamespace",
"adds",
"or",
"replaces",
"a",
"namespace",
"inside",
"g",
".",
"Config",
".",
"Linux",
".",
"Namespaces",
"."
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L1453-L1468
|
14,471 |
opencontainers/runtime-tools
|
generate/generate.go
|
RemoveLinuxNamespace
|
func (g *Generator) RemoveLinuxNamespace(ns string) error {
namespace, err := mapStrToNamespace(ns, "")
if err != nil {
return err
}
if g.Config == nil || g.Config.Linux == nil {
return nil
}
for i, ns := range g.Config.Linux.Namespaces {
if ns.Type == namespace.Type {
g.Config.Linux.Namespaces = append(g.Config.Linux.Namespaces[:i], g.Config.Linux.Namespaces[i+1:]...)
return nil
}
}
return nil
}
|
go
|
func (g *Generator) RemoveLinuxNamespace(ns string) error {
namespace, err := mapStrToNamespace(ns, "")
if err != nil {
return err
}
if g.Config == nil || g.Config.Linux == nil {
return nil
}
for i, ns := range g.Config.Linux.Namespaces {
if ns.Type == namespace.Type {
g.Config.Linux.Namespaces = append(g.Config.Linux.Namespaces[:i], g.Config.Linux.Namespaces[i+1:]...)
return nil
}
}
return nil
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"RemoveLinuxNamespace",
"(",
"ns",
"string",
")",
"error",
"{",
"namespace",
",",
"err",
":=",
"mapStrToNamespace",
"(",
"ns",
",",
"\"",
"\"",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"if",
"g",
".",
"Config",
"==",
"nil",
"||",
"g",
".",
"Config",
".",
"Linux",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"for",
"i",
",",
"ns",
":=",
"range",
"g",
".",
"Config",
".",
"Linux",
".",
"Namespaces",
"{",
"if",
"ns",
".",
"Type",
"==",
"namespace",
".",
"Type",
"{",
"g",
".",
"Config",
".",
"Linux",
".",
"Namespaces",
"=",
"append",
"(",
"g",
".",
"Config",
".",
"Linux",
".",
"Namespaces",
"[",
":",
"i",
"]",
",",
"g",
".",
"Config",
".",
"Linux",
".",
"Namespaces",
"[",
"i",
"+",
"1",
":",
"]",
"...",
")",
"\n",
"return",
"nil",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"nil",
"\n",
"}"
] |
// RemoveLinuxNamespace removes a namespace from g.Config.Linux.Namespaces.
|
[
"RemoveLinuxNamespace",
"removes",
"a",
"namespace",
"from",
"g",
".",
"Config",
".",
"Linux",
".",
"Namespaces",
"."
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L1471-L1487
|
14,472 |
opencontainers/runtime-tools
|
generate/generate.go
|
AddDevice
|
func (g *Generator) AddDevice(device rspec.LinuxDevice) {
g.initConfigLinux()
for i, dev := range g.Config.Linux.Devices {
if dev.Path == device.Path {
g.Config.Linux.Devices[i] = device
return
}
if dev.Type == device.Type && dev.Major == device.Major && dev.Minor == device.Minor {
fmt.Fprintln(os.Stderr, "WARNING: The same type, major and minor should not be used for multiple devices.")
}
}
g.Config.Linux.Devices = append(g.Config.Linux.Devices, device)
}
|
go
|
func (g *Generator) AddDevice(device rspec.LinuxDevice) {
g.initConfigLinux()
for i, dev := range g.Config.Linux.Devices {
if dev.Path == device.Path {
g.Config.Linux.Devices[i] = device
return
}
if dev.Type == device.Type && dev.Major == device.Major && dev.Minor == device.Minor {
fmt.Fprintln(os.Stderr, "WARNING: The same type, major and minor should not be used for multiple devices.")
}
}
g.Config.Linux.Devices = append(g.Config.Linux.Devices, device)
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"AddDevice",
"(",
"device",
"rspec",
".",
"LinuxDevice",
")",
"{",
"g",
".",
"initConfigLinux",
"(",
")",
"\n\n",
"for",
"i",
",",
"dev",
":=",
"range",
"g",
".",
"Config",
".",
"Linux",
".",
"Devices",
"{",
"if",
"dev",
".",
"Path",
"==",
"device",
".",
"Path",
"{",
"g",
".",
"Config",
".",
"Linux",
".",
"Devices",
"[",
"i",
"]",
"=",
"device",
"\n",
"return",
"\n",
"}",
"\n",
"if",
"dev",
".",
"Type",
"==",
"device",
".",
"Type",
"&&",
"dev",
".",
"Major",
"==",
"device",
".",
"Major",
"&&",
"dev",
".",
"Minor",
"==",
"device",
".",
"Minor",
"{",
"fmt",
".",
"Fprintln",
"(",
"os",
".",
"Stderr",
",",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"}",
"\n\n",
"g",
".",
"Config",
".",
"Linux",
".",
"Devices",
"=",
"append",
"(",
"g",
".",
"Config",
".",
"Linux",
".",
"Devices",
",",
"device",
")",
"\n",
"}"
] |
// AddDevice - add a device into g.Config.Linux.Devices
|
[
"AddDevice",
"-",
"add",
"a",
"device",
"into",
"g",
".",
"Config",
".",
"Linux",
".",
"Devices"
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L1490-L1504
|
14,473 |
opencontainers/runtime-tools
|
generate/generate.go
|
RemoveDevice
|
func (g *Generator) RemoveDevice(path string) {
if g.Config == nil || g.Config.Linux == nil || g.Config.Linux.Devices == nil {
return
}
for i, device := range g.Config.Linux.Devices {
if device.Path == path {
g.Config.Linux.Devices = append(g.Config.Linux.Devices[:i], g.Config.Linux.Devices[i+1:]...)
return
}
}
}
|
go
|
func (g *Generator) RemoveDevice(path string) {
if g.Config == nil || g.Config.Linux == nil || g.Config.Linux.Devices == nil {
return
}
for i, device := range g.Config.Linux.Devices {
if device.Path == path {
g.Config.Linux.Devices = append(g.Config.Linux.Devices[:i], g.Config.Linux.Devices[i+1:]...)
return
}
}
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"RemoveDevice",
"(",
"path",
"string",
")",
"{",
"if",
"g",
".",
"Config",
"==",
"nil",
"||",
"g",
".",
"Config",
".",
"Linux",
"==",
"nil",
"||",
"g",
".",
"Config",
".",
"Linux",
".",
"Devices",
"==",
"nil",
"{",
"return",
"\n",
"}",
"\n\n",
"for",
"i",
",",
"device",
":=",
"range",
"g",
".",
"Config",
".",
"Linux",
".",
"Devices",
"{",
"if",
"device",
".",
"Path",
"==",
"path",
"{",
"g",
".",
"Config",
".",
"Linux",
".",
"Devices",
"=",
"append",
"(",
"g",
".",
"Config",
".",
"Linux",
".",
"Devices",
"[",
":",
"i",
"]",
",",
"g",
".",
"Config",
".",
"Linux",
".",
"Devices",
"[",
"i",
"+",
"1",
":",
"]",
"...",
")",
"\n",
"return",
"\n",
"}",
"\n",
"}",
"\n",
"}"
] |
// RemoveDevice remove a device from g.Config.Linux.Devices
|
[
"RemoveDevice",
"remove",
"a",
"device",
"from",
"g",
".",
"Config",
".",
"Linux",
".",
"Devices"
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L1507-L1518
|
14,474 |
opencontainers/runtime-tools
|
generate/generate.go
|
ClearLinuxDevices
|
func (g *Generator) ClearLinuxDevices() {
if g.Config == nil || g.Config.Linux == nil || g.Config.Linux.Devices == nil {
return
}
g.Config.Linux.Devices = []rspec.LinuxDevice{}
}
|
go
|
func (g *Generator) ClearLinuxDevices() {
if g.Config == nil || g.Config.Linux == nil || g.Config.Linux.Devices == nil {
return
}
g.Config.Linux.Devices = []rspec.LinuxDevice{}
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"ClearLinuxDevices",
"(",
")",
"{",
"if",
"g",
".",
"Config",
"==",
"nil",
"||",
"g",
".",
"Config",
".",
"Linux",
"==",
"nil",
"||",
"g",
".",
"Config",
".",
"Linux",
".",
"Devices",
"==",
"nil",
"{",
"return",
"\n",
"}",
"\n\n",
"g",
".",
"Config",
".",
"Linux",
".",
"Devices",
"=",
"[",
"]",
"rspec",
".",
"LinuxDevice",
"{",
"}",
"\n",
"}"
] |
// ClearLinuxDevices clears g.Config.Linux.Devices
|
[
"ClearLinuxDevices",
"clears",
"g",
".",
"Config",
".",
"Linux",
".",
"Devices"
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L1521-L1527
|
14,475 |
opencontainers/runtime-tools
|
generate/generate.go
|
AddLinuxResourcesDevice
|
func (g *Generator) AddLinuxResourcesDevice(allow bool, devType string, major, minor *int64, access string) {
g.initConfigLinuxResources()
device := rspec.LinuxDeviceCgroup{
Allow: allow,
Type: devType,
Access: access,
Major: major,
Minor: minor,
}
g.Config.Linux.Resources.Devices = append(g.Config.Linux.Resources.Devices, device)
}
|
go
|
func (g *Generator) AddLinuxResourcesDevice(allow bool, devType string, major, minor *int64, access string) {
g.initConfigLinuxResources()
device := rspec.LinuxDeviceCgroup{
Allow: allow,
Type: devType,
Access: access,
Major: major,
Minor: minor,
}
g.Config.Linux.Resources.Devices = append(g.Config.Linux.Resources.Devices, device)
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"AddLinuxResourcesDevice",
"(",
"allow",
"bool",
",",
"devType",
"string",
",",
"major",
",",
"minor",
"*",
"int64",
",",
"access",
"string",
")",
"{",
"g",
".",
"initConfigLinuxResources",
"(",
")",
"\n\n",
"device",
":=",
"rspec",
".",
"LinuxDeviceCgroup",
"{",
"Allow",
":",
"allow",
",",
"Type",
":",
"devType",
",",
"Access",
":",
"access",
",",
"Major",
":",
"major",
",",
"Minor",
":",
"minor",
",",
"}",
"\n",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"Devices",
"=",
"append",
"(",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"Devices",
",",
"device",
")",
"\n",
"}"
] |
// AddLinuxResourcesDevice - add a device into g.Config.Linux.Resources.Devices
|
[
"AddLinuxResourcesDevice",
"-",
"add",
"a",
"device",
"into",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"Devices"
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L1530-L1541
|
14,476 |
opencontainers/runtime-tools
|
generate/generate.go
|
RemoveLinuxResourcesDevice
|
func (g *Generator) RemoveLinuxResourcesDevice(allow bool, devType string, major, minor *int64, access string) {
if g.Config == nil || g.Config.Linux == nil || g.Config.Linux.Resources == nil {
return
}
for i, device := range g.Config.Linux.Resources.Devices {
if device.Allow == allow &&
(devType == device.Type || (devType != "" && device.Type != "" && devType == device.Type)) &&
(access == device.Access || (access != "" && device.Access != "" && access == device.Access)) &&
(major == device.Major || (major != nil && device.Major != nil && *major == *device.Major)) &&
(minor == device.Minor || (minor != nil && device.Minor != nil && *minor == *device.Minor)) {
g.Config.Linux.Resources.Devices = append(g.Config.Linux.Resources.Devices[:i], g.Config.Linux.Resources.Devices[i+1:]...)
return
}
}
return
}
|
go
|
func (g *Generator) RemoveLinuxResourcesDevice(allow bool, devType string, major, minor *int64, access string) {
if g.Config == nil || g.Config.Linux == nil || g.Config.Linux.Resources == nil {
return
}
for i, device := range g.Config.Linux.Resources.Devices {
if device.Allow == allow &&
(devType == device.Type || (devType != "" && device.Type != "" && devType == device.Type)) &&
(access == device.Access || (access != "" && device.Access != "" && access == device.Access)) &&
(major == device.Major || (major != nil && device.Major != nil && *major == *device.Major)) &&
(minor == device.Minor || (minor != nil && device.Minor != nil && *minor == *device.Minor)) {
g.Config.Linux.Resources.Devices = append(g.Config.Linux.Resources.Devices[:i], g.Config.Linux.Resources.Devices[i+1:]...)
return
}
}
return
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"RemoveLinuxResourcesDevice",
"(",
"allow",
"bool",
",",
"devType",
"string",
",",
"major",
",",
"minor",
"*",
"int64",
",",
"access",
"string",
")",
"{",
"if",
"g",
".",
"Config",
"==",
"nil",
"||",
"g",
".",
"Config",
".",
"Linux",
"==",
"nil",
"||",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
"==",
"nil",
"{",
"return",
"\n",
"}",
"\n",
"for",
"i",
",",
"device",
":=",
"range",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"Devices",
"{",
"if",
"device",
".",
"Allow",
"==",
"allow",
"&&",
"(",
"devType",
"==",
"device",
".",
"Type",
"||",
"(",
"devType",
"!=",
"\"",
"\"",
"&&",
"device",
".",
"Type",
"!=",
"\"",
"\"",
"&&",
"devType",
"==",
"device",
".",
"Type",
")",
")",
"&&",
"(",
"access",
"==",
"device",
".",
"Access",
"||",
"(",
"access",
"!=",
"\"",
"\"",
"&&",
"device",
".",
"Access",
"!=",
"\"",
"\"",
"&&",
"access",
"==",
"device",
".",
"Access",
")",
")",
"&&",
"(",
"major",
"==",
"device",
".",
"Major",
"||",
"(",
"major",
"!=",
"nil",
"&&",
"device",
".",
"Major",
"!=",
"nil",
"&&",
"*",
"major",
"==",
"*",
"device",
".",
"Major",
")",
")",
"&&",
"(",
"minor",
"==",
"device",
".",
"Minor",
"||",
"(",
"minor",
"!=",
"nil",
"&&",
"device",
".",
"Minor",
"!=",
"nil",
"&&",
"*",
"minor",
"==",
"*",
"device",
".",
"Minor",
")",
")",
"{",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"Devices",
"=",
"append",
"(",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"Devices",
"[",
":",
"i",
"]",
",",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"Devices",
"[",
"i",
"+",
"1",
":",
"]",
"...",
")",
"\n",
"return",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"\n",
"}"
] |
// RemoveLinuxResourcesDevice - remove a device from g.Config.Linux.Resources.Devices
|
[
"RemoveLinuxResourcesDevice",
"-",
"remove",
"a",
"device",
"from",
"g",
".",
"Config",
".",
"Linux",
".",
"Resources",
".",
"Devices"
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L1544-L1560
|
14,477 |
opencontainers/runtime-tools
|
generate/generate.go
|
SetSyscallAction
|
func (g *Generator) SetSyscallAction(arguments seccomp.SyscallOpts) error {
g.initConfigLinuxSeccomp()
return seccomp.ParseSyscallFlag(arguments, g.Config.Linux.Seccomp)
}
|
go
|
func (g *Generator) SetSyscallAction(arguments seccomp.SyscallOpts) error {
g.initConfigLinuxSeccomp()
return seccomp.ParseSyscallFlag(arguments, g.Config.Linux.Seccomp)
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"SetSyscallAction",
"(",
"arguments",
"seccomp",
".",
"SyscallOpts",
")",
"error",
"{",
"g",
".",
"initConfigLinuxSeccomp",
"(",
")",
"\n",
"return",
"seccomp",
".",
"ParseSyscallFlag",
"(",
"arguments",
",",
"g",
".",
"Config",
".",
"Linux",
".",
"Seccomp",
")",
"\n",
"}"
] |
// SetSyscallAction adds rules for syscalls with the specified action
|
[
"SetSyscallAction",
"adds",
"rules",
"for",
"syscalls",
"with",
"the",
"specified",
"action"
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L1566-L1569
|
14,478 |
opencontainers/runtime-tools
|
generate/generate.go
|
SetDefaultSeccompAction
|
func (g *Generator) SetDefaultSeccompAction(action string) error {
g.initConfigLinuxSeccomp()
return seccomp.ParseDefaultAction(action, g.Config.Linux.Seccomp)
}
|
go
|
func (g *Generator) SetDefaultSeccompAction(action string) error {
g.initConfigLinuxSeccomp()
return seccomp.ParseDefaultAction(action, g.Config.Linux.Seccomp)
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"SetDefaultSeccompAction",
"(",
"action",
"string",
")",
"error",
"{",
"g",
".",
"initConfigLinuxSeccomp",
"(",
")",
"\n",
"return",
"seccomp",
".",
"ParseDefaultAction",
"(",
"action",
",",
"g",
".",
"Config",
".",
"Linux",
".",
"Seccomp",
")",
"\n",
"}"
] |
// SetDefaultSeccompAction sets the default action for all syscalls not defined
// and then removes any syscall rules with this action already specified.
|
[
"SetDefaultSeccompAction",
"sets",
"the",
"default",
"action",
"for",
"all",
"syscalls",
"not",
"defined",
"and",
"then",
"removes",
"any",
"syscall",
"rules",
"with",
"this",
"action",
"already",
"specified",
"."
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L1573-L1576
|
14,479 |
opencontainers/runtime-tools
|
generate/generate.go
|
SetDefaultSeccompActionForce
|
func (g *Generator) SetDefaultSeccompActionForce(action string) error {
g.initConfigLinuxSeccomp()
return seccomp.ParseDefaultActionForce(action, g.Config.Linux.Seccomp)
}
|
go
|
func (g *Generator) SetDefaultSeccompActionForce(action string) error {
g.initConfigLinuxSeccomp()
return seccomp.ParseDefaultActionForce(action, g.Config.Linux.Seccomp)
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"SetDefaultSeccompActionForce",
"(",
"action",
"string",
")",
"error",
"{",
"g",
".",
"initConfigLinuxSeccomp",
"(",
")",
"\n",
"return",
"seccomp",
".",
"ParseDefaultActionForce",
"(",
"action",
",",
"g",
".",
"Config",
".",
"Linux",
".",
"Seccomp",
")",
"\n",
"}"
] |
// SetDefaultSeccompActionForce only sets the default action for all syscalls not defined
|
[
"SetDefaultSeccompActionForce",
"only",
"sets",
"the",
"default",
"action",
"for",
"all",
"syscalls",
"not",
"defined"
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L1579-L1582
|
14,480 |
opencontainers/runtime-tools
|
generate/generate.go
|
SetSeccompArchitecture
|
func (g *Generator) SetSeccompArchitecture(architecture string) error {
g.initConfigLinuxSeccomp()
return seccomp.ParseArchitectureFlag(architecture, g.Config.Linux.Seccomp)
}
|
go
|
func (g *Generator) SetSeccompArchitecture(architecture string) error {
g.initConfigLinuxSeccomp()
return seccomp.ParseArchitectureFlag(architecture, g.Config.Linux.Seccomp)
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"SetSeccompArchitecture",
"(",
"architecture",
"string",
")",
"error",
"{",
"g",
".",
"initConfigLinuxSeccomp",
"(",
")",
"\n",
"return",
"seccomp",
".",
"ParseArchitectureFlag",
"(",
"architecture",
",",
"g",
".",
"Config",
".",
"Linux",
".",
"Seccomp",
")",
"\n",
"}"
] |
// SetSeccompArchitecture sets the supported seccomp architectures
|
[
"SetSeccompArchitecture",
"sets",
"the",
"supported",
"seccomp",
"architectures"
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L1585-L1588
|
14,481 |
opencontainers/runtime-tools
|
generate/generate.go
|
RemoveSeccompRule
|
func (g *Generator) RemoveSeccompRule(arguments string) error {
g.initConfigLinuxSeccomp()
return seccomp.RemoveAction(arguments, g.Config.Linux.Seccomp)
}
|
go
|
func (g *Generator) RemoveSeccompRule(arguments string) error {
g.initConfigLinuxSeccomp()
return seccomp.RemoveAction(arguments, g.Config.Linux.Seccomp)
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"RemoveSeccompRule",
"(",
"arguments",
"string",
")",
"error",
"{",
"g",
".",
"initConfigLinuxSeccomp",
"(",
")",
"\n",
"return",
"seccomp",
".",
"RemoveAction",
"(",
"arguments",
",",
"g",
".",
"Config",
".",
"Linux",
".",
"Seccomp",
")",
"\n",
"}"
] |
// RemoveSeccompRule removes rules for any specified syscalls
|
[
"RemoveSeccompRule",
"removes",
"rules",
"for",
"any",
"specified",
"syscalls"
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L1591-L1594
|
14,482 |
opencontainers/runtime-tools
|
generate/generate.go
|
RemoveAllSeccompRules
|
func (g *Generator) RemoveAllSeccompRules() error {
g.initConfigLinuxSeccomp()
return seccomp.RemoveAllSeccompRules(g.Config.Linux.Seccomp)
}
|
go
|
func (g *Generator) RemoveAllSeccompRules() error {
g.initConfigLinuxSeccomp()
return seccomp.RemoveAllSeccompRules(g.Config.Linux.Seccomp)
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"RemoveAllSeccompRules",
"(",
")",
"error",
"{",
"g",
".",
"initConfigLinuxSeccomp",
"(",
")",
"\n",
"return",
"seccomp",
".",
"RemoveAllSeccompRules",
"(",
"g",
".",
"Config",
".",
"Linux",
".",
"Seccomp",
")",
"\n",
"}"
] |
// RemoveAllSeccompRules removes all syscall rules
|
[
"RemoveAllSeccompRules",
"removes",
"all",
"syscall",
"rules"
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L1597-L1600
|
14,483 |
opencontainers/runtime-tools
|
generate/generate.go
|
AddLinuxMaskedPaths
|
func (g *Generator) AddLinuxMaskedPaths(path string) {
g.initConfigLinux()
g.Config.Linux.MaskedPaths = append(g.Config.Linux.MaskedPaths, path)
}
|
go
|
func (g *Generator) AddLinuxMaskedPaths(path string) {
g.initConfigLinux()
g.Config.Linux.MaskedPaths = append(g.Config.Linux.MaskedPaths, path)
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"AddLinuxMaskedPaths",
"(",
"path",
"string",
")",
"{",
"g",
".",
"initConfigLinux",
"(",
")",
"\n",
"g",
".",
"Config",
".",
"Linux",
".",
"MaskedPaths",
"=",
"append",
"(",
"g",
".",
"Config",
".",
"Linux",
".",
"MaskedPaths",
",",
"path",
")",
"\n",
"}"
] |
// AddLinuxMaskedPaths adds masked paths into g.Config.Linux.MaskedPaths.
|
[
"AddLinuxMaskedPaths",
"adds",
"masked",
"paths",
"into",
"g",
".",
"Config",
".",
"Linux",
".",
"MaskedPaths",
"."
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L1603-L1606
|
14,484 |
opencontainers/runtime-tools
|
generate/generate.go
|
AddLinuxReadonlyPaths
|
func (g *Generator) AddLinuxReadonlyPaths(path string) {
g.initConfigLinux()
g.Config.Linux.ReadonlyPaths = append(g.Config.Linux.ReadonlyPaths, path)
}
|
go
|
func (g *Generator) AddLinuxReadonlyPaths(path string) {
g.initConfigLinux()
g.Config.Linux.ReadonlyPaths = append(g.Config.Linux.ReadonlyPaths, path)
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"AddLinuxReadonlyPaths",
"(",
"path",
"string",
")",
"{",
"g",
".",
"initConfigLinux",
"(",
")",
"\n",
"g",
".",
"Config",
".",
"Linux",
".",
"ReadonlyPaths",
"=",
"append",
"(",
"g",
".",
"Config",
".",
"Linux",
".",
"ReadonlyPaths",
",",
"path",
")",
"\n",
"}"
] |
// AddLinuxReadonlyPaths adds readonly paths into g.Config.Linux.MaskedPaths.
|
[
"AddLinuxReadonlyPaths",
"adds",
"readonly",
"paths",
"into",
"g",
".",
"Config",
".",
"Linux",
".",
"MaskedPaths",
"."
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L1609-L1612
|
14,485 |
opencontainers/runtime-tools
|
generate/generate.go
|
AddSolarisAnet
|
func (g *Generator) AddSolarisAnet(anet rspec.SolarisAnet) {
g.initConfigSolaris()
g.Config.Solaris.Anet = append(g.Config.Solaris.Anet, anet)
}
|
go
|
func (g *Generator) AddSolarisAnet(anet rspec.SolarisAnet) {
g.initConfigSolaris()
g.Config.Solaris.Anet = append(g.Config.Solaris.Anet, anet)
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"AddSolarisAnet",
"(",
"anet",
"rspec",
".",
"SolarisAnet",
")",
"{",
"g",
".",
"initConfigSolaris",
"(",
")",
"\n",
"g",
".",
"Config",
".",
"Solaris",
".",
"Anet",
"=",
"append",
"(",
"g",
".",
"Config",
".",
"Solaris",
".",
"Anet",
",",
"anet",
")",
"\n",
"}"
] |
// AddSolarisAnet adds network into g.Config.Solaris.Anet
|
[
"AddSolarisAnet",
"adds",
"network",
"into",
"g",
".",
"Config",
".",
"Solaris",
".",
"Anet"
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L1644-L1647
|
14,486 |
opencontainers/runtime-tools
|
generate/generate.go
|
SetSolarisCappedCPUNcpus
|
func (g *Generator) SetSolarisCappedCPUNcpus(ncpus string) {
g.initConfigSolarisCappedCPU()
g.Config.Solaris.CappedCPU.Ncpus = ncpus
}
|
go
|
func (g *Generator) SetSolarisCappedCPUNcpus(ncpus string) {
g.initConfigSolarisCappedCPU()
g.Config.Solaris.CappedCPU.Ncpus = ncpus
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"SetSolarisCappedCPUNcpus",
"(",
"ncpus",
"string",
")",
"{",
"g",
".",
"initConfigSolarisCappedCPU",
"(",
")",
"\n",
"g",
".",
"Config",
".",
"Solaris",
".",
"CappedCPU",
".",
"Ncpus",
"=",
"ncpus",
"\n",
"}"
] |
// SetSolarisCappedCPUNcpus sets g.Config.Solaris.CappedCPU.Ncpus
|
[
"SetSolarisCappedCPUNcpus",
"sets",
"g",
".",
"Config",
".",
"Solaris",
".",
"CappedCPU",
".",
"Ncpus"
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L1650-L1653
|
14,487 |
opencontainers/runtime-tools
|
generate/generate.go
|
SetSolarisCappedMemoryPhysical
|
func (g *Generator) SetSolarisCappedMemoryPhysical(physical string) {
g.initConfigSolarisCappedMemory()
g.Config.Solaris.CappedMemory.Physical = physical
}
|
go
|
func (g *Generator) SetSolarisCappedMemoryPhysical(physical string) {
g.initConfigSolarisCappedMemory()
g.Config.Solaris.CappedMemory.Physical = physical
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"SetSolarisCappedMemoryPhysical",
"(",
"physical",
"string",
")",
"{",
"g",
".",
"initConfigSolarisCappedMemory",
"(",
")",
"\n",
"g",
".",
"Config",
".",
"Solaris",
".",
"CappedMemory",
".",
"Physical",
"=",
"physical",
"\n",
"}"
] |
// SetSolarisCappedMemoryPhysical sets g.Config.Solaris.CappedMemory.Physical
|
[
"SetSolarisCappedMemoryPhysical",
"sets",
"g",
".",
"Config",
".",
"Solaris",
".",
"CappedMemory",
".",
"Physical"
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L1656-L1659
|
14,488 |
opencontainers/runtime-tools
|
generate/generate.go
|
SetSolarisCappedMemorySwap
|
func (g *Generator) SetSolarisCappedMemorySwap(swap string) {
g.initConfigSolarisCappedMemory()
g.Config.Solaris.CappedMemory.Swap = swap
}
|
go
|
func (g *Generator) SetSolarisCappedMemorySwap(swap string) {
g.initConfigSolarisCappedMemory()
g.Config.Solaris.CappedMemory.Swap = swap
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"SetSolarisCappedMemorySwap",
"(",
"swap",
"string",
")",
"{",
"g",
".",
"initConfigSolarisCappedMemory",
"(",
")",
"\n",
"g",
".",
"Config",
".",
"Solaris",
".",
"CappedMemory",
".",
"Swap",
"=",
"swap",
"\n",
"}"
] |
// SetSolarisCappedMemorySwap sets g.Config.Solaris.CappedMemory.Swap
|
[
"SetSolarisCappedMemorySwap",
"sets",
"g",
".",
"Config",
".",
"Solaris",
".",
"CappedMemory",
".",
"Swap"
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L1662-L1665
|
14,489 |
opencontainers/runtime-tools
|
generate/generate.go
|
SetSolarisLimitPriv
|
func (g *Generator) SetSolarisLimitPriv(limitPriv string) {
g.initConfigSolaris()
g.Config.Solaris.LimitPriv = limitPriv
}
|
go
|
func (g *Generator) SetSolarisLimitPriv(limitPriv string) {
g.initConfigSolaris()
g.Config.Solaris.LimitPriv = limitPriv
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"SetSolarisLimitPriv",
"(",
"limitPriv",
"string",
")",
"{",
"g",
".",
"initConfigSolaris",
"(",
")",
"\n",
"g",
".",
"Config",
".",
"Solaris",
".",
"LimitPriv",
"=",
"limitPriv",
"\n",
"}"
] |
// SetSolarisLimitPriv sets g.Config.Solaris.LimitPriv
|
[
"SetSolarisLimitPriv",
"sets",
"g",
".",
"Config",
".",
"Solaris",
".",
"LimitPriv"
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L1668-L1671
|
14,490 |
opencontainers/runtime-tools
|
generate/generate.go
|
SetSolarisMaxShmMemory
|
func (g *Generator) SetSolarisMaxShmMemory(memory string) {
g.initConfigSolaris()
g.Config.Solaris.MaxShmMemory = memory
}
|
go
|
func (g *Generator) SetSolarisMaxShmMemory(memory string) {
g.initConfigSolaris()
g.Config.Solaris.MaxShmMemory = memory
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"SetSolarisMaxShmMemory",
"(",
"memory",
"string",
")",
"{",
"g",
".",
"initConfigSolaris",
"(",
")",
"\n",
"g",
".",
"Config",
".",
"Solaris",
".",
"MaxShmMemory",
"=",
"memory",
"\n",
"}"
] |
// SetSolarisMaxShmMemory sets g.Config.Solaris.MaxShmMemory
|
[
"SetSolarisMaxShmMemory",
"sets",
"g",
".",
"Config",
".",
"Solaris",
".",
"MaxShmMemory"
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L1674-L1677
|
14,491 |
opencontainers/runtime-tools
|
generate/generate.go
|
SetSolarisMilestone
|
func (g *Generator) SetSolarisMilestone(milestone string) {
g.initConfigSolaris()
g.Config.Solaris.Milestone = milestone
}
|
go
|
func (g *Generator) SetSolarisMilestone(milestone string) {
g.initConfigSolaris()
g.Config.Solaris.Milestone = milestone
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"SetSolarisMilestone",
"(",
"milestone",
"string",
")",
"{",
"g",
".",
"initConfigSolaris",
"(",
")",
"\n",
"g",
".",
"Config",
".",
"Solaris",
".",
"Milestone",
"=",
"milestone",
"\n",
"}"
] |
// SetSolarisMilestone sets g.Config.Solaris.Milestone
|
[
"SetSolarisMilestone",
"sets",
"g",
".",
"Config",
".",
"Solaris",
".",
"Milestone"
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L1680-L1683
|
14,492 |
opencontainers/runtime-tools
|
generate/generate.go
|
SetVMHypervisorPath
|
func (g *Generator) SetVMHypervisorPath(path string) error {
if !strings.HasPrefix(path, "/") {
return fmt.Errorf("hypervisorPath %v is not an absolute path", path)
}
g.initConfigVMHypervisor()
g.Config.VM.Hypervisor.Path = path
return nil
}
|
go
|
func (g *Generator) SetVMHypervisorPath(path string) error {
if !strings.HasPrefix(path, "/") {
return fmt.Errorf("hypervisorPath %v is not an absolute path", path)
}
g.initConfigVMHypervisor()
g.Config.VM.Hypervisor.Path = path
return nil
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"SetVMHypervisorPath",
"(",
"path",
"string",
")",
"error",
"{",
"if",
"!",
"strings",
".",
"HasPrefix",
"(",
"path",
",",
"\"",
"\"",
")",
"{",
"return",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"path",
")",
"\n",
"}",
"\n",
"g",
".",
"initConfigVMHypervisor",
"(",
")",
"\n",
"g",
".",
"Config",
".",
"VM",
".",
"Hypervisor",
".",
"Path",
"=",
"path",
"\n",
"return",
"nil",
"\n",
"}"
] |
// SetVMHypervisorPath sets g.Config.VM.Hypervisor.Path
|
[
"SetVMHypervisorPath",
"sets",
"g",
".",
"Config",
".",
"VM",
".",
"Hypervisor",
".",
"Path"
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L1686-L1693
|
14,493 |
opencontainers/runtime-tools
|
generate/generate.go
|
SetVMHypervisorParameters
|
func (g *Generator) SetVMHypervisorParameters(parameters []string) {
g.initConfigVMHypervisor()
g.Config.VM.Hypervisor.Parameters = parameters
}
|
go
|
func (g *Generator) SetVMHypervisorParameters(parameters []string) {
g.initConfigVMHypervisor()
g.Config.VM.Hypervisor.Parameters = parameters
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"SetVMHypervisorParameters",
"(",
"parameters",
"[",
"]",
"string",
")",
"{",
"g",
".",
"initConfigVMHypervisor",
"(",
")",
"\n",
"g",
".",
"Config",
".",
"VM",
".",
"Hypervisor",
".",
"Parameters",
"=",
"parameters",
"\n",
"}"
] |
// SetVMHypervisorParameters sets g.Config.VM.Hypervisor.Parameters
|
[
"SetVMHypervisorParameters",
"sets",
"g",
".",
"Config",
".",
"VM",
".",
"Hypervisor",
".",
"Parameters"
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L1696-L1699
|
14,494 |
opencontainers/runtime-tools
|
generate/generate.go
|
SetVMKernelPath
|
func (g *Generator) SetVMKernelPath(path string) error {
if !strings.HasPrefix(path, "/") {
return fmt.Errorf("kernelPath %v is not an absolute path", path)
}
g.initConfigVMKernel()
g.Config.VM.Kernel.Path = path
return nil
}
|
go
|
func (g *Generator) SetVMKernelPath(path string) error {
if !strings.HasPrefix(path, "/") {
return fmt.Errorf("kernelPath %v is not an absolute path", path)
}
g.initConfigVMKernel()
g.Config.VM.Kernel.Path = path
return nil
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"SetVMKernelPath",
"(",
"path",
"string",
")",
"error",
"{",
"if",
"!",
"strings",
".",
"HasPrefix",
"(",
"path",
",",
"\"",
"\"",
")",
"{",
"return",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"path",
")",
"\n",
"}",
"\n",
"g",
".",
"initConfigVMKernel",
"(",
")",
"\n",
"g",
".",
"Config",
".",
"VM",
".",
"Kernel",
".",
"Path",
"=",
"path",
"\n",
"return",
"nil",
"\n",
"}"
] |
// SetVMKernelPath sets g.Config.VM.Kernel.Path
|
[
"SetVMKernelPath",
"sets",
"g",
".",
"Config",
".",
"VM",
".",
"Kernel",
".",
"Path"
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L1702-L1709
|
14,495 |
opencontainers/runtime-tools
|
generate/generate.go
|
SetVMKernelParameters
|
func (g *Generator) SetVMKernelParameters(parameters []string) {
g.initConfigVMKernel()
g.Config.VM.Kernel.Parameters = parameters
}
|
go
|
func (g *Generator) SetVMKernelParameters(parameters []string) {
g.initConfigVMKernel()
g.Config.VM.Kernel.Parameters = parameters
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"SetVMKernelParameters",
"(",
"parameters",
"[",
"]",
"string",
")",
"{",
"g",
".",
"initConfigVMKernel",
"(",
")",
"\n",
"g",
".",
"Config",
".",
"VM",
".",
"Kernel",
".",
"Parameters",
"=",
"parameters",
"\n",
"}"
] |
// SetVMKernelParameters sets g.Config.VM.Kernel.Parameters
|
[
"SetVMKernelParameters",
"sets",
"g",
".",
"Config",
".",
"VM",
".",
"Kernel",
".",
"Parameters"
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L1712-L1715
|
14,496 |
opencontainers/runtime-tools
|
generate/generate.go
|
SetVMKernelInitRD
|
func (g *Generator) SetVMKernelInitRD(initrd string) error {
if !strings.HasPrefix(initrd, "/") {
return fmt.Errorf("kernelInitrd %v is not an absolute path", initrd)
}
g.initConfigVMKernel()
g.Config.VM.Kernel.InitRD = initrd
return nil
}
|
go
|
func (g *Generator) SetVMKernelInitRD(initrd string) error {
if !strings.HasPrefix(initrd, "/") {
return fmt.Errorf("kernelInitrd %v is not an absolute path", initrd)
}
g.initConfigVMKernel()
g.Config.VM.Kernel.InitRD = initrd
return nil
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"SetVMKernelInitRD",
"(",
"initrd",
"string",
")",
"error",
"{",
"if",
"!",
"strings",
".",
"HasPrefix",
"(",
"initrd",
",",
"\"",
"\"",
")",
"{",
"return",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"initrd",
")",
"\n",
"}",
"\n",
"g",
".",
"initConfigVMKernel",
"(",
")",
"\n",
"g",
".",
"Config",
".",
"VM",
".",
"Kernel",
".",
"InitRD",
"=",
"initrd",
"\n",
"return",
"nil",
"\n",
"}"
] |
// SetVMKernelInitRD sets g.Config.VM.Kernel.InitRD
|
[
"SetVMKernelInitRD",
"sets",
"g",
".",
"Config",
".",
"VM",
".",
"Kernel",
".",
"InitRD"
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L1718-L1725
|
14,497 |
opencontainers/runtime-tools
|
generate/generate.go
|
SetVMImagePath
|
func (g *Generator) SetVMImagePath(path string) error {
if !strings.HasPrefix(path, "/") {
return fmt.Errorf("imagePath %v is not an absolute path", path)
}
g.initConfigVMImage()
g.Config.VM.Image.Path = path
return nil
}
|
go
|
func (g *Generator) SetVMImagePath(path string) error {
if !strings.HasPrefix(path, "/") {
return fmt.Errorf("imagePath %v is not an absolute path", path)
}
g.initConfigVMImage()
g.Config.VM.Image.Path = path
return nil
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"SetVMImagePath",
"(",
"path",
"string",
")",
"error",
"{",
"if",
"!",
"strings",
".",
"HasPrefix",
"(",
"path",
",",
"\"",
"\"",
")",
"{",
"return",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"path",
")",
"\n",
"}",
"\n",
"g",
".",
"initConfigVMImage",
"(",
")",
"\n",
"g",
".",
"Config",
".",
"VM",
".",
"Image",
".",
"Path",
"=",
"path",
"\n",
"return",
"nil",
"\n",
"}"
] |
// SetVMImagePath sets g.Config.VM.Image.Path
|
[
"SetVMImagePath",
"sets",
"g",
".",
"Config",
".",
"VM",
".",
"Image",
".",
"Path"
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L1728-L1735
|
14,498 |
opencontainers/runtime-tools
|
generate/generate.go
|
SetVMImageFormat
|
func (g *Generator) SetVMImageFormat(format string) error {
switch format {
case "raw":
case "qcow2":
case "vdi":
case "vmdk":
case "vhd":
default:
return fmt.Errorf("Commonly supported formats are: raw, qcow2, vdi, vmdk, vhd")
}
g.initConfigVMImage()
g.Config.VM.Image.Format = format
return nil
}
|
go
|
func (g *Generator) SetVMImageFormat(format string) error {
switch format {
case "raw":
case "qcow2":
case "vdi":
case "vmdk":
case "vhd":
default:
return fmt.Errorf("Commonly supported formats are: raw, qcow2, vdi, vmdk, vhd")
}
g.initConfigVMImage()
g.Config.VM.Image.Format = format
return nil
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"SetVMImageFormat",
"(",
"format",
"string",
")",
"error",
"{",
"switch",
"format",
"{",
"case",
"\"",
"\"",
":",
"case",
"\"",
"\"",
":",
"case",
"\"",
"\"",
":",
"case",
"\"",
"\"",
":",
"case",
"\"",
"\"",
":",
"default",
":",
"return",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"g",
".",
"initConfigVMImage",
"(",
")",
"\n",
"g",
".",
"Config",
".",
"VM",
".",
"Image",
".",
"Format",
"=",
"format",
"\n",
"return",
"nil",
"\n",
"}"
] |
// SetVMImageFormat sets g.Config.VM.Image.Format
|
[
"SetVMImageFormat",
"sets",
"g",
".",
"Config",
".",
"VM",
".",
"Image",
".",
"Format"
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L1738-L1751
|
14,499 |
opencontainers/runtime-tools
|
generate/generate.go
|
SetWindowsHypervUntilityVMPath
|
func (g *Generator) SetWindowsHypervUntilityVMPath(path string) {
g.initConfigWindowsHyperV()
g.Config.Windows.HyperV.UtilityVMPath = path
}
|
go
|
func (g *Generator) SetWindowsHypervUntilityVMPath(path string) {
g.initConfigWindowsHyperV()
g.Config.Windows.HyperV.UtilityVMPath = path
}
|
[
"func",
"(",
"g",
"*",
"Generator",
")",
"SetWindowsHypervUntilityVMPath",
"(",
"path",
"string",
")",
"{",
"g",
".",
"initConfigWindowsHyperV",
"(",
")",
"\n",
"g",
".",
"Config",
".",
"Windows",
".",
"HyperV",
".",
"UtilityVMPath",
"=",
"path",
"\n",
"}"
] |
// SetWindowsHypervUntilityVMPath sets g.Config.Windows.HyperV.UtilityVMPath.
|
[
"SetWindowsHypervUntilityVMPath",
"sets",
"g",
".",
"Config",
".",
"Windows",
".",
"HyperV",
".",
"UtilityVMPath",
"."
] |
095789df6c2bc53a9dd4464cda8c22616d66e0d6
|
https://github.com/opencontainers/runtime-tools/blob/095789df6c2bc53a9dd4464cda8c22616d66e0d6/generate/generate.go#L1754-L1757
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.