Skip to content
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 conditions attribute to kubernetes_nodes data source #2612

Merged

Conversation

JaylonmcShan03
Copy link
Contributor

@JaylonmcShan03 JaylonmcShan03 commented Nov 1, 2024

Description

Fixes #2430
This PR introduces a new conditions attribute to the kubernetes_nodes data source, which will provide detailed insights into each node's health and operational status.

Acceptance tests

  • Have you added an acceptance test for the functionality being added?
  • Have you run the acceptance tests on this branch?

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccXXX'
2024-11-01T10:58:55.241-0500 [DEBUG] sdk.helper_resource: Finished TestCase: test_name=TestAccKubernetesDataSourceNodes_basic
--- PASS: TestAccKubernetesDataSourceNodes_basic (1.81s)
PASS
ok      github.com/hashicorp/terraform-provider-kubernetes/kubernetes   2.591s
jaylon.mcshan@jaylon terraform-provider-kubernetes % 
...

Release Note

Release note for CHANGELOG:

...

References

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

@JaylonmcShan03 JaylonmcShan03 requested a review from a team as a code owner November 1, 2024 15:58
@github-actions github-actions bot added the size/M label Nov 1, 2024
Copy link
Member

@alexsomesan alexsomesan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Small question around test coverage, otherwise all good.

@@ -33,6 +33,9 @@ func TestAccKubernetesDataSourceNodes_basic(t *testing.T) {
resource.TestCheckResourceAttrWith(dataSourceName, "nodes.0.status.0.capacity.memory", checkParsableQuantity),
resource.TestCheckResourceAttrSet(dataSourceName, "nodes.0.status.0.node_info.0.architecture"),
resource.TestCheckResourceAttrSet(dataSourceName, "nodes.0.status.0.addresses.0.address"),
resource.TestMatchResourceAttr(dataSourceName, "nodes.0.status.0.conditions.#", oneOrMore),
resource.TestCheckResourceAttrSet(dataSourceName, "nodes.0.status.0.conditions.0.type"),
resource.TestCheckResourceAttrSet(dataSourceName, "nodes.0.status.0.conditions.0.status"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it not feasible to test for all the newly introduced attributes?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can certainly do that! Will update the test, to include the additional attributes 👍

Copy link
Member

@alexsomesan alexsomesan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one, @JaylonmcShan03
🚀

@JaylonmcShan03 JaylonmcShan03 merged commit 488c591 into main Nov 14, 2024
21 of 23 checks passed
@JaylonmcShan03 JaylonmcShan03 deleted the add-node-conditions-to-kubernetes-nodes-data-source branch November 14, 2024 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Include conditions in nodes data source
2 participants