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
43a5091f
Commit
43a5091f
authored
Aug 11, 2018
by
tanshanshan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove getZoneNames func
parent
a1b3133b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
25 deletions
+8
-25
ubernetes_lite.go
test/e2e/scheduling/ubernetes_lite.go
+5
-22
ubernetes_lite_volumes.go
test/e2e/scheduling/ubernetes_lite_volumes.go
+3
-3
No files found.
test/e2e/scheduling/ubernetes_lite.go
View file @
43a5091f
...
@@ -26,7 +26,6 @@ import (
...
@@ -26,7 +26,6 @@ import (
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/util/intstr"
"k8s.io/apimachinery/pkg/util/intstr"
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/apimachinery/pkg/util/uuid"
"k8s.io/apimachinery/pkg/util/uuid"
clientset
"k8s.io/client-go/kubernetes"
clientset
"k8s.io/client-go/kubernetes"
kubeletapis
"k8s.io/kubernetes/pkg/kubelet/apis"
kubeletapis
"k8s.io/kubernetes/pkg/kubelet/apis"
...
@@ -110,9 +109,9 @@ func SpreadServiceOrFail(f *framework.Framework, replicaCount int, image string)
...
@@ -110,9 +109,9 @@ func SpreadServiceOrFail(f *framework.Framework, replicaCount int, image string)
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
// Now make sure they're spread across zones
// Now make sure they're spread across zones
zoneNames
,
err
:=
getZoneNam
es
(
f
.
ClientSet
)
zoneNames
,
err
:=
framework
.
GetClusterZon
es
(
f
.
ClientSet
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
Expect
(
checkZoneSpreading
(
f
.
ClientSet
,
pods
,
zoneNames
))
.
To
(
Equal
(
true
))
Expect
(
checkZoneSpreading
(
f
.
ClientSet
,
pods
,
zoneNames
.
List
()
))
.
To
(
Equal
(
true
))
}
}
// Find the name of the zone in which a Node is running
// Find the name of the zone in which a Node is running
...
@@ -126,25 +125,9 @@ func getZoneNameForNode(node v1.Node) (string, error) {
...
@@ -126,25 +125,9 @@ func getZoneNameForNode(node v1.Node) (string, error) {
node
.
Name
,
kubeletapis
.
LabelZoneFailureDomain
)
node
.
Name
,
kubeletapis
.
LabelZoneFailureDomain
)
}
}
// TODO (verult) Merge with framework.GetClusterZones()
// Find the names of all zones in which we have nodes in this cluster.
func
getZoneNames
(
c
clientset
.
Interface
)
([]
string
,
error
)
{
zoneNames
:=
sets
.
NewString
()
nodes
,
err
:=
c
.
CoreV1
()
.
Nodes
()
.
List
(
metav1
.
ListOptions
{})
if
err
!=
nil
{
return
nil
,
err
}
for
_
,
node
:=
range
nodes
.
Items
{
zoneName
,
err
:=
getZoneNameForNode
(
node
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
zoneNames
.
Insert
(
zoneName
)
}
return
zoneNames
.
List
(),
nil
}
// Return the number of zones in which we have nodes in this cluster.
// Return the number of zones in which we have nodes in this cluster.
func
getZoneCount
(
c
clientset
.
Interface
)
(
int
,
error
)
{
func
getZoneCount
(
c
clientset
.
Interface
)
(
int
,
error
)
{
zoneNames
,
err
:=
getZoneNam
es
(
c
)
zoneNames
,
err
:=
framework
.
GetClusterZon
es
(
c
)
if
err
!=
nil
{
if
err
!=
nil
{
return
-
1
,
err
return
-
1
,
err
}
}
...
@@ -239,7 +222,7 @@ func SpreadRCOrFail(f *framework.Framework, replicaCount int32, image string) {
...
@@ -239,7 +222,7 @@ func SpreadRCOrFail(f *framework.Framework, replicaCount int32, image string) {
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
// Now make sure they're spread across zones
// Now make sure they're spread across zones
zoneNames
,
err
:=
getZoneNam
es
(
f
.
ClientSet
)
zoneNames
,
err
:=
framework
.
GetClusterZon
es
(
f
.
ClientSet
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
Expect
(
checkZoneSpreading
(
f
.
ClientSet
,
pods
,
zoneNames
))
.
To
(
Equal
(
true
))
Expect
(
checkZoneSpreading
(
f
.
ClientSet
,
pods
,
zoneNames
.
List
()
))
.
To
(
Equal
(
true
))
}
}
test/e2e/scheduling/ubernetes_lite_volumes.go
View file @
43a5091f
...
@@ -185,9 +185,9 @@ func PodsUseStaticPVsOrFail(f *framework.Framework, podCount int, image string)
...
@@ -185,9 +185,9 @@ func PodsUseStaticPVsOrFail(f *framework.Framework, podCount int, image string)
c
:=
f
.
ClientSet
c
:=
f
.
ClientSet
ns
:=
f
.
Namespace
.
Name
ns
:=
f
.
Namespace
.
Name
zones
,
err
:=
getZoneNam
es
(
c
)
zones
,
err
:=
framework
.
GetClusterZon
es
(
c
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
zonelist
:=
zones
.
List
()
By
(
"Creating static PVs across zones"
)
By
(
"Creating static PVs across zones"
)
configs
:=
make
([]
*
staticPVTestConfig
,
podCount
)
configs
:=
make
([]
*
staticPVTestConfig
,
podCount
)
for
i
:=
range
configs
{
for
i
:=
range
configs
{
...
@@ -208,7 +208,7 @@ func PodsUseStaticPVsOrFail(f *framework.Framework, podCount int, image string)
...
@@ -208,7 +208,7 @@ func PodsUseStaticPVsOrFail(f *framework.Framework, podCount int, image string)
}()
}()
for
i
,
config
:=
range
configs
{
for
i
,
config
:=
range
configs
{
zone
:=
zone
s
[
i
%
len
(
zones
)]
zone
:=
zone
list
[
i
%
len
(
zones
)]
config
.
pvSource
,
err
=
framework
.
CreatePVSource
(
zone
)
config
.
pvSource
,
err
=
framework
.
CreatePVSource
(
zone
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
...
...
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