Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
c8d6d7c0
Unverified
Commit
c8d6d7c0
authored
Apr 01, 2019
by
Kubernetes Prow Robot
Committed by
GitHub
Apr 01, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #74757 from tallclair/runtimehandler-e2e
Add custom runtime handler e2e test
parents
76b1d835
d15718cb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
9 deletions
+21
-9
BUILD
test/e2e/common/BUILD
+3
-0
runtimeclass.go
test/e2e/common/runtimeclass.go
+18
-4
BUILD
test/e2e/node/BUILD
+0
-5
No files found.
test/e2e/common/BUILD
View file @
c8d6d7c0
...
...
@@ -34,6 +34,7 @@ go_library(
"projected_downwardapi.go",
"projected_secret.go",
"runtime.go",
"runtimeclass.go",
"secrets.go",
"secrets_volume.go",
"security_context.go",
...
...
@@ -50,6 +51,7 @@ go_library(
"//pkg/kubelet:go_default_library",
"//pkg/kubelet/events:go_default_library",
"//pkg/kubelet/images:go_default_library",
"//pkg/kubelet/runtimeclass/testing:go_default_library",
"//pkg/kubelet/sysctl:go_default_library",
"//pkg/security/apparmor:go_default_library",
"//staging/src/k8s.io/api/autoscaling/v1:go_default_library",
...
...
@@ -83,6 +85,7 @@ go_library(
"//vendor/github.com/onsi/gomega/types:go_default_library",
"//vendor/golang.org/x/net/websocket:go_default_library",
"//vendor/k8s.io/klog:go_default_library",
"//vendor/k8s.io/utils/pointer:go_default_library",
],
)
...
...
test/e2e/
node
/runtimeclass.go
→
test/e2e/
common
/runtimeclass.go
View file @
c8d6d7c0
...
...
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package
node
package
common
import
(
"fmt"
...
...
@@ -34,7 +34,13 @@ import (
.
"github.com/onsi/ginkgo"
)
var
_
=
SIGDescribe
(
"RuntimeClass"
,
func
()
{
const
(
// PreconfiguredRuntimeHandler is the name of the runtime handler that is expected to be
// preconfigured in the test environment.
PreconfiguredRuntimeHandler
=
"test-handler"
)
var
_
=
Describe
(
"[sig-node] RuntimeClass"
,
func
()
{
f
:=
framework
.
NewDefaultFramework
(
"runtimeclass"
)
It
(
"should reject a Pod requesting a non-existent RuntimeClass"
,
func
()
{
...
...
@@ -50,6 +56,16 @@ var _ = SIGDescribe("RuntimeClass", func() {
expectSandboxFailureEvent
(
f
,
pod
,
handler
)
})
// This test requires that the PreconfiguredRuntimeHandler has already been set up on nodes.
It
(
"should run a Pod requesting a RuntimeClass with a configured handler [NodeFeature:RuntimeHandler]"
,
func
()
{
// The built-in docker runtime does not support configuring runtime handlers.
framework
.
SkipIfContainerRuntimeIs
(
"docker"
)
rcName
:=
createRuntimeClass
(
f
,
"preconfigured-handler"
,
PreconfiguredRuntimeHandler
)
pod
:=
createRuntimeClassPod
(
f
,
rcName
)
expectPodSuccess
(
f
,
pod
)
})
It
(
"should reject a Pod requesting a deleted RuntimeClass"
,
func
()
{
rcName
:=
createRuntimeClass
(
f
,
"delete-me"
,
"runc"
)
rcClient
:=
f
.
ClientSet
.
NodeV1beta1
()
.
RuntimeClasses
()
...
...
@@ -74,8 +90,6 @@ var _ = SIGDescribe("RuntimeClass", func() {
pod
:=
createRuntimeClassPod
(
f
,
rcName
)
expectSandboxFailureEvent
(
f
,
pod
,
fmt
.
Sprintf
(
"
\"
%s
\"
not found"
,
rcName
))
})
// TODO(tallclair): Test an actual configured non-default runtimeHandler.
})
// createRuntimeClass generates a RuntimeClass with the desired handler and a "namespaced" name,
...
...
test/e2e/node/BUILD
View file @
c8d6d7c0
...
...
@@ -14,7 +14,6 @@ go_library(
"pod_gc.go",
"pods.go",
"pre_stop.go",
"runtimeclass.go",
"security_context.go",
"ssh.go",
"ttlafterfinished.go",
...
...
@@ -23,13 +22,10 @@ go_library(
visibility = ["//visibility:public"],
deps = [
"//pkg/kubelet/apis/stats/v1alpha1:go_default_library",
"//pkg/kubelet/events:go_default_library",
"//pkg/kubelet/runtimeclass/testing:go_default_library",
"//pkg/master/ports:go_default_library",
"//pkg/util/slice:go_default_library",
"//staging/src/k8s.io/api/batch/v1:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/api/errors:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/api/resource:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/fields:go_default_library",
...
...
@@ -44,7 +40,6 @@ go_library(
"//test/utils/image:go_default_library",
"//vendor/github.com/onsi/ginkgo:go_default_library",
"//vendor/github.com/onsi/gomega:go_default_library",
"//vendor/k8s.io/utils/pointer:go_default_library",
],
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment