Port OCI failed-create deletion fallback from upstream PR #9703 to 1.33.4 tag branch#3
Draft
cici709394 with Copilot wants to merge 1 commit into
Draft
Port OCI failed-create deletion fallback from upstream PR #9703 to 1.33.4 tag branch#3cici709394 with Copilot wants to merge 1 commit into
cici709394 with Copilot wants to merge 1 commit into
Conversation
Copilot
AI
changed the title
[WIP] Port upstream commit eb6b7f5 to fork from tag cluster-autoscaler-1.33.4
Port OCI failed-create deletion fallback from upstream PR #9703 to 1.33.4 tag branch
Jun 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This ports upstream commit
eb6b7f5into thecluster-autoscaler-1.33.4code shape (which still has inlineDeleteNodeslogic), preserving fork-specific mutex/size/min-size behavior. The change ensures failed-create placeholder nodes with noInstanceIDare handled by decreasing nodepool target size instead of attempting instance deletion.OCI
DeleteNodesbehavior update (oci_node_pool.go)GetNodePoolSize, logging, and min-size guard.InstanceIDbeforeBelongs.FakeNodeReasonAnnotation == FakeNodeCreateError) as non-deletable-by-instance and counts them for fallback handling.DecreaseTargetSize(-count)after deletion path.Test/mocks adaptation for tag-era OCI tests (
oci_node_pool_test.go)mockManagermethods to pointer receivers so stateful assertions persist.mockManagerwith size/set-size/delete-call/cache-refresh tracking and compute-size support used byDecreaseTargetSize.SetNodePoolSize,GetExistingNodePoolSizeViaCompute,InvalidateAndRefreshCache, taint method).TestDeletePastMinSizeto force min-size path with explicit mock size.TestDeleteCreateErrorNodeWithoutInstanceIDDecreasesTargetSizeto assert:DeleteInstancescall for no-instance-id create-error node,SetNodePoolSize.Original prompt
Goal
Port the single commit from upstream pull request kubernetes#9703 onto this fork, starting from the tag
cluster-autoscaler-1.33.4, and publish the result as a brand-new branch named exactly:goto-opensource/autoscalereb6b7f5d0d1a05ee083301a21fb8ce9a962a326f— "Handle failed node creations without instance IDs by decreasing nodepool target size instead of calling delete."cluster-autoscaler-1.33.4is a git tag, not a branch. Your session may start checked out on the default branch (master), whose OCI code has already been refactored and will NOT match the snippets below. Before doing anything else, create and switch to the target branch from the tag:git fetch --tags --force git checkout -b cluster-autoscaler-goto-1.33.4-pr-9703 cluster-autoscaler-1.33.4 git log -1 # should show commit c1f0b00eab535b09cb976d8d1fad1918e2be787dAll file references below are relative to the tag's tree. When you finish, push this branch (
cluster-autoscaler-goto-1.33.4-pr-9703) so it points at the tag commit plus your single new commit. Do NOT open a pull request.git cherry-pickUpstream
masterrefactored the OCI nodepool delete logic into a private helperdeleteNodes(lowercase) called by a publicDeleteNodeswrapper, and PR kubernetes#9703 is written against that lowercase helper. Thecluster-autoscaler-1.33.4tag does not have that refactor — the delete logic is all inline inside the publicDeleteNodesmethod (uppercase). A rawgit cherry-pick eb6b7f5dwill therefore fail. Port the change by hand into the existing inlineDeleteNodesmethod, preserving the fork-specific top-of-function logic (nodePoolDeleteMutexlock,GetNodePoolSizecall,klog.Infoflogging, and the min-size guard). Do NOT introduce a new lowercasedeleteNodeshelper.File 1 —
cluster-autoscaler/cloudprovider/oci/nodepools/oci_node_pool.goOn the tag,
DeleteNodescurrently looks like this:Replace it with this adapted version. It folds in the upstream fix while keeping the fork's mutex/size/min-size preamble, and reorders the per-node logic so the empty-
InstanceIDcheck happens BEFOREBelongs(required — a failed-create placeholder node has no instance id, and callingBelongs/GetNodePoolForInstanceon it would error):