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
b70e194f
Commit
b70e194f
authored
Nov 29, 2016
by
Marcin Wielgus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable update tests in federated namespace controller
parent
5e41d090
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
14 deletions
+8
-14
namespace_controller_test.go
...eration-controller/namespace/namespace_controller_test.go
+8
-14
No files found.
federation/pkg/federation-controller/namespace/namespace_controller_test.go
View file @
b70e194f
...
@@ -62,7 +62,7 @@ func TestNamespaceController(t *testing.T) {
...
@@ -62,7 +62,7 @@ func TestNamespaceController(t *testing.T) {
cluster1Watch
:=
RegisterFakeWatch
(
"namespaces"
,
&
cluster1Client
.
Fake
)
cluster1Watch
:=
RegisterFakeWatch
(
"namespaces"
,
&
cluster1Client
.
Fake
)
RegisterFakeList
(
"namespaces"
,
&
cluster1Client
.
Fake
,
&
apiv1
.
NamespaceList
{
Items
:
[]
apiv1
.
Namespace
{}})
RegisterFakeList
(
"namespaces"
,
&
cluster1Client
.
Fake
,
&
apiv1
.
NamespaceList
{
Items
:
[]
apiv1
.
Namespace
{}})
cluster1CreateChan
:=
RegisterFakeCopyOnCreate
(
"namespaces"
,
&
cluster1Client
.
Fake
,
cluster1Watch
)
cluster1CreateChan
:=
RegisterFakeCopyOnCreate
(
"namespaces"
,
&
cluster1Client
.
Fake
,
cluster1Watch
)
//
cluster1UpdateChan := RegisterFakeCopyOnUpdate("namespaces", &cluster1Client.Fake, cluster1Watch)
cluster1UpdateChan
:=
RegisterFakeCopyOnUpdate
(
"namespaces"
,
&
cluster1Client
.
Fake
,
cluster1Watch
)
cluster2Client
:=
&
fakekubeclientset
.
Clientset
{}
cluster2Client
:=
&
fakekubeclientset
.
Clientset
{}
cluster2Watch
:=
RegisterFakeWatch
(
"namespaces"
,
&
cluster2Client
.
Fake
)
cluster2Watch
:=
RegisterFakeWatch
(
"namespaces"
,
&
cluster2Client
.
Fake
)
...
@@ -132,25 +132,19 @@ func TestNamespaceController(t *testing.T) {
...
@@ -132,25 +132,19 @@ func TestNamespaceController(t *testing.T) {
cluster1
.
Name
,
ns1
.
Name
,
wait
.
ForeverTestTimeout
)
cluster1
.
Name
,
ns1
.
Name
,
wait
.
ForeverTestTimeout
)
assert
.
Nil
(
t
,
err
,
"namespace should have appeared in the informer store"
)
assert
.
Nil
(
t
,
err
,
"namespace should have appeared in the informer store"
)
/*
// Test update federated namespace.
// TODO: Uncomment this once we have figured out why this is flaky.
ns1
.
Annotations
=
map
[
string
]
string
{
// Test update federated namespace.
"A"
:
"B"
,
ns1.Annotations = map[string]string{
}
"A": "B",
namespaceWatch
.
Modify
(
&
ns1
)
}
assert
.
NoError
(
t
,
CheckObjectFromChan
(
cluster1UpdateChan
,
MetaAndSpecCheckingFunction
(
&
ns1
)))
namespaceWatch.Modify(&ns1)
updatedNamespace = GetNamespaceFromChan(cluster1UpdateChan)
assert.NotNil(t, updatedNamespace)
assert.Equal(t, ns1.Name, updatedNamespace.Name)
// assert.Contains(t, updatedNamespace.Annotations, "A")
*/
// Test add cluster
// Test add cluster
clusterWatch
.
Add
(
cluster2
)
clusterWatch
.
Add
(
cluster2
)
createdNamespace2
:=
GetNamespaceFromChan
(
cluster2CreateChan
)
createdNamespace2
:=
GetNamespaceFromChan
(
cluster2CreateChan
)
assert
.
NotNil
(
t
,
createdNamespace2
)
assert
.
NotNil
(
t
,
createdNamespace2
)
assert
.
Equal
(
t
,
ns1
.
Name
,
createdNamespace2
.
Name
)
assert
.
Equal
(
t
,
ns1
.
Name
,
createdNamespace2
.
Name
)
//
assert.Contains(t, createdNamespace2.Annotations, "A")
assert
.
Contains
(
t
,
createdNamespace2
.
Annotations
,
"A"
)
// Delete the namespace with orphan finalizer (let namespaces
// Delete the namespace with orphan finalizer (let namespaces
// in underlying clusters be as is).
// in underlying clusters be as is).
...
...
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