Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP]Fix the --runtime option of container create to support path #2411

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions pkg/cmd/container/run_runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package container

import (
"context"
"path/filepath"
"strings"

"github.com/containerd/containerd"
Expand Down Expand Up @@ -47,6 +48,9 @@ func generateRuntimeCOpts(cgroupManager, runtimeStr string) ([]containerd.NewCon
}
runtimeOpts = nil
}
} else if filepath.IsAbs(runtimeStr) {
// runtimeStr is absolute path to runtime binary
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Runc-compatible binary should be assumed unless the binary name is composed of reversed domains

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can also consider “CSV” values like “type=runc,path=foo”, “type=containerd,name=com.example.foo.v1”, “type=containerd,path=containerd-shim-foo-v1”

runtime = runtimeStr
} else {
// runtimeStr is a runc binary
runcOpts.BinaryName = runtimeStr
Expand Down
Loading