-
Notifications
You must be signed in to change notification settings - Fork 247
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
Advertise TopologyManger policy and scope as Attributes in NRT api v1alpha2 #1054
Advertise TopologyManger policy and scope as Attributes in NRT api v1alpha2 #1054
Conversation
✅ Deploy Preview for kubernetes-sigs-nfd ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
Hi @PiotrProkop. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
I'll add unit tests for this tomorrow. @ffromani @swatisehgal please review. |
/ok-to-test |
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.
thanks for the quick PR! looks straightforward, suggest possible improvements inside.
@@ -63,3 +70,16 @@ func detectPolicyContainerScope(policy string) v1alpha2.TopologyManagerPolicy { | |||
return v1alpha2.None | |||
} | |||
} | |||
|
|||
func DetectTopologyAttributes(policy string, scope string) v1alpha2.AttributeList { |
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.
codewise this is fine, but in the near future I'd love to deprecate pkg/topologypolicy
and adding code here goes against this direction. So I'd move this code in pkg/nfd-topology-updater
(possibly in nfd-topolog-updater.go
) as private function.
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.
will do.
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.
Thanks! if you move, please also rename this function! The code is just fine, but it is not detecting, rather constructing/creating
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.
moved and changed, and got rid of AttributeName
type alias which was unused :)
/cc |
3c38cec
to
04095cc
Compare
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.
looks fine. I'd like to see some form of test coverage (probably integration/e2e) before LGTM
tmScope string | ||
} | ||
|
||
func newStaticNodeInfo(policy, scope string) *staticNodeInfo { |
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.
nit/nonblocking: I'd just return a struct (not a pointer to a struct) and trust the compiler.
In general, returning pointers may allow faster copying of objects (but it should actually be measured) but also contributes to the GC pressure (which, OTOH, should also be measured).
What I'm trying to say is that returning pointers is not necessarily the faster option,
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.
note: I'd NOT resubmit just for this.
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.
I want to add tests, so I'll change it when I submit them.
04095cc
to
e621e13
Compare
Signed-off-by: pprokop <[email protected]>
…vertise as Attributes Signed-off-by: pprokop <[email protected]>
e621e13
to
94468d8
Compare
@ffromani I had to change the way how we load Kubelet config when read from file to make e2e test working, previously we were just reading config from file and unamarshalling it to struct. This approach didn't fill out default values but were skipping it based on |
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.
/lgtm
very nice work @PiotrProkop !
LGTM label has been added. Git tree hash: cf5ca6af5a40979ec18eeb7c6c25c66044a32135
|
/assign @marquiz for final approval |
Thanks @PiotrProkop for the PR. I'll check this next week |
…alues Signed-off-by: PiotrProkop <[email protected]>
94468d8
to
f76fc5b
Compare
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.
Thanks @PiotrProkop, looks good to me now
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: marquiz, PiotrProkop The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@ffromani can you LGTM once more? I had to fix a small nit. |
/lgtm |
LGTM label has been added. Git tree hash: 53ec60386c31adafa4e240cd9c1ffeaa60a3a18f
|
We want to advertise TopologyManager policy and scope as top level attributes in noderesourcetopology-api
v1alpha2
.Based on this PR kubernetes-sigs/scheduler-plugins#488.