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

fix: don't crash when vmss not present or has no nodes #7708

Merged

Conversation

comtalyst
Copy link
Contributor

What type of PR is this?

/kind bug

What this PR does / why we need it:

Clone of #6672 with an additional fix on printing format.

Testing

  • One unit test in azure_manager_test.go that acts as an acceptance test.
  • One e2e test (in-progress)

What this PR does / why we need it:

We currently crash CAS if there are no nodes or if VMSS (Azure NodeGroup implementation) is not present. Ideally, we'd like to avoid crashing in most situations and instead log.

Main problem was in BuildAzure (call path shown below):

Main updates include:

  • updating Nodes() to not error if there are zero nodes, but rather log and return an empty list of instances
  • updated GetOptions() to not error
  • updated regenerate to handle instances == nil

Key exceptions found:

  • TemplateNodeInfo() errors are handled by the core code. Typically, if the node group is not found, core logs a warning and skips the node group. The only exception is for GetNodeFromTemplate(). If TemplateNodeInfo() returns an error, this case is not handled since it's required to spin up a new node.
  • GetOptions() should not error, because if options are nil, we just use default options. GCE + AWS both return nil error here.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Should be identical to #6672 but with #6672 (comment)

Does this PR introduce a user-facing change?

Yes

- Azure: fixed an issue where CAS crashes when VMSS is not present or has no nodes

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. area/cluster-autoscaler labels Jan 16, 2025
@k8s-ci-robot k8s-ci-robot added area/provider/azure Issues or PRs related to azure provider approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jan 16, 2025
@comtalyst
Copy link
Contributor Author

/hold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 16, 2025
@tallaxes
Copy link
Contributor

/lgtm
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: comtalyst, tallaxes

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 16, 2025
@comtalyst
Copy link
Contributor Author

/unhold
tests passing

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 16, 2025
@comtalyst
Copy link
Contributor Author

/cherry-pick cluster-autoscaler-release-1.32
/cherry-pick cluster-autoscaler-release-1.31
/cherry-pick cluster-autoscaler-release-1.30
/cherry-pick cluster-autoscaler-release-1.29
/cherry-pick cluster-autoscaler-release-1.28

@k8s-infra-cherrypick-robot

@comtalyst: once the present PR merges, I will cherry-pick it on top of cluster-autoscaler-release-1.28, cluster-autoscaler-release-1.29, cluster-autoscaler-release-1.30, cluster-autoscaler-release-1.31, cluster-autoscaler-release-1.32 in new PRs and assign them to you.

In response to this:

/cherry-pick cluster-autoscaler-release-1.32
/cherry-pick cluster-autoscaler-release-1.31
/cherry-pick cluster-autoscaler-release-1.30
/cherry-pick cluster-autoscaler-release-1.29
/cherry-pick cluster-autoscaler-release-1.28

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 k8s-ci-robot merged commit 31f5616 into kubernetes:master Jan 17, 2025
7 checks passed
@k8s-infra-cherrypick-robot

@comtalyst: new pull request created: #7709

In response to this:

/cherry-pick cluster-autoscaler-release-1.32
/cherry-pick cluster-autoscaler-release-1.31
/cherry-pick cluster-autoscaler-release-1.30
/cherry-pick cluster-autoscaler-release-1.29
/cherry-pick cluster-autoscaler-release-1.28

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-infra-cherrypick-robot

@comtalyst: new pull request created: #7710

In response to this:

/cherry-pick cluster-autoscaler-release-1.32
/cherry-pick cluster-autoscaler-release-1.31
/cherry-pick cluster-autoscaler-release-1.30
/cherry-pick cluster-autoscaler-release-1.29
/cherry-pick cluster-autoscaler-release-1.28

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-infra-cherrypick-robot

@comtalyst: new pull request created: #7711

In response to this:

/cherry-pick cluster-autoscaler-release-1.32
/cherry-pick cluster-autoscaler-release-1.31
/cherry-pick cluster-autoscaler-release-1.30
/cherry-pick cluster-autoscaler-release-1.29
/cherry-pick cluster-autoscaler-release-1.28

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-infra-cherrypick-robot

@comtalyst: new pull request created: #7712

In response to this:

/cherry-pick cluster-autoscaler-release-1.32
/cherry-pick cluster-autoscaler-release-1.31
/cherry-pick cluster-autoscaler-release-1.30
/cherry-pick cluster-autoscaler-release-1.29
/cherry-pick cluster-autoscaler-release-1.28

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-infra-cherrypick-robot

@comtalyst: new pull request created: #7713

In response to this:

/cherry-pick cluster-autoscaler-release-1.32
/cherry-pick cluster-autoscaler-release-1.31
/cherry-pick cluster-autoscaler-release-1.30
/cherry-pick cluster-autoscaler-release-1.29
/cherry-pick cluster-autoscaler-release-1.28

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/cluster-autoscaler area/provider/azure Issues or PRs related to azure provider cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants