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
55e642cb
Commit
55e642cb
authored
Jul 01, 2016
by
Matt Liggett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use a pointer. Duh.
parent
088b8717
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
federated-service.go
test/e2e/federated-service.go
+8
-7
No files found.
test/e2e/federated-service.go
View file @
55e642cb
...
@@ -75,7 +75,7 @@ type cluster struct {
...
@@ -75,7 +75,7 @@ type cluster struct {
var
_
=
framework
.
KubeDescribe
(
"[Feature:Federation]"
,
func
()
{
var
_
=
framework
.
KubeDescribe
(
"[Feature:Federation]"
,
func
()
{
f
:=
framework
.
NewDefaultFederatedFramework
(
"federated-service"
)
f
:=
framework
.
NewDefaultFederatedFramework
(
"federated-service"
)
var
clusters
map
[
string
]
cluster
var
clusters
map
[
string
]
*
cluster
var
federationName
string
var
federationName
string
var
primaryClusterName
string
// The name of the "primary" cluster
var
primaryClusterName
string
// The name of the "primary" cluster
...
@@ -118,7 +118,7 @@ var _ = framework.KubeDescribe("[Feature:Federation]", func() {
...
@@ -118,7 +118,7 @@ var _ = framework.KubeDescribe("[Feature:Federation]", func() {
framework
.
Logf
(
"%d clusters are Ready"
,
len
(
contexts
))
framework
.
Logf
(
"%d clusters are Ready"
,
len
(
contexts
))
// clusters = make([]cluster, len(clusterList.Items))
// clusters = make([]cluster, len(clusterList.Items))
clusters
=
map
[
string
]
cluster
{}
clusters
=
map
[
string
]
*
cluster
{}
primaryClusterName
=
clusterList
.
Items
[
0
]
.
Name
primaryClusterName
=
clusterList
.
Items
[
0
]
.
Name
By
(
fmt
.
Sprintf
(
"Labeling %q as the first cluster"
,
primaryClusterName
))
By
(
fmt
.
Sprintf
(
"Labeling %q as the first cluster"
,
primaryClusterName
))
for
i
,
c
:=
range
clusterList
.
Items
{
for
i
,
c
:=
range
clusterList
.
Items
{
...
@@ -140,7 +140,7 @@ var _ = framework.KubeDescribe("[Feature:Federation]", func() {
...
@@ -140,7 +140,7 @@ var _ = framework.KubeDescribe("[Feature:Federation]", func() {
cfg
.
QPS
=
KubeAPIQPS
cfg
.
QPS
=
KubeAPIQPS
cfg
.
Burst
=
KubeAPIBurst
cfg
.
Burst
=
KubeAPIBurst
clset
:=
release_1_3
.
NewForConfigOrDie
(
restclient
.
AddUserAgent
(
cfg
,
UserAgentName
))
clset
:=
release_1_3
.
NewForConfigOrDie
(
restclient
.
AddUserAgent
(
cfg
,
UserAgentName
))
clusters
[
c
.
Name
]
=
cluster
{
c
.
Name
,
clset
,
false
,
nil
}
clusters
[
c
.
Name
]
=
&
cluster
{
c
.
Name
,
clset
,
false
,
nil
}
}
}
for
name
,
c
:=
range
clusters
{
for
name
,
c
:=
range
clusters
{
...
@@ -350,7 +350,7 @@ func waitForServiceOrFail(clientset *release_1_3.Clientset, namespace string, se
...
@@ -350,7 +350,7 @@ func waitForServiceOrFail(clientset *release_1_3.Clientset, namespace string, se
/*
/*
waitForServiceShardsOrFail waits for the service to appear in all clusters
waitForServiceShardsOrFail waits for the service to appear in all clusters
*/
*/
func
waitForServiceShardsOrFail
(
namespace
string
,
service
*
v1
.
Service
,
clusters
map
[
string
]
cluster
)
{
func
waitForServiceShardsOrFail
(
namespace
string
,
service
*
v1
.
Service
,
clusters
map
[
string
]
*
cluster
)
{
framework
.
Logf
(
"Waiting for service %q in %d clusters"
,
service
.
Name
,
len
(
clusters
))
framework
.
Logf
(
"Waiting for service %q in %d clusters"
,
service
.
Name
,
len
(
clusters
))
for
_
,
c
:=
range
clusters
{
for
_
,
c
:=
range
clusters
{
waitForServiceOrFail
(
c
.
Clientset
,
namespace
,
service
,
true
,
FederatedServiceTimeout
)
waitForServiceOrFail
(
c
.
Clientset
,
namespace
,
service
,
true
,
FederatedServiceTimeout
)
...
@@ -480,7 +480,7 @@ func discoverService(f *framework.Framework, name string, exists bool, podName s
...
@@ -480,7 +480,7 @@ func discoverService(f *framework.Framework, name string, exists bool, podName s
createBackendPodsOrFail creates one pod in each cluster, and returns the created pods (in the same order as clusterClientSets).
createBackendPodsOrFail creates one pod in each cluster, and returns the created pods (in the same order as clusterClientSets).
If creation of any pod fails, the test fails (possibly with a partially created set of pods). No retries are attempted.
If creation of any pod fails, the test fails (possibly with a partially created set of pods). No retries are attempted.
*/
*/
func
createBackendPodsOrFail
(
clusters
map
[
string
]
cluster
,
namespace
string
,
name
string
)
{
func
createBackendPodsOrFail
(
clusters
map
[
string
]
*
cluster
,
namespace
string
,
name
string
)
{
pod
:=
&
v1
.
Pod
{
pod
:=
&
v1
.
Pod
{
ObjectMeta
:
v1
.
ObjectMeta
{
ObjectMeta
:
v1
.
ObjectMeta
{
Name
:
name
,
Name
:
name
,
...
@@ -510,8 +510,9 @@ func createBackendPodsOrFail(clusters map[string]cluster, namespace string, name
...
@@ -510,8 +510,9 @@ func createBackendPodsOrFail(clusters map[string]cluster, namespace string, name
deletes exactly one backend pod which must not be nil
deletes exactly one backend pod which must not be nil
The test fails if there are any errors.
The test fails if there are any errors.
*/
*/
func
deleteOneBackendPodOrFail
(
c
cluster
)
{
func
deleteOneBackendPodOrFail
(
c
*
cluster
)
{
pod
:=
c
.
backendPod
pod
:=
c
.
backendPod
Expect
(
pod
)
.
ToNot
(
BeNil
())
err
:=
c
.
Clientset
.
Core
()
.
Pods
(
pod
.
Namespace
)
.
Delete
(
pod
.
Name
,
api
.
NewDeleteOptions
(
0
))
err
:=
c
.
Clientset
.
Core
()
.
Pods
(
pod
.
Namespace
)
.
Delete
(
pod
.
Name
,
api
.
NewDeleteOptions
(
0
))
if
errors
.
IsNotFound
(
err
)
{
if
errors
.
IsNotFound
(
err
)
{
By
(
fmt
.
Sprintf
(
"Pod %q in namespace %q in cluster %q does not exist. No need to delete it."
,
pod
.
Name
,
pod
.
Namespace
,
c
.
name
))
By
(
fmt
.
Sprintf
(
"Pod %q in namespace %q in cluster %q does not exist. No need to delete it."
,
pod
.
Name
,
pod
.
Namespace
,
c
.
name
))
...
@@ -525,7 +526,7 @@ func deleteOneBackendPodOrFail(c cluster) {
...
@@ -525,7 +526,7 @@ func deleteOneBackendPodOrFail(c cluster) {
deleteBackendPodsOrFail deletes one pod from each cluster that has one.
deleteBackendPodsOrFail deletes one pod from each cluster that has one.
If deletion of any pod fails, the test fails (possibly with a partially deleted set of pods). No retries are attempted.
If deletion of any pod fails, the test fails (possibly with a partially deleted set of pods). No retries are attempted.
*/
*/
func
deleteBackendPodsOrFail
(
clusters
map
[
string
]
cluster
,
namespace
string
)
{
func
deleteBackendPodsOrFail
(
clusters
map
[
string
]
*
cluster
,
namespace
string
)
{
for
name
,
c
:=
range
clusters
{
for
name
,
c
:=
range
clusters
{
if
c
.
backendPod
!=
nil
{
if
c
.
backendPod
!=
nil
{
deleteOneBackendPodOrFail
(
c
)
deleteOneBackendPodOrFail
(
c
)
...
...
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