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
Properly check condition array length for GKE status before accessing it #11213
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: embik The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Signed-off-by: Marvin Beckers <marvin@kubermatic.com>
/cherry-pick release/v2.21 |
@embik: once the present PR merges, I will cherry-pick it on top of release/v2.21 in a new PR and assign it to you. In response to this:
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/test-infra repository. |
/retest |
1 similar comment
/retest |
/lgtm |
LGTM label has been added. Git tree hash: 738ce1cd6eae6d49a52a4ff996cad9b3d861b9a9
|
@embik: new pull request created: #11215 In response to this:
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/test-infra repository. |
* bump KKP to 48b7e886aed9 * apply: Update tests to kind 0.16 (kubermatic/kubermatic#11133) * apply: Properly check condition array length before accessing it (kubermatic/kubermatic#11213) * apply: Switch AWS account for E2E tests (kubermatic/kubermatic#11211) * apply: Refactor KubeVirt cloud provider - part 1 (kubermatic/kubermatic#11202) * apply: Add Kubernetes 1.25 (kubermatic/kubermatic#11049) * apply: Add feature flag to enable/disable the Web Terminal for the user clusters (kubermatic/kubermatic#11243) * apply: Fix panic in cluster webhook (kubermatic/kubermatic#11236) * apply: Cleanup tests, improve logging (kubermatic/kubermatic#11228) * apply: Configure machine flavor filters at datacenter level (kubermatic/kubermatic#11130) * apply: update KubevirtNodeSpec with topologyConstraint (kubermatic/kubermatic#11114) * update swagger spec / apiclient
What this PR does / why we need it:
Currently, the master-controller-manager is failing in dev with an index out of bounds error for this code. That is not surprising given that the if condition did not properly check if there are at least two conditions before attempting to index the second element.
I don't know if this is the proper fix since I'm not sure how the conditions on these API resources work (if there's only one condition, should it be ignored? is there something specific about the second element condition?), but at least this code should no longer result in an out-of-bounds panic.
Which issue(s) this PR fixes:
Fixes #
What type of PR is this?
/kind bug
Special notes for your reviewer:
Please let @imharshita review this given she knows the context of this code better.
Does this PR introduce a user-facing change? Then add your Release Note here:
Documentation: