Skip to content
This repository has been archived by the owner on Mar 9, 2022. It is now read-only.

Commit

Permalink
Do not deprecate no_pivot yet.
Browse files Browse the repository at this point in the history
Signed-off-by: Lantao Liu <lantaol@google.com>
  • Loading branch information
Random-Liu committed Aug 5, 2019
1 parent b213648 commit 871a8b8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
7 changes: 7 additions & 0 deletions cri.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,13 @@ func validateConfig(ctx context.Context, c *criconfig.Config) error {
}
log.G(ctx).Warning("`systemd_cgroup` is deprecated, please use runtime `options` instead")
}
if c.NoPivot {
if c.ContainerdConfig.Runtimes[c.ContainerdConfig.DefaultRuntimeName].Type != plugin.RuntimeLinuxV1 {
return errors.Errorf("`no_pivot` only works for runtime %s", plugin.RuntimeLinuxV1)
}
// NoPivot can't be deprecated yet, because there is no alternative config option
// for `io.containerd.runtime.v1.linux`.
}
for _, r := range c.ContainerdConfig.Runtimes {
if r.Engine != "" {
if r.Type != plugin.RuntimeLinuxV1 {
Expand Down
2 changes: 0 additions & 2 deletions docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,6 @@ version = 2

# no_pivot disables pivot-root (linux only), required when running a container in a RamDisk with runc.
# This only works for runtime type "io.containerd.runtime.v1.linux".
# DEPRECATED: use Runtime.Options for runtime specific config for shim v2 runtimes.
# For runtime "io.containerd.runc.v1", use the option `NoPivotRoot`.
no_pivot = false

# default_runtime_name is the default runtime name to use.
Expand Down
1 change: 0 additions & 1 deletion pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ type ContainerdConfig struct {
Runtimes map[string]Runtime `toml:"runtimes" json:"runtimes"`
// NoPivot disables pivot-root (linux only), required when running a container in a RamDisk with runc
// This only works for runtime type "io.containerd.runtime.v1.linux".
// DEPRECATED: use Runtime.Options instead. Remove when shim v1 is deprecated.
NoPivot bool `toml:"no_pivot" json:"noPivot"`
}

Expand Down

0 comments on commit 871a8b8

Please sign in to comment.