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

get/delete/drain support for non-eksctl created managed nodegroups #2911

Merged
merged 41 commits into from Dec 16, 2020

Conversation

aclevername
Copy link
Contributor

@aclevername aclevername commented Dec 8, 2020

Description

Adds support for get/delete/drain nodegroups not created by eksctl. Managed nodegroups now have a property Unowned (I hate this word, open to suggestions)

#2809

Discussion

  • I've moved some logic into pkg/ctl/cmdutils/nodegroup.go, I'm not sure where it should live, open to suggestions.

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
  • Added labels for change area (e.g. area/nodegroup), target version (e.g. version/0.12.0) and kind (e.g. kind/improvement)
  • Make sure the title of the PR is a good description that can go into the release notes

@aclevername aclevername changed the title Get non eksctl nodegroups get/delete/drain support for non-eksctl created managed nodegroups Dec 8, 2020
@aclevername aclevername added area/managed-nodegroup EKS Managed Nodegroups kind/feature New feature or request labels Dec 10, 2020
@@ -265,6 +267,8 @@ const (
NodeGroupTypeManaged NodeGroupType = "managed"
// NodeGroupTypeUnmanaged defines an unmanaged nodegroup
NodeGroupTypeUnmanaged NodeGroupType = "unmanaged"
// NodeGroupTypeUnowned defines an unowned nodegroup
NodeGroupTypeUnowned NodeGroupType = "unowned"
Copy link
Contributor

Choose a reason for hiding this comment

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

this is always also managed, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes @michaelbeaumont . I was tempted to call it NodeGroupTypeManagedUnowned but it felt like too much 😂

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe use the comment to elaborate?

Copy link
Contributor

Choose a reason for hiding this comment

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

i was just thinking it might be unclear (at first glance) to users if they see Unowned whether it's managed or unmanaged.

pkg/ctl/cmdutils/filter/nodegroup_filter.go Outdated Show resolved Hide resolved
Copy link
Contributor

@Callisto13 Callisto13 left a comment

Choose a reason for hiding this comment

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

I think the Unowned abstraction you chose is fine, no alternative is jumping out at me right now.

I've moved some logic into pkg/ctl/cmdutils/nodegroup.go, I'm not sure where it should live, open to suggestions.

Based on where that function is being used, and based on how things are currently organised in that area, it makes sense for now. Maybe as we tidy up more we will see more clearly 🤷‍♀️ . I am generally not a fan of that cmdutils package, it's become a bit of a dumping ground for stuff which doesn't really belong anywhere else.

@aclevername
Copy link
Contributor Author

I think the Unowned abstraction you chose is fine, no alternative is jumping out at me right now.

👌

Based on where that function is being used, and based on how things are currently organised in that area, it makes sense for now. Maybe as we tidy up more we will see more clearly 🤷‍♀️ . I am generally not a fan of that cmdutils package, it's become a bit of a dumping ground for stuff which doesn't really belong anywhere else.

Yeah I agree, also the cmdutils/filter does a lot of logic now. Feel like the filtering could be moved to somewhere else down the line

@Callisto13
Copy link
Contributor

TEESSSTTSSSSS

@aclevername
Copy link
Contributor Author

TEESSSTTSSSSS

I do want to add tests, but because this interacts with manager I end up being 2-3 stacks deep testing the manager package instead 😢

@Callisto13
Copy link
Contributor

😭

@aclevername aclevername merged commit 503dfa8 into master Dec 16, 2020
@aclevername aclevername deleted the get-non-eksctl-nodes branch December 16, 2020 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/managed-nodegroup EKS Managed Nodegroups kind/feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants