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
79230ee5
Commit
79230ee5
authored
Aug 30, 2018
by
Masaki Kimura
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix hostpath subpath reconstruction tests are failing
Fixes: #68093
parent
bd2370d2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
42 deletions
+42
-42
in_tree.go
test/e2e/storage/drivers/in_tree.go
+40
-40
in_tree_volumes.go
test/e2e/storage/in_tree_volumes.go
+2
-2
No files found.
test/e2e/storage/drivers/in_tree.go
View file @
79230ee5
...
...
@@ -649,21 +649,21 @@ func (c *cephFSDriver) DeleteVolume(volType testpatterns.TestVolType) {
}
// Hostpath
type
host
p
athDriver
struct
{
type
host
P
athDriver
struct
{
node
v1
.
Node
driverInfo
DriverInfo
}
var
_
TestDriver
=
&
host
p
athDriver
{}
var
_
PreprovisionedVolumeTestDriver
=
&
host
p
athDriver
{}
var
_
InlineVolumeTestDriver
=
&
host
p
athDriver
{}
var
_
TestDriver
=
&
host
P
athDriver
{}
var
_
PreprovisionedVolumeTestDriver
=
&
host
P
athDriver
{}
var
_
InlineVolumeTestDriver
=
&
host
P
athDriver
{}
// InitHostpathDriver returns host
p
athDriver that implements TestDriver interface
func
InitHost
p
athDriver
()
TestDriver
{
return
&
host
p
athDriver
{
// InitHostpathDriver returns host
P
athDriver that implements TestDriver interface
func
InitHost
P
athDriver
()
TestDriver
{
return
&
host
P
athDriver
{
driverInfo
:
DriverInfo
{
Name
:
"host
p
ath"
,
Name
:
"host
P
ath"
,
MaxFileSize
:
testpatterns
.
FileSizeMedium
,
SupportedFsType
:
sets
.
NewString
(
""
,
// Default fsType
...
...
@@ -675,15 +675,15 @@ func InitHostpathDriver() TestDriver {
}
}
func
(
h
*
host
p
athDriver
)
GetDriverInfo
()
*
DriverInfo
{
func
(
h
*
host
P
athDriver
)
GetDriverInfo
()
*
DriverInfo
{
return
&
h
.
driverInfo
}
func
(
h
*
host
p
athDriver
)
SkipUnsupportedTest
(
pattern
testpatterns
.
TestPattern
)
{
func
(
h
*
host
P
athDriver
)
SkipUnsupportedTest
(
pattern
testpatterns
.
TestPattern
)
{
}
func
(
h
*
host
p
athDriver
)
GetVolumeSource
(
readOnly
bool
,
fsType
string
)
*
v1
.
VolumeSource
{
// host
p
ath doesn't support readOnly volume
func
(
h
*
host
P
athDriver
)
GetVolumeSource
(
readOnly
bool
,
fsType
string
)
*
v1
.
VolumeSource
{
// host
P
ath doesn't support readOnly volume
if
readOnly
{
return
nil
}
...
...
@@ -694,13 +694,13 @@ func (h *hostpathDriver) GetVolumeSource(readOnly bool, fsType string) *v1.Volum
}
}
func
(
h
*
host
p
athDriver
)
CreateDriver
()
{
func
(
h
*
host
P
athDriver
)
CreateDriver
()
{
}
func
(
h
*
host
p
athDriver
)
CleanupDriver
()
{
func
(
h
*
host
P
athDriver
)
CleanupDriver
()
{
}
func
(
h
*
host
p
athDriver
)
CreateVolume
(
volType
testpatterns
.
TestVolType
)
{
func
(
h
*
host
P
athDriver
)
CreateVolume
(
volType
testpatterns
.
TestVolType
)
{
f
:=
h
.
driverInfo
.
Framework
cs
:=
f
.
ClientSet
...
...
@@ -710,11 +710,11 @@ func (h *hostpathDriver) CreateVolume(volType testpatterns.TestVolType) {
h
.
driverInfo
.
Config
.
ClientNodeName
=
node
.
Name
}
func
(
h
*
host
p
athDriver
)
DeleteVolume
(
volType
testpatterns
.
TestVolType
)
{
func
(
h
*
host
P
athDriver
)
DeleteVolume
(
volType
testpatterns
.
TestVolType
)
{
}
// Host
p
athSymlink
type
host
p
athSymlinkDriver
struct
{
// Host
P
athSymlink
type
host
P
athSymlinkDriver
struct
{
node
v1
.
Node
sourcePath
string
targetPath
string
...
...
@@ -723,15 +723,15 @@ type hostpathSymlinkDriver struct {
driverInfo
DriverInfo
}
var
_
TestDriver
=
&
host
p
athSymlinkDriver
{}
var
_
PreprovisionedVolumeTestDriver
=
&
host
p
athSymlinkDriver
{}
var
_
InlineVolumeTestDriver
=
&
host
p
athSymlinkDriver
{}
var
_
TestDriver
=
&
host
P
athSymlinkDriver
{}
var
_
PreprovisionedVolumeTestDriver
=
&
host
P
athSymlinkDriver
{}
var
_
InlineVolumeTestDriver
=
&
host
P
athSymlinkDriver
{}
// InitHost
pathSymlinkDriver returns hostp
athSymlinkDriver that implements TestDriver interface
func
InitHost
p
athSymlinkDriver
()
TestDriver
{
return
&
host
p
athSymlinkDriver
{
// InitHost
PathSymlinkDriver returns hostP
athSymlinkDriver that implements TestDriver interface
func
InitHost
P
athSymlinkDriver
()
TestDriver
{
return
&
host
P
athSymlinkDriver
{
driverInfo
:
DriverInfo
{
Name
:
"host
p
athSymlink"
,
Name
:
"host
P
athSymlink"
,
MaxFileSize
:
testpatterns
.
FileSizeMedium
,
SupportedFsType
:
sets
.
NewString
(
""
,
// Default fsType
...
...
@@ -743,15 +743,15 @@ func InitHostpathSymlinkDriver() TestDriver {
}
}
func
(
h
*
host
p
athSymlinkDriver
)
GetDriverInfo
()
*
DriverInfo
{
func
(
h
*
host
P
athSymlinkDriver
)
GetDriverInfo
()
*
DriverInfo
{
return
&
h
.
driverInfo
}
func
(
h
*
host
p
athSymlinkDriver
)
SkipUnsupportedTest
(
pattern
testpatterns
.
TestPattern
)
{
func
(
h
*
host
P
athSymlinkDriver
)
SkipUnsupportedTest
(
pattern
testpatterns
.
TestPattern
)
{
}
func
(
h
*
host
p
athSymlinkDriver
)
GetVolumeSource
(
readOnly
bool
,
fsType
string
)
*
v1
.
VolumeSource
{
// host
path
doesn't support readOnly volume
func
(
h
*
host
P
athSymlinkDriver
)
GetVolumeSource
(
readOnly
bool
,
fsType
string
)
*
v1
.
VolumeSource
{
// host
PathSymlink
doesn't support readOnly volume
if
readOnly
{
return
nil
}
...
...
@@ -762,13 +762,13 @@ func (h *hostpathSymlinkDriver) GetVolumeSource(readOnly bool, fsType string) *v
}
}
func
(
h
*
host
p
athSymlinkDriver
)
CreateDriver
()
{
func
(
h
*
host
P
athSymlinkDriver
)
CreateDriver
()
{
}
func
(
h
*
host
p
athSymlinkDriver
)
CleanupDriver
()
{
func
(
h
*
host
P
athSymlinkDriver
)
CleanupDriver
()
{
}
func
(
h
*
host
p
athSymlinkDriver
)
CreateVolume
(
volType
testpatterns
.
TestVolType
)
{
func
(
h
*
host
P
athSymlinkDriver
)
CreateVolume
(
volType
testpatterns
.
TestVolType
)
{
f
:=
h
.
driverInfo
.
Framework
cs
:=
f
.
ClientSet
...
...
@@ -784,7 +784,7 @@ func (h *hostpathSymlinkDriver) CreateVolume(volType testpatterns.TestVolType) {
cmd
:=
fmt
.
Sprintf
(
"mkdir %v -m 777 && ln -s %v %v"
,
h
.
sourcePath
,
h
.
sourcePath
,
h
.
targetPath
)
privileged
:=
true
// Launch pod to initialize host
p
ath directory and symlink
// Launch pod to initialize host
P
ath directory and symlink
h
.
prepPod
=
&
v1
.
Pod
{
ObjectMeta
:
metav1
.
ObjectMeta
{
Name
:
fmt
.
Sprintf
(
"hostpath-symlink-prep-%s"
,
f
.
Namespace
.
Name
),
...
...
@@ -822,29 +822,29 @@ func (h *hostpathSymlinkDriver) CreateVolume(volType testpatterns.TestVolType) {
}
// h.prepPod will be reused in cleanupDriver.
pod
,
err
:=
f
.
ClientSet
.
CoreV1
()
.
Pods
(
f
.
Namespace
.
Name
)
.
Create
(
h
.
prepPod
)
Expect
(
err
)
.
ToNot
(
HaveOccurred
(),
"while creating host
p
ath init pod"
)
Expect
(
err
)
.
ToNot
(
HaveOccurred
(),
"while creating host
P
ath init pod"
)
err
=
framework
.
WaitForPodSuccessInNamespace
(
f
.
ClientSet
,
pod
.
Name
,
pod
.
Namespace
)
Expect
(
err
)
.
ToNot
(
HaveOccurred
(),
"while waiting for host
p
ath init pod to succeed"
)
Expect
(
err
)
.
ToNot
(
HaveOccurred
(),
"while waiting for host
P
ath init pod to succeed"
)
err
=
framework
.
DeletePodWithWait
(
f
,
f
.
ClientSet
,
pod
)
Expect
(
err
)
.
ToNot
(
HaveOccurred
(),
"while deleting host
p
ath init pod"
)
Expect
(
err
)
.
ToNot
(
HaveOccurred
(),
"while deleting host
P
ath init pod"
)
}
func
(
h
*
host
p
athSymlinkDriver
)
DeleteVolume
(
volType
testpatterns
.
TestVolType
)
{
func
(
h
*
host
P
athSymlinkDriver
)
DeleteVolume
(
volType
testpatterns
.
TestVolType
)
{
f
:=
h
.
driverInfo
.
Framework
cmd
:=
fmt
.
Sprintf
(
"rm -rf %v&& rm -rf %v"
,
h
.
targetPath
,
h
.
sourcePath
)
h
.
prepPod
.
Spec
.
Containers
[
0
]
.
Command
=
[]
string
{
"/bin/sh"
,
"-ec"
,
cmd
}
pod
,
err
:=
f
.
ClientSet
.
CoreV1
()
.
Pods
(
f
.
Namespace
.
Name
)
.
Create
(
h
.
prepPod
)
Expect
(
err
)
.
ToNot
(
HaveOccurred
(),
"while creating host
p
ath teardown pod"
)
Expect
(
err
)
.
ToNot
(
HaveOccurred
(),
"while creating host
P
ath teardown pod"
)
err
=
framework
.
WaitForPodSuccessInNamespace
(
f
.
ClientSet
,
pod
.
Name
,
pod
.
Namespace
)
Expect
(
err
)
.
ToNot
(
HaveOccurred
(),
"while waiting for host
p
ath teardown pod to succeed"
)
Expect
(
err
)
.
ToNot
(
HaveOccurred
(),
"while waiting for host
P
ath teardown pod to succeed"
)
err
=
framework
.
DeletePodWithWait
(
f
,
f
.
ClientSet
,
pod
)
Expect
(
err
)
.
ToNot
(
HaveOccurred
(),
"while deleting host
p
ath teardown pod"
)
Expect
(
err
)
.
ToNot
(
HaveOccurred
(),
"while deleting host
P
ath teardown pod"
)
}
// emptydir
...
...
test/e2e/storage/in_tree_volumes.go
View file @
79230ee5
...
...
@@ -34,8 +34,8 @@ var testDrivers = []func() drivers.TestDriver{
drivers
.
InitISCSIDriver
,
drivers
.
InitRbdDriver
,
drivers
.
InitCephFSDriver
,
drivers
.
InitHost
p
athDriver
,
drivers
.
InitHost
p
athSymlinkDriver
,
drivers
.
InitHost
P
athDriver
,
drivers
.
InitHost
P
athSymlinkDriver
,
drivers
.
InitEmptydirDriver
,
drivers
.
InitCinderDriver
,
drivers
.
InitGceDriver
,
...
...
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