-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5061 from profnandaa/refactor-containerd-worker-5056
refactor: split containerd runtime options definions by OS
- Loading branch information
Showing
3 changed files
with
34 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
//go:build !windows | ||
// +build !windows | ||
|
||
package main | ||
|
||
import ( | ||
runtimeoptions "github.com/containerd/containerd/pkg/runtimeoptions/v1" | ||
"github.com/containerd/containerd/plugin" | ||
runcoptions "github.com/containerd/containerd/runtime/v2/runc/options" | ||
) | ||
|
||
// getRuntimeOptionsType gets empty runtime options by the runtime type name. | ||
func getRuntimeOptionsType(t string) interface{} { | ||
if t == plugin.RuntimeRuncV2 { | ||
return &runcoptions.Options{} | ||
} | ||
return &runtimeoptions.Options{} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package main | ||
|
||
import ( | ||
runhcsoptions "github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/options" | ||
runtimeoptions "github.com/containerd/containerd/pkg/runtimeoptions/v1" | ||
) | ||
|
||
const runtimeRunhcsV1 = "io.containerd.runhcs.v1" | ||
|
||
// getRuntimeOptionsType gets empty runtime options by the runtime type name. | ||
func getRuntimeOptionsType(t string) interface{} { | ||
if t == runtimeRunhcsV1 { | ||
return &runhcsoptions.Options{} | ||
} | ||
return &runtimeoptions.Options{} | ||
} |