Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Nomad
Commits
bcf34c34
Unverified
Commit
bcf34c34
authored
7 years ago
by
Preetha Appan
Browse files
Options
Download
Email Patches
Plain Diff
Set node eligibility to true when old client calls disable
parent
400ca29a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
api/nodes.go
+1
-1
api/nodes.go
command/agent/node_endpoint.go
+3
-0
command/agent/node_endpoint.go
with
4 additions
and
1 deletion
+4
-1
api/nodes.go
+
1
-
1
View file @
bcf34c34
...
...
@@ -68,7 +68,7 @@ type NodeDrainUpdateResponse struct {
// UpdateDrain is used to update the drain strategy for a given node. If
// markEligible is true and the drain is being removed, the node will be marked
// as having its scheduling being elib
i
le
// as having its scheduling being eli
gi
ble
func
(
n
*
Nodes
)
UpdateDrain
(
nodeID
string
,
spec
*
DrainSpec
,
markEligible
bool
,
q
*
WriteOptions
)
(
*
NodeDrainUpdateResponse
,
error
)
{
req
:=
&
NodeUpdateDrainRequest
{
NodeID
:
nodeID
,
...
...
This diff is collapsed.
Click to expand it.
command/agent/node_endpoint.go
+
3
-
0
View file @
bcf34c34
...
...
@@ -124,6 +124,9 @@ func (s *HTTPServer) nodeToggleDrain(resp http.ResponseWriter, req *http.Request
drainRequest
.
DrainSpec
=
&
api
.
DrainSpec
{
Deadline
:
-
1
*
time
.
Second
,
}
}
else
{
// If drain is disabled on an old client, mark the node as eligible for backwards compatibility
drainRequest
.
MarkEligible
=
true
}
}
else
{
if
err
:=
decodeBody
(
req
,
&
drainRequest
);
err
!=
nil
{
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
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