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
6e5176b4
Unverified
Commit
6e5176b4
authored
Nov 28, 2018
by
k8s-ci-robot
Committed by
GitHub
Nov 28, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #71520 from saad-ali/allow0310Both
Allow CSI Drivers suporting 0.x/1.x to use old dir
parents
3d68f44d
18050e30
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
11 deletions
+11
-11
csi_plugin.go
pkg/volume/csi/csi_plugin.go
+4
-4
csi_plugin_test.go
pkg/volume/csi/csi_plugin_test.go
+7
-7
No files found.
pkg/volume/csi/csi_plugin.go
View file @
6e5176b4
...
@@ -705,15 +705,15 @@ func highestSupportedVersion(versions []string) (*utilversion.Version, error) {
...
@@ -705,15 +705,15 @@ func highestSupportedVersion(versions []string) (*utilversion.Version, error) {
return
nil
,
fmt
.
Errorf
(
"None of the CSI versions reported by this driver are supported"
)
return
nil
,
fmt
.
Errorf
(
"None of the CSI versions reported by this driver are supported"
)
}
}
// Only
CSI 0.x drivers
are allowed to use deprecated socket dir.
// Only
drivers that implement CSI 0.x
are allowed to use deprecated socket dir.
func
isDeprecatedSocketDirAllowed
(
versions
[]
string
)
bool
{
func
isDeprecatedSocketDirAllowed
(
versions
[]
string
)
bool
{
for
_
,
version
:=
range
versions
{
for
_
,
version
:=
range
versions
{
if
!
isV0Version
(
version
)
{
if
isV0Version
(
version
)
{
return
fals
e
return
tru
e
}
}
}
}
return
tru
e
return
fals
e
}
}
func
isV0Version
(
version
string
)
bool
{
func
isV0Version
(
version
string
)
bool
{
...
...
pkg/volume/csi/csi_plugin_test.go
View file @
6e5176b4
...
@@ -617,7 +617,7 @@ func TestValidatePlugin(t *testing.T) {
...
@@ -617,7 +617,7 @@ func TestValidatePlugin(t *testing.T) {
endpoint
:
"/var/log/kubelet/plugins/myplugin/csi.sock"
,
endpoint
:
"/var/log/kubelet/plugins/myplugin/csi.sock"
,
versions
:
[]
string
{
"0.2.0"
,
"v1.0.0"
},
versions
:
[]
string
{
"0.2.0"
,
"v1.0.0"
},
foundInDeprecatedDir
:
true
,
foundInDeprecatedDir
:
true
,
shouldFail
:
tru
e
,
shouldFail
:
fals
e
,
},
},
{
{
pluginName
:
"test.plugin"
,
pluginName
:
"test.plugin"
,
...
@@ -631,7 +631,7 @@ func TestValidatePlugin(t *testing.T) {
...
@@ -631,7 +631,7 @@ func TestValidatePlugin(t *testing.T) {
endpoint
:
"/var/log/kubelet/plugins/myplugin/csi.sock"
,
endpoint
:
"/var/log/kubelet/plugins/myplugin/csi.sock"
,
versions
:
[]
string
{
"0.2.0"
,
"v1.2.3"
},
versions
:
[]
string
{
"0.2.0"
,
"v1.2.3"
},
foundInDeprecatedDir
:
true
,
foundInDeprecatedDir
:
true
,
shouldFail
:
tru
e
,
shouldFail
:
fals
e
,
},
},
{
{
pluginName
:
"test.plugin"
,
pluginName
:
"test.plugin"
,
...
@@ -645,7 +645,7 @@ func TestValidatePlugin(t *testing.T) {
...
@@ -645,7 +645,7 @@ func TestValidatePlugin(t *testing.T) {
endpoint
:
"/var/log/kubelet/plugins/myplugin/csi.sock"
,
endpoint
:
"/var/log/kubelet/plugins/myplugin/csi.sock"
,
versions
:
[]
string
{
"v1.2.3"
,
"v0.3.0"
},
versions
:
[]
string
{
"v1.2.3"
,
"v0.3.0"
},
foundInDeprecatedDir
:
true
,
foundInDeprecatedDir
:
true
,
shouldFail
:
tru
e
,
shouldFail
:
fals
e
,
},
},
{
{
pluginName
:
"test.plugin"
,
pluginName
:
"test.plugin"
,
...
@@ -659,14 +659,14 @@ func TestValidatePlugin(t *testing.T) {
...
@@ -659,14 +659,14 @@ func TestValidatePlugin(t *testing.T) {
endpoint
:
"/var/log/kubelet/plugins/myplugin/csi.sock"
,
endpoint
:
"/var/log/kubelet/plugins/myplugin/csi.sock"
,
versions
:
[]
string
{
"v1.2.3"
,
"v0.3.0"
,
"2.0.1"
},
versions
:
[]
string
{
"v1.2.3"
,
"v0.3.0"
,
"2.0.1"
},
foundInDeprecatedDir
:
true
,
foundInDeprecatedDir
:
true
,
shouldFail
:
tru
e
,
shouldFail
:
fals
e
,
},
},
{
{
pluginName
:
"test.plugin"
,
pluginName
:
"test.plugin"
,
endpoint
:
"/var/log/kubelet/plugins/myplugin/csi.sock"
,
endpoint
:
"/var/log/kubelet/plugins/myplugin/csi.sock"
,
versions
:
[]
string
{
"v0.3.0"
,
"2.0.1"
},
versions
:
[]
string
{
"v0.3.0"
,
"2.0.1"
},
foundInDeprecatedDir
:
true
,
foundInDeprecatedDir
:
true
,
shouldFail
:
tru
e
,
shouldFail
:
fals
e
,
},
},
{
{
pluginName
:
"test.plugin"
,
pluginName
:
"test.plugin"
,
...
@@ -680,7 +680,7 @@ func TestValidatePlugin(t *testing.T) {
...
@@ -680,7 +680,7 @@ func TestValidatePlugin(t *testing.T) {
endpoint
:
"/var/log/kubelet/plugins/myplugin/csi.sock"
,
endpoint
:
"/var/log/kubelet/plugins/myplugin/csi.sock"
,
versions
:
[]
string
{
"v1.2.3"
,
"4.9.12"
,
"v0.3.0"
,
"2.0.1"
},
versions
:
[]
string
{
"v1.2.3"
,
"4.9.12"
,
"v0.3.0"
,
"2.0.1"
},
foundInDeprecatedDir
:
true
,
foundInDeprecatedDir
:
true
,
shouldFail
:
tru
e
,
shouldFail
:
fals
e
,
},
},
{
{
pluginName
:
"test.plugin"
,
pluginName
:
"test.plugin"
,
...
@@ -694,7 +694,7 @@ func TestValidatePlugin(t *testing.T) {
...
@@ -694,7 +694,7 @@ func TestValidatePlugin(t *testing.T) {
endpoint
:
"/var/log/kubelet/plugins/myplugin/csi.sock"
,
endpoint
:
"/var/log/kubelet/plugins/myplugin/csi.sock"
,
versions
:
[]
string
{
"v1.2.3"
,
"boo"
,
"v0.3.0"
,
"2.0.1"
},
versions
:
[]
string
{
"v1.2.3"
,
"boo"
,
"v0.3.0"
,
"2.0.1"
},
foundInDeprecatedDir
:
true
,
foundInDeprecatedDir
:
true
,
shouldFail
:
tru
e
,
shouldFail
:
fals
e
,
},
},
{
{
pluginName
:
"test.plugin"
,
pluginName
:
"test.plugin"
,
...
...
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