-
Notifications
You must be signed in to change notification settings - Fork 969
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
Add data source kubernetes_nodes, resource kubernetes_node_taint #1921
Conversation
a1b2d21
to
4ff2487
Compare
Any chance I can get a review? |
Friendly ping. This has been open for over a month now, any chance I could get a review? |
4ff2487
to
f541820
Compare
We'll have a look at this shortly, we do have this feature on our roadmap. |
f541820
to
d0fb16d
Compare
Description: "List of nodes in a cluster.", | ||
Computed: true, | ||
Elem: &schema.Schema{ | ||
Type: schema.TypeString, |
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.
It would be great to have the entire set of node attributes returned here (status included), instead of just the name. I think that would make the data-source more broadly useful, as well as keeping in line with the rest of the data-sources in the provider.
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 have added:
- all
metadata
fields - all
spec
fields (exceptconfigSource
which is deprecated) - capacity related fields
status.capacity
andstatus.allocatable
- everything in
status.node_info
The remainder of the fields under status seem too verbose and/or ephemeral to be of use for a data source that returns resources in a list. It is my opinion that if more detailed information is needed then a kubernetes_node
data source that retrieves everything for a specific node would make more sense.
@partcyborg I had a look through the changes. I think we can get the nodes datasource in pretty easily if you would be so kind as to add the rest of the attributes. For taints, we would prefer an implementation along the lines of the If you don't have the capacity to redo the taints resource, I'm more than happy to take care of that myself while you would update the schema for the nodes data-source. Let me know how you want to move forward. Thanks! |
@alexsomesan Thank you for the review! You are absolutely correct that the read-modify-update cycle I was using here was not very robust. I discovered this myself as we have started to use this code in production (via our own fork of the provider) and the nodes one of our clusters are being constantly mutated by the CSP, causing all attempts to taint to fail with resource conflicts. To fix this, I changed the implementation to use the Patch API instead. Looking through |
Please let me know if you have any other questions or comments. |
@partcyborg I've had a quick look and the changes for taints look good. I'll keep testing it locally for a bit.
|
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.
Tested this locally - works as expected.
Thanks for contributing, @partcyborg !
* Add new data source kubernetes_all_nodes * Add new resource kubernetes_node_taint
* Rename kubernetes_all_nodes -> kubernetes_nodes * Add support for querying nodes by label
6d3b1ab
to
c0b08a2
Compare
* Add new data source kubernetes_nodes * Add new resource kubernetes_node_taint --------- Co-authored-by: Alex Somesan <alex.somesan@gmail.com>
Description
closes #1932
Acceptance tests
Output from acceptance testing:
Release Note
Release note for CHANGELOG:
References
Community Note