Skip to content

Commit

Permalink
enable test handler for containerd runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
upodroid committed Oct 24, 2023
1 parent b427cc0 commit 2fe358f
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 0 deletions.
3 changes: 3 additions & 0 deletions nodeup/pkg/model/containerd.go
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,9 @@ func (b *ContainerdBuilder) buildContainerdConfig() (string, error) {
if containerd.SeLinuxEnabled {
config.SetPath([]string{"plugins", "io.containerd.grpc.v1.cri", "enable_selinux"}, true)
}
if containerd.TestHandlerEnabled {
config.SetPath([]string{"plugins", "io.containerd.grpc.v1.cri", "containerd", "runtimes", "test-handler", "runtime_type"}, "io.containerd.runc.v2")
}
if b.NodeupConfig.KubeletConfig.PodInfraContainerImage != "" {
config.SetPath([]string{"plugins", "io.containerd.grpc.v1.cri", "sandbox_image"}, b.NodeupConfig.KubeletConfig.PodInfraContainerImage)
}
Expand Down
2 changes: 2 additions & 0 deletions pkg/apis/kops/containerdconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ type ContainerdConfig struct {
SeLinuxEnabled bool `json:"selinuxEnabled,omitempty"`
// NRI configures the Node Resource Interface.
NRI *NRIConfig `json:"nri,omitempty"`
// TestHandlerEnabled enables a runtime called test-handler, specific to k/k e2e tests
TestHandlerEnabled bool `json:"testHandlerEnabled,omitempty"`
}

type NRIConfig struct {
Expand Down
2 changes: 2 additions & 0 deletions pkg/apis/kops/v1alpha2/containerdconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ type ContainerdConfig struct {
SeLinuxEnabled bool `json:"selinuxEnabled,omitempty"`
// NRI configures the Node Resource Interface.
NRI *NRIConfig `json:"nri,omitempty"`
// TestHandlerEnabled enables a runtime called test-handler, specific to k/k e2e tests
TestHandlerEnabled bool `json:"testHandlerEnabled,omitempty"`
}

type NRIConfig struct {
Expand Down
2 changes: 2 additions & 0 deletions pkg/apis/kops/v1alpha2/zz_generated.conversion.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions pkg/apis/kops/v1alpha3/containerdconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ type ContainerdConfig struct {
SeLinuxEnabled bool `json:"selinuxEnabled,omitempty"`
// NRI configures the Node Resource Interface.
NRI *NRIConfig `json:"nri,omitempty"`
// TestHandlerEnabled enables a runtime called test-handler, specific to k/k e2e tests
TestHandlerEnabled bool `json:"testHandlerEnabled,omitempty"`
}

type NRIConfig struct {
Expand Down
2 changes: 2 additions & 0 deletions pkg/apis/kops/v1alpha3/zz_generated.conversion.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions tests/e2e/kubetest2-kops/deployer/up.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ func (d *deployer) createCluster(zones []string, adminAccess string, yes bool) e
"--kubernetes-version", d.KubernetesVersion,
"--ssh-public-key", d.SSHPublicKeyPath,
"--set", "cluster.spec.nodePortAccess=0.0.0.0/0",
"--set", "spec.containerd.testHandlerEnabled=true",
}
if yes {
args = append(args, "--yes")
Expand Down

0 comments on commit 2fe358f

Please sign in to comment.