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 25, 2023
1 parent 419b93b commit 9982e0f
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 1 deletion.
4 changes: 4 additions & 0 deletions k8s/crds/kops.k8s.io_clusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -921,6 +921,10 @@ spec:
description: State directory for execution state files (default
"/run/containerd").
type: string
testHandlerEnabled:
description: TestHandlerEnabled enables a runtime called test-handler,
specific to k/k e2e tests
type: boolean
version:
description: Version used to pick the containerd package.
type: string
Expand Down
4 changes: 4 additions & 0 deletions k8s/crds/kops.k8s.io_instancegroups.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,10 @@ spec:
description: State directory for execution state files (default
"/run/containerd").
type: string
testHandlerEnabled:
description: TestHandlerEnabled enables a runtime called test-handler,
specific to k/k e2e tests
type: boolean
version:
description: Version used to pick the containerd package.
type: string
Expand Down
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
3 changes: 2 additions & 1 deletion tests/e2e/scenarios/build/run-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ make test-e2e-install

cd "${GOPATH}"/src/k8s.io/kubernetes

# this job assumes pull-kops-e2e-k8s-aws-calico is always ran on presubmits
kubetest2 kops -v=6 \
--up --down --build --build-kubernetes=true --target-build-arch=linux/amd64 \
--cloud-provider=gce --admin-access=0.0.0.0/0 \
--kops-version-marker=https://storage.googleapis.com/kops-ci/bin/latest-ci.txt \
--kops-version-marker=https://storage.googleapis.com/k8s-staging-kops/pulls/pull-kops-e2e-k8s-aws-calico/pull-"${PULL_PULL_SHA}"/latest-ci.txt \
--create-args "--networking=kubenet --set=spec.nodeProblemDetector.enabled=true" \
--test=kops \
-- \
Expand Down

0 comments on commit 9982e0f

Please sign in to comment.