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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix setting ownership status when listing clusters #4911

Merged
merged 4 commits into from
Mar 10, 2022

Conversation

cPu1
Copy link
Collaborator

@cPu1 cPu1 commented Mar 7, 2022

Description

Instead of using the clusterName argument, the method was obtaining the cluster name via the spec field.

Fixes #4888

This changelist correctly sets the EKSCTL CREATED column to True for clusters created via eksctl:

NAME					        REGION		EKSCTL CREATED
test-cluster                              	us-west-2	True
test-cluster2                             	us-west-2	True


Checklist

  • Added tests that cover your change (if possible)
  • Added/modified documentation as required (such as the README.md, or the userdocs directory)
  • Manually tested
  • Made sure the title of the PR is a good description that can go into the release notes
  • (Core team) Added labels for change area (e.g. area/nodegroup) and kind (e.g. kind/improvement)

BONUS POINTS checklist: complete for good vibes and maybe prizes?! 馃く

  • Backfilled missing tests for code in same general area 馃帀
  • Refactored something and made the world a better place 馃専

@nikimanoledaki
Copy link
Contributor

Good job getting a fix quickly! :) Could you add unit tests please?

Copy link
Contributor

@aclevername aclevername left a comment

Choose a reason for hiding this comment

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

can we get some unit tests if possible (oops didn't see niki comments), and update the unowned cluster integration test?

@cPu1 cPu1 force-pushed the fix-owned-cluster-status branch 2 times, most recently from 01209e6 to d340dd5 Compare March 8, 2022 10:02

// AssertContainsCluster asserts that the output of the specified command contains the specified cluster
func AssertContainsCluster(cmd runner.Cmd, out GetClusterOutput) {
Expect(cmd).To(runner.RunSuccessfullyWithOutputStringLines(
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Intentionally not using a dot import because runner.Cmd is also being used here.

@cPu1 cPu1 self-assigned this Mar 8, 2022
@Himangini Himangini requested a review from a team March 9, 2022 14:08
@Skarlso Skarlso requested a review from a team March 10, 2022 09:27
@cPu1 cPu1 enabled auto-merge March 10, 2022 15:59
@cPu1 cPu1 merged commit 495ff43 into eksctl-io:main Mar 10, 2022
cPu1 added a commit to cPu1/eksctl that referenced this pull request Mar 11, 2022
PR eksctl-io#4911 fixed a bug where the `clusterName` parameter was not being used when obtaining a cluster's ownership for `get clusters`. The logic for checking owned clusters, however, relied on this behaviour, breaking the check for cluster ownership.
Skarlso added a commit that referenced this pull request Mar 14, 2022
* Fix checking cluster stack for owned clusters

PR #4911 fixed a bug where the `clusterName` parameter was not being used when obtaining a cluster's ownership for `get clusters`. The logic for checking owned clusters, however, relied on this behaviour, breaking the check for cluster ownership.

* Added unit tests

* Apply suggestions from code review

Co-authored-by: Jake Klein <jakelarsj@gmail.com>

* Added error case.

* Fix error import

Co-authored-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>
Co-authored-by: Jake Klein <jakelarsj@gmail.com>
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.

0.83->0.85: eksctl get clusters shows different status for "EKSCTL CREATED"
4 participants