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
d00c650b
Commit
d00c650b
authored
Feb 16, 2016
by
k8s-merge-robot
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #21323 from pwittrock/fixnodee2e
Auto commit by PR queue bot
parents
eb44520f
d8a689c1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
46 deletions
+47
-46
kubelet_test.go
test/e2e_node/kubelet_test.go
+47
-46
No files found.
test/e2e_node/kubelet_test.go
View file @
d00c650b
...
...
@@ -86,52 +86,53 @@ var _ = Describe("Kubelet", func() {
})
})
Context
(
"when scheduling a read only busybox container"
,
func
()
{
It
(
"it should return success"
,
func
()
{
pod
:=
&
api
.
Pod
{
ObjectMeta
:
api
.
ObjectMeta
{
Name
:
"busybox"
,
Namespace
:
api
.
NamespaceDefault
,
},
Spec
:
api
.
PodSpec
{
// Force the Pod to schedule to the node without a scheduler running
NodeName
:
*
nodeName
,
// Don't restart the Pod since it is expected to exit
RestartPolicy
:
api
.
RestartPolicyNever
,
Containers
:
[]
api
.
Container
{
{
Image
:
"gcr.io/google_containers/busybox"
,
Name
:
"busybox"
,
Command
:
[]
string
{
"sh"
,
"-c"
,
"echo test > /file"
},
SecurityContext
:
&
api
.
SecurityContext
{
ReadOnlyRootFilesystem
:
&
isReadOnly
,
},
},
},
},
}
_
,
err
:=
cl
.
Pods
(
api
.
NamespaceDefault
)
.
Create
(
pod
)
Expect
(
err
)
.
To
(
BeNil
(),
fmt
.
Sprintf
(
"Error creating Pod %v"
,
err
))
})
It
(
"it should not write to the root filesystem"
,
func
()
{
Eventually
(
func
()
string
{
rc
,
err
:=
cl
.
Pods
(
api
.
NamespaceDefault
)
.
GetLogs
(
"busybox"
,
&
api
.
PodLogOptions
{})
.
Stream
()
if
err
!=
nil
{
return
""
}
defer
rc
.
Close
()
buf
:=
new
(
bytes
.
Buffer
)
buf
.
ReadFrom
(
rc
)
return
buf
.
String
()
},
time
.
Second
*
30
,
time
.
Second
*
4
)
.
Should
(
Equal
(
"sh: can't create /file: Read-only file system"
))
})
It
(
"it should be possible to delete"
,
func
()
{
err
:=
cl
.
Pods
(
api
.
NamespaceDefault
)
.
Delete
(
"busybox"
,
&
api
.
DeleteOptions
{})
Expect
(
err
)
.
To
(
BeNil
(),
fmt
.
Sprintf
(
"Error creating Pod %v"
,
err
))
})
})
// TODO: Enable this when issues are resolved. Tracked in #21320
// Context("when scheduling a read only busybox container", func() {
// It("it should return success", func() {
// pod := &api.Pod{
// ObjectMeta: api.ObjectMeta{
// Name: "busybox",
// Namespace: api.NamespaceDefault,
// },
// Spec: api.PodSpec{
// // Force the Pod to schedule to the node without a scheduler running
// NodeName: *nodeName,
// // Don't restart the Pod since it is expected to exit
// RestartPolicy: api.RestartPolicyNever,
// Containers: []api.Container{
// {
// Image: "gcr.io/google_containers/busybox",
// Name: "busybox",
// Command: []string{"sh", "-c", "echo test > /file"},
// SecurityContext: &api.SecurityContext{
// ReadOnlyRootFilesystem: &isReadOnly,
// },
// },
// },
// },
// }
// _, err := cl.Pods(api.NamespaceDefault).Create(pod)
// Expect(err).To(BeNil(), fmt.Sprintf("Error creating Pod %v", err))
// })
//
// It("it should not write to the root filesystem", func() {
// Eventually(func() string {
// rc, err := cl.Pods(api.NamespaceDefault).GetLogs("busybox", &api.PodLogOptions{}).Stream()
// if err != nil {
// return ""
// }
// defer rc.Close()
// buf := new(bytes.Buffer)
// buf.ReadFrom(rc)
// return buf.String()
// }, time.Second*30, time.Second*4).Should(Equal("sh: can't create /file: Read-only file system"))
// })
//
// It("it should be possible to delete", func() {
// err := cl.Pods(api.NamespaceDefault).Delete("busybox", &api.DeleteOptions{})
// Expect(err).To(BeNil(), fmt.Sprintf("Error creating Pod %v", err))
// })
// })
})
Describe
(
"metrics api"
,
func
()
{
...
...
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