-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support excluding nodes when creating workloads #365
Conversation
cluster/calcium/create.go
Outdated
return nodenames, nil | ||
} | ||
|
||
allNodes, err := c.ListPodNodes(context.Background(), podname, map[string]string{}, false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ctx ! 不要用 background,另外这个函数为啥在这里,不应该在 helper 么
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
为了用这个 ListPodNodes
啦
cluster/calcium/create.go
Outdated
for _, n := range allNodes { | ||
if _, ok := excludes[n.Name]; ok { | ||
continue | ||
} | ||
rv = append(rv, n.Name) | ||
} | ||
return rv, nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我觉得你这样不如直接改 withNodeLocks 了
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我其实甚至觉得 withNodeLocks
都不应该有 podname ... 为了保持一致就改这里了
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
那你不如抽出整个 node 筛选的函数,包括 pod,all,黑名单白名单,withNodeLocks 就当纯粹的锁……现在就很分裂
updated |
rpc/gen/core.proto
Outdated
@@ -452,6 +452,7 @@ message DeployOptions { | |||
repeated string after_create = 22; | |||
bytes raw_args = 23; | |||
ResourceOptions resource_opts = 24; | |||
repeated string excluded_nodenames = 25; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
似乎可以通用化一点, 引入一个类型 NodeFilter, 以后好扩展
我就想偷个懒你们... 好吧 |
因为我们发现你想偷懒了……
…On Fri, Mar 19, 2021 at 4:44 PM tonic ***@***.***> wrote:
我就想偷个懒你们... 好吧
—
You are receiving this because your review was requested.
Reply to this email directly, view it on GitHub
<#365 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAD3S2DMZ3UVTW2I6DKHHSTTEMFGDANCNFSM4ZN6VZMQ>
.
--
- CMGS
|
这得问你自己啊,这不是你定的规矩么…
tonic ***@***.***>于2021年3月21日 周日12:21写道:
***@***.**** commented on this pull request.
------------------------------
In rpc/transform.go
<#365 (comment)>:
> @@ -280,6 +280,17 @@ func toCoreDeployOptions(d *pb.DeployOptions) (*types.DeployOptions, error) {
return nil, err
}
+ // FIXME: adapt ... clean this later
+ nf := types.NodeFilter{
+ Podname: d.Podname,
+ Includes: d.Nodenames,
+ Labels: d.Nodelabels,
+ }
+ if d.NodeFilter != nil {
+ nf.Includes = d.NodeFilter.Includes
+ nf.Excludes = d.NodeFilter.Excludes
+ }
+
我总觉得应该可以直接用 core.pb.go 的东西的, 为啥还要包一层来着 = =?
—
You are receiving this because your review was requested.
Reply to this email directly, view it on GitHub
<#365 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAD3S2HW4OILFPOOXKPIHZLTEVX6JANCNFSM4ZN6VZMQ>
.
--
- CMGS
|
updated, 有空看看吧 @CMGS @jschwinger23 |
types/options.go
Outdated
@@ -22,7 +23,7 @@ type DeployOptions struct { | |||
Debug bool // debug mode, use syslog as log driver | |||
OpenStdin bool // OpenStdin for workload | |||
Labels map[string]string // Labels for workloads | |||
NodeLabels map[string]string // NodeLabels for filter node | |||
NodeLabels map[string]string // NodeLabels for filter node, DEPRECATED, use NodeFilter instead |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't care about the compatibility, can remove it!
No description provided.