libct: remove relabeling dead code

There is no way to set Mount.Relabel field via OCI spec (config.json),
and so the relabeling code is never used.

My guess it's a leftover from times when runc used to be part of Docker.

Remove it, and mark Relabel field as deprecated.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
Kir Kolyshkin
2026-03-05 14:54:17 -08:00
parent c1c788765c
commit 8b2b5e9492
2 changed files with 4 additions and 12 deletions
+4 -2
View File
@@ -43,8 +43,10 @@ type Mount struct {
// Mount data applied to the mount. // Mount data applied to the mount.
Data string `json:"data,omitempty"` Data string `json:"data,omitempty"`
// Relabel source if set, "z" indicates shared, "Z" indicates unshared. // Relabel field is ignored.
Relabel string `json:"relabel,omitempty"` //
// Deprecated: do not use. This field will be removed in runc 1.7.
Relabel string
// RecAttr represents mount properties to be applied recursively (AT_RECURSIVE), see mount_setattr(2). // RecAttr represents mount properties to be applied recursively (AT_RECURSIVE), see mount_setattr(2).
RecAttr *unix.MountAttr `json:"rec_attr,omitempty"` RecAttr *unix.MountAttr `json:"rec_attr,omitempty"`
-10
View File
@@ -747,16 +747,6 @@ func mountToRootfs(c *mountConfig, m mountEntry) error {
return fmt.Errorf("failed to set user-requested vfs flags on bind-mount: %w", err) return fmt.Errorf("failed to set user-requested vfs flags on bind-mount: %w", err)
} }
} }
if m.Relabel != "" {
if err := label.Validate(m.Relabel); err != nil {
return err
}
shared := label.IsShared(m.Relabel)
if err := label.Relabel(m.Source, mountLabel, shared); err != nil {
return err
}
}
return setRecAttr(m) return setRecAttr(m)
case "cgroup": case "cgroup":
if cgroups.IsCgroup2UnifiedMode() { if cgroups.IsCgroup2UnifiedMode() {