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
46218870
Commit
46218870
authored
Nov 08, 2018
by
David Zhu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated test files with new fields
parent
3595dee6
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
8 deletions
+49
-8
nodeinfomanager_test.go
pkg/volume/csi/nodeinfomanager/nodeinfomanager_test.go
+0
-0
admission_test.go
plugin/pkg/admission/noderestriction/admission_test.go
+27
-4
node_test.go
test/integration/auth/node_test.go
+22
-4
No files found.
pkg/volume/csi/nodeinfomanager/nodeinfomanager_test.go
View file @
46218870
This diff is collapsed.
Click to expand it.
plugin/pkg/admission/noderestriction/admission_test.go
View file @
46218870
...
@@ -22,6 +22,7 @@ import (
...
@@ -22,6 +22,7 @@ import (
"time"
"time"
"fmt"
"fmt"
corev1
"k8s.io/api/core/v1"
corev1
"k8s.io/api/core/v1"
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/runtime/schema"
...
@@ -216,25 +217,47 @@ func Test_nodePlugin_Admit(t *testing.T) {
...
@@ -216,25 +217,47 @@ func Test_nodePlugin_Admit(t *testing.T) {
ObjectMeta
:
metav1
.
ObjectMeta
{
ObjectMeta
:
metav1
.
ObjectMeta
{
Name
:
"mynode"
,
Name
:
"mynode"
,
},
},
CSIDrivers
:
[]
csiv1alpha1
.
CSIDriverInfo
{
Spec
:
csiv1alpha1
.
CSINodeInfoSpec
{
Drivers
:
[]
csiv1alpha1
.
CSIDriverInfoSpec
{
{
{
Driver
:
"com.example.csi/mydriver"
,
Name
:
"com.example.csi/mydriver"
,
NodeID
:
"com.example.csi/mynode"
,
NodeID
:
"com.example.csi/mynode"
,
TopologyKeys
:
[]
string
{
"com.example.csi/zone"
},
TopologyKeys
:
[]
string
{
"com.example.csi/zone"
},
},
},
},
},
},
Status
:
csiv1alpha1
.
CSINodeInfoStatus
{
Drivers
:
[]
csiv1alpha1
.
CSIDriverInfoStatus
{
{
Name
:
"com.example.csi/mydriver"
,
Available
:
true
,
VolumePluginMechanism
:
csiv1alpha1
.
VolumePluginMechanismInTree
,
},
},
},
}
}
nodeInfoWrongName
=
&
csiv1alpha1
.
CSINodeInfo
{
nodeInfoWrongName
=
&
csiv1alpha1
.
CSINodeInfo
{
ObjectMeta
:
metav1
.
ObjectMeta
{
ObjectMeta
:
metav1
.
ObjectMeta
{
Name
:
"foo"
,
Name
:
"foo"
,
},
},
CSIDrivers
:
[]
csiv1alpha1
.
CSIDriverInfo
{
Spec
:
csiv1alpha1
.
CSINodeInfoSpec
{
Drivers
:
[]
csiv1alpha1
.
CSIDriverInfoSpec
{
{
{
Driver
:
"com.example.csi/mydriver"
,
Name
:
"com.example.csi/mydriver"
,
NodeID
:
"com.example.csi/foo"
,
NodeID
:
"com.example.csi/foo"
,
TopologyKeys
:
[]
string
{
"com.example.csi/zone"
},
TopologyKeys
:
[]
string
{
"com.example.csi/zone"
},
},
},
},
},
},
Status
:
csiv1alpha1
.
CSINodeInfoStatus
{
Drivers
:
[]
csiv1alpha1
.
CSIDriverInfoStatus
{
{
Name
:
"com.example.csi/mydriver"
,
Available
:
true
,
VolumePluginMechanism
:
csiv1alpha1
.
VolumePluginMechanismInTree
,
},
},
},
}
}
noExistingPodsIndex
=
cache
.
NewIndexer
(
cache
.
MetaNamespaceKeyFunc
,
nil
)
noExistingPodsIndex
=
cache
.
NewIndexer
(
cache
.
MetaNamespaceKeyFunc
,
nil
)
...
...
test/integration/auth/node_test.go
View file @
46218870
...
@@ -420,13 +420,24 @@ func TestNodeAuthorizer(t *testing.T) {
...
@@ -420,13 +420,24 @@ func TestNodeAuthorizer(t *testing.T) {
ObjectMeta
:
metav1
.
ObjectMeta
{
ObjectMeta
:
metav1
.
ObjectMeta
{
Name
:
"node1"
,
Name
:
"node1"
,
},
},
CSIDrivers
:
[]
csiv1alpha1
.
CSIDriverInfo
{
Spec
:
csiv1alpha1
.
CSINodeInfoSpec
{
Drivers
:
[]
csiv1alpha1
.
CSIDriverInfoSpec
{
{
{
Driver
:
"com.example.csi/driver1"
,
Name
:
"com.example.csi/driver1"
,
NodeID
:
"com.example.csi/node1"
,
NodeID
:
"com.example.csi/node1"
,
TopologyKeys
:
[]
string
{
"com.example.csi/zone"
},
TopologyKeys
:
[]
string
{
"com.example.csi/zone"
},
},
},
},
},
},
Status
:
csiv1alpha1
.
CSINodeInfoStatus
{
Drivers
:
[]
csiv1alpha1
.
CSIDriverInfoStatus
{
{
Name
:
"com.example.csi/driver1"
,
Available
:
true
,
VolumePluginMechanism
:
csiv1alpha1
.
VolumePluginMechanismInTree
,
},
},
},
}
}
_
,
err
:=
client
.
CsiV1alpha1
()
.
CSINodeInfos
()
.
Create
(
nodeInfo
)
_
,
err
:=
client
.
CsiV1alpha1
()
.
CSINodeInfos
()
.
Create
(
nodeInfo
)
return
err
return
err
...
@@ -438,13 +449,20 @@ func TestNodeAuthorizer(t *testing.T) {
...
@@ -438,13 +449,20 @@ func TestNodeAuthorizer(t *testing.T) {
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
}
}
nodeInfo
.
CSIDrivers
=
[]
csiv1alpha1
.
CSIDriverInfo
{
nodeInfo
.
Spec
.
Drivers
=
[]
csiv1alpha1
.
CSIDriverInfoSpec
{
{
{
Driver
:
"com.example.csi/driver1"
,
Name
:
"com.example.csi/driver1"
,
NodeID
:
"com.example.csi/node1"
,
NodeID
:
"com.example.csi/node1"
,
TopologyKeys
:
[]
string
{
"com.example.csi/rack"
},
TopologyKeys
:
[]
string
{
"com.example.csi/rack"
},
},
},
}
}
nodeInfo
.
Status
.
Drivers
=
[]
csiv1alpha1
.
CSIDriverInfoStatus
{
{
Name
:
"com.example.csi/driver1"
,
Available
:
true
,
VolumePluginMechanism
:
csiv1alpha1
.
VolumePluginMechanismInTree
,
},
}
_
,
err
=
client
.
CsiV1alpha1
()
.
CSINodeInfos
()
.
Update
(
nodeInfo
)
_
,
err
=
client
.
CsiV1alpha1
()
.
CSINodeInfos
()
.
Update
(
nodeInfo
)
return
err
return
err
}
}
...
...
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