-
Notifications
You must be signed in to change notification settings - Fork 35
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
adding nfd feature rule package and new builder #882
base: main
Are you sure you want to change the base?
Conversation
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.
some minor changes
a0ad42a
to
28d8007
Compare
28d8007
to
8f83e02
Compare
} | ||
|
||
// GetErrorMessage returns builder's error message. | ||
func (builder *NodeFeatureRuleBuilder) GetErrorMessage() string { |
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.
With the way the builders are designed, the error message should get returned when doing operations like creating, updating, or deleting. Is there a reason why you'd need to get the error message outside of that?
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.
could you please address this?
8f83e02
to
dfa898c
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 for addressing the comments! I have a few more minor comments but overall is looking pretty good
|
||
return false, fmt.Errorf("%s builder cannot have nil apiClient", resourceCRD) | ||
} | ||
|
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.
please add a check for errorMsg (example)
// Created Builder object on the cluster. | ||
Object *nfdv1.NodeFeatureRule | ||
// api client to interact with the cluster. | ||
apiClient *clients.Settings |
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.
another thing I missed, but this should be switched to the client from controller-runtime. We accept *clients.Settings
in functions but only store apiClient.Client
in the builder (example)
} | ||
|
||
// GetErrorMessage returns builder's error message. | ||
func (builder *NodeFeatureRuleBuilder) GetErrorMessage() string { |
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.
could you please address this?
func buildTestClientWithNFDRuleScheme() *clients.Settings { | ||
return clients.GetTestClients(clients.TestClientParams{ | ||
SchemeAttachers: nfdRuleTestSchemes, | ||
}) | ||
} | ||
|
||
func buildTestClientWithNFDRuleSchemeOnly() *clients.Settings { | ||
return clients.GetTestClients(clients.TestClientParams{ | ||
SchemeAttachers: nfdRuleTestSchemes, | ||
}) | ||
} |
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.
these could be combined
Co-authored-by: Kirsten Laskoski <[email protected]>
Co-authored-by: Kirsten Laskoski <[email protected]>
Co-authored-by: Kirsten Laskoski <[email protected]>
Co-authored-by: Kirsten Laskoski <[email protected]>
Co-authored-by: Kirsten Laskoski <[email protected]>
Adding new lib,builder,unit tests for nodfeaturerule object