Skip to content

[occm]: fix openstack getServerByName return error code#3083

Open
tyiying wants to merge 1 commit intokubernetes:masterfrom
tyiying:fix-openstack-getServerByName-error-code
Open

[occm]: fix openstack getServerByName return error code#3083
tyiying wants to merge 1 commit intokubernetes:masterfrom
tyiying:fix-openstack-getServerByName-error-code

Conversation

@tyiying
Copy link

@tyiying tyiying commented Mar 13, 2026

Additional notes:

What this PR does / why we need it:
after upgraded occm version from v1.29 to v1.32, we found occm cannot delete node from k8s node list anymore after we remove the node from openstack

Which issue this PR fixes(if applicable):
fixes #2999 - we have fixed this issue in our product using nokia repo, but would like to fix it in the upstream.

Special notes for reviewers:
After delete the node from openstack, we expect occm delete the node from k8s node list. But we still see the node in the node list:
[cloud-admin@hotel-ncs03-control-01 ~]$ sudo kubectl get node
Enter login password:
NAME STATUS ROLES AGE VERSION
hotel-ncs03-control-01 Ready 44h v1.32.8
hotel-ncs03-control-02 Ready 44h v1.32.8
hotel-ncs03-control-03 Ready 44h v1.32.8
hotel-ncs03-edge-01 Ready 44h v1.32.8
hotel-ncs03-edge-02 Ready 44h v1.32.8
hotel-ncs03-storage-01 NotReady 44h v1.32.8 <= this should be gone
hotel-ncs03-storage-02 Ready 44h v1.32.8
hotel-ncs03-storage-03 Ready 44h v1.32.8
hotel-ncs03-worker-01 Ready 44h v1.32.8
hotel-ncs03-worker-02 Ready 44h v1.32.8
[cloud-admin@hotel-ncs03-control-01 ~]$

Here are the logs we see:
E0922 11:38:01.217813 1 node_lifecycle_controller.go:156] error checking if node hotel-ncs03-storage-01 exists: failed to find object

I did a code comparison between 1.29 and 1.32, I can see the return code from getInstance() function was causing the different behavior:
The return code is expected to be cloudprovider.InstanceNotFound for both ccm 1.29 and ccm 1.32
// InstanceExists indicates whether a given node exists according to the cloud provider
func (i *InstancesV2) InstanceExists(ctx context.Context, node *v1.Node) (bool, error) {
_, err := i.getInstance(ctx, node)
if err == cloudprovider.InstanceNotFound {
klog.V(6).Infof("instance not found for node: %s", node.Name)
return false, nil
}

Release note:

NONE

@k8s-ci-robot k8s-ci-robot added the release-note-none Denotes a PR that doesn't merit a release note. label Mar 13, 2026
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Mar 13, 2026

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: tyiying / name: Yi-Ying Tan (9708d19)

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Mar 13, 2026
@k8s-ci-robot k8s-ci-robot requested a review from anguslees March 13, 2026 14:47
@k8s-ci-robot
Copy link
Contributor

Hi @tyiying. Thanks for your PR.

I'm waiting for a kubernetes 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.

Details

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
Copy link
Contributor

[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 anguslees for approval. For more information see the Code Review Process.

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

Details 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 requested a review from dulek March 13, 2026 14:47
@k8s-ci-robot k8s-ci-robot added cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Mar 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. release-note-none Denotes a PR that doesn't merit a release note. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[occm] Cannot delete node from k8s node list after remove the node from openstack

2 participants