Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
G
gost
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
gost
Commits
e0066c9c
Commit
e0066c9c
authored
Nov 21, 2017
by
rui.zheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Node filter only applies to node list of more than one node
parent
4cdf5d5b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
3 deletions
+2
-3
chain.go
chain.go
+1
-1
selector.go
selector.go
+1
-2
No files found.
chain.go
View file @
e0066c9c
...
@@ -53,7 +53,7 @@ func (c *Chain) NodeGroups() []*NodeGroup {
...
@@ -53,7 +53,7 @@ func (c *Chain) NodeGroups() []*NodeGroup {
}
}
// LastNode returns the last node of the node list.
// LastNode returns the last node of the node list.
// If the chain is empty, an empty node
is returns
.
// If the chain is empty, an empty node
will be returned
.
// If the last node is a node group, the first node in the group will be returned.
// If the last node is a node group, the first node in the group will be returned.
func
(
c
*
Chain
)
LastNode
()
Node
{
func
(
c
*
Chain
)
LastNode
()
Node
{
if
c
.
IsEmpty
()
{
if
c
.
IsEmpty
()
{
...
...
selector.go
View file @
e0066c9c
...
@@ -16,7 +16,6 @@ var (
...
@@ -16,7 +16,6 @@ var (
// NodeSelector as a mechanism to pick nodes and mark their status.
// NodeSelector as a mechanism to pick nodes and mark their status.
type
NodeSelector
interface
{
type
NodeSelector
interface
{
Select
(
nodes
[]
Node
,
opts
...
SelectOption
)
(
Node
,
error
)
Select
(
nodes
[]
Node
,
opts
...
SelectOption
)
(
Node
,
error
)
// Mark(node Node)
}
}
type
defaultSelector
struct
{
type
defaultSelector
struct
{
...
@@ -130,7 +129,7 @@ type FailFilter struct {
...
@@ -130,7 +129,7 @@ type FailFilter struct {
// Filter filters nodes.
// Filter filters nodes.
func
(
f
*
FailFilter
)
Filter
(
nodes
[]
Node
)
[]
Node
{
func
(
f
*
FailFilter
)
Filter
(
nodes
[]
Node
)
[]
Node
{
if
f
.
MaxFails
<=
0
{
if
len
(
nodes
)
<=
1
||
f
.
MaxFails
<=
0
{
return
nodes
return
nodes
}
}
nl
:=
[]
Node
{}
nl
:=
[]
Node
{}
...
...
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