MCPcopy
hub / github.com/lxc/incus / InstanceNamespaceName

Function InstanceNamespaceName

internal/server/apparmor/instance.go:45–50  ·  view source on GitHub ↗

InstanceNamespaceName returns the instance's AppArmor namespace.

(inst instance)

Source from the content-addressed store, hash-verified

43
44// InstanceNamespaceName returns the instance's AppArmor namespace.
45func InstanceNamespaceName(inst instance) string {
46 // Unlike in profile names, / isn't an allowed character so replace with a -.
47 path := strings.ReplaceAll(strings.Trim(internalUtil.VarPath(""), "/"), "/", "-")
48 name := fmt.Sprintf("%s_<%s>", project.Instance(inst.Project().Name, inst.Name()), path)
49 return profileName("", name)
50}
51
52// instanceProfileFilename returns the name of the on-disk profile name.
53func instanceProfileFilename(inst instance) string {

Callers 4

initLXCMethod · 0.92
InstanceLoadFunction · 0.85
InstanceUnloadFunction · 0.85
instanceProfileFunction · 0.85

Calls 5

InstanceFunction · 0.92
profileNameFunction · 0.85
TrimMethod · 0.80
ProjectMethod · 0.65
NameMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…