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

Update command can update multiple nodegroups #3914

Merged
merged 5 commits into from Jul 1, 2021

Conversation

nikimanoledaki
Copy link
Contributor

@nikimanoledaki nikimanoledaki commented Jun 29, 2021

Description

Closes #3857

A config file containing multiple managed nodegroups will iterate over them and update all of them.

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 nikimanoledaki added skip-release-notes Causes PR not to show in release notes technical debt labels Jun 29, 2021
@nikimanoledaki nikimanoledaki marked this pull request as ready for review July 1, 2021 10:50
@nikimanoledaki nikimanoledaki added kind/feature New feature or request and removed skip-release-notes Causes PR not to show in release notes labels Jul 1, 2021
@Callisto13
Copy link
Contributor

Does it make sense to have the integration test update 2 ngs?

@nikimanoledaki
Copy link
Contributor Author

nikimanoledaki commented Jul 1, 2021

Does it make sense to have the integration test update 2 ngs?

@Callisto13 I don't know 🤔 I was looking at other commands that take multiple nodegroups such as create nodegroups and I didn't find an integration test for that. I'm inclined to say no because it would make the tests longer for a very small piece of functionality (essentially a couple of for loops) but also it would be easy to make this change. wdyt?

Edit: tested it locally though with multiple nodegroups that have updateConfig and it worked!

@Callisto13
Copy link
Contributor

yeh I think you are right, no need 👍

if err != nil {
if managed.IsNotFound(err) {
return fmt.Errorf("could not find managed nodegroup with name %q", ng.Name)
for _, ng := range m.cfg.ManagedNodeGroups {
Copy link
Contributor

Choose a reason for hiding this comment

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

LGTM, just one small nit which is more of a personal preference:

can we move the contents of this for into another private func? simply because the process is quite long so it is easy to lose sight that this is all in a loop 🤷‍♀️

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea! I split the contents into updateNodegroup and the strictly updateConfig bit into updateUpdateConfig (I know, cringe)

Copy link
Contributor

Choose a reason for hiding this comment

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

😂 excellent

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update nodegroup command accepts config file with multiple nodegroups
2 participants