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
7a1ac6c6
Commit
7a1ac6c6
authored
Feb 15, 2017
by
Humble Chirammal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adjust nodiskconflict support based on iscsi multipath feature.
Signed-off-by:
Humble Chirammal
<
hchiramm@redhat.com
>
parent
a57967f4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
18 deletions
+8
-18
predicates.go
plugin/pkg/scheduler/algorithm/predicates/predicates.go
+4
-14
predicates_test.go
plugin/pkg/scheduler/algorithm/predicates/predicates_test.go
+4
-4
No files found.
plugin/pkg/scheduler/algorithm/predicates/predicates.go
View file @
7a1ac6c6
...
@@ -21,7 +21,6 @@ import (
...
@@ -21,7 +21,6 @@ import (
"fmt"
"fmt"
"math/rand"
"math/rand"
"strconv"
"strconv"
"strings"
"sync"
"sync"
"time"
"time"
...
@@ -131,21 +130,12 @@ func isVolumeConflict(volume v1.Volume, pod *v1.Pod) bool {
...
@@ -131,21 +130,12 @@ func isVolumeConflict(volume v1.Volume, pod *v1.Pod) bool {
}
}
if
volume
.
ISCSI
!=
nil
&&
existingVolume
.
ISCSI
!=
nil
{
if
volume
.
ISCSI
!=
nil
&&
existingVolume
.
ISCSI
!=
nil
{
iqn
,
lun
,
target
:=
volume
.
ISCSI
.
IQN
,
volume
.
ISCSI
.
Lun
,
volume
.
ISCSI
.
TargetPortal
iqn
:=
volume
.
ISCSI
.
IQN
eiqn
,
elun
,
etarget
:=
existingVolume
.
ISCSI
.
IQN
,
existingVolume
.
ISCSI
.
Lun
,
existingVolume
.
ISCSI
.
TargetPortal
eiqn
:=
existingVolume
.
ISCSI
.
IQN
if
!
strings
.
Contains
(
target
,
":"
)
{
// two ISCSI volumes are same, if they share the same iqn. As iscsi volumes are of type
target
=
target
+
":3260"
}
if
!
strings
.
Contains
(
etarget
,
":"
)
{
etarget
=
etarget
+
":3260"
}
lun1
:=
strconv
.
Itoa
(
int
(
lun
))
elun1
:=
strconv
.
Itoa
(
int
(
elun
))
// two ISCSI volumes are same, if they share the same iqn, lun and target. As iscsi volumes are of type
// RWO or ROX, we could permit only one RW mount. Same iscsi volume mounted by multiple Pods
// RWO or ROX, we could permit only one RW mount. Same iscsi volume mounted by multiple Pods
// conflict unless all other pods mount as read only.
// conflict unless all other pods mount as read only.
if
iqn
==
eiqn
&&
lun1
==
elun1
&&
target
==
etarget
&&
!
(
volume
.
ISCSI
.
ReadOnly
&&
existingVolume
.
ISCSI
.
ReadOnly
)
{
if
iqn
==
eiqn
&&
!
(
volume
.
ISCSI
.
ReadOnly
&&
existingVolume
.
ISCSI
.
ReadOnly
)
{
return
true
return
true
}
}
}
}
...
...
plugin/pkg/scheduler/algorithm/predicates/predicates_test.go
View file @
7a1ac6c6
...
@@ -739,7 +739,7 @@ func TestISCSIDiskConflicts(t *testing.T) {
...
@@ -739,7 +739,7 @@ func TestISCSIDiskConflicts(t *testing.T) {
VolumeSource
:
v1
.
VolumeSource
{
VolumeSource
:
v1
.
VolumeSource
{
ISCSI
:
&
v1
.
ISCSIVolumeSource
{
ISCSI
:
&
v1
.
ISCSIVolumeSource
{
TargetPortal
:
"127.0.0.1:3260"
,
TargetPortal
:
"127.0.0.1:3260"
,
IQN
:
"iqn.201
4
-12.server:storage.target01"
,
IQN
:
"iqn.201
6
-12.server:storage.target01"
,
FSType
:
"ext4"
,
FSType
:
"ext4"
,
Lun
:
0
,
Lun
:
0
,
},
},
...
@@ -752,10 +752,10 @@ func TestISCSIDiskConflicts(t *testing.T) {
...
@@ -752,10 +752,10 @@ func TestISCSIDiskConflicts(t *testing.T) {
{
{
VolumeSource
:
v1
.
VolumeSource
{
VolumeSource
:
v1
.
VolumeSource
{
ISCSI
:
&
v1
.
ISCSIVolumeSource
{
ISCSI
:
&
v1
.
ISCSIVolumeSource
{
TargetPortal
:
"127.0.0.
2
:3260"
,
TargetPortal
:
"127.0.0.
1
:3260"
,
IQN
:
"iqn.201
4
-12.server:storage.target01"
,
IQN
:
"iqn.201
7
-12.server:storage.target01"
,
FSType
:
"ext4"
,
FSType
:
"ext4"
,
Lun
:
1
,
Lun
:
0
,
},
},
},
},
},
},
...
...
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