kops icon indicating copy to clipboard operation
kops copied to clipboard

Fix HasHighlyAvailableControlPlane to use AllInstanceGroups

Open pkubicsek-sb opened this issue 1 month ago • 5 comments

What this PR does / why we need it:

Fixes a bug where HasHighlyAvailableControlPlane() incorrectly uses the filtered InstanceGroups list instead of AllInstanceGroups. This causes cluster-wide controllers (aws-load-balancer-controller, node-termination-handler, etc.) to incorrectly downscale from 2 to 1 replica when running kops update cluster with --instance-group or --instance-group-roles filters on HA clusters.

The fix changes the function to use AllInstanceGroups since HA status is a cluster-wide property that should not depend on instance group filtering.

Which issue(s) this PR fixes: Fixes #17739

Special notes for your reviewer:

  • Added unit tests including a regression test for the filtered instance groups scenario
  • The bug only manifests when using --instance-group or --instance-group-roles flags
  • Change is minimal: single line change in template_functions.go:502

pkubicsek-sb avatar Nov 03 '25 18:11 pkubicsek-sb

CLA Signed

The committers listed above are authorized under a signed CLA.

  • :white_check_mark: login: pkubicsek-sb / name: Peter Kubicsek (e6786c2ee0da168d5890682a743815bca0c323e8)

Welcome @pkubicsek-sb!

It looks like this is your first PR to kubernetes/kops 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/kops has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. :smiley:

k8s-ci-robot avatar Nov 03 '25 18:11 k8s-ci-robot

Hi @pkubicsek-sb. Thanks for your PR.

I'm waiting for a github.com member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

k8s-ci-robot avatar Nov 03 '25 18:11 k8s-ci-robot

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Once this PR has been reviewed and has the lgtm label, please assign rifelpet for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

k8s-ci-robot avatar Nov 03 '25 18:11 k8s-ci-robot

Thanks for looking into this @pkubicsek-sb. /cc @justinsb /ok-to-test

hakman avatar Nov 04 '25 16:11 hakman