Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
d542196 to
cf02b5c
Compare
|
Our project currently lacks enough active contributors to adequately respond to all PRs.
You can:
/lifecycle stale |
|
Our project currently lacks enough active contributors to adequately respond to all PRs.
You can:
/lifecycle rotten |
|
Our project currently lacks enough active contributors to adequately respond to all PRs.
You can:
/close |
|
@stackit-ske: Closed this PR. DetailsIn 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-sigs/prow repository. |
|
/reopen |
|
@dergeberl: Reopened this PR. DetailsIn 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-sigs/prow repository. |
|
/remove-lifecycle rotten |
|
Our project currently lacks enough active contributors to adequately respond to all PRs.
You can:
/lifecycle stale |
|
/remove-lifecycle stale |
5b85955 to
17def4f
Compare
|
@aniruddha2000 Please add A LOT of documentation explaining this PR and the individual functions |
stackit-ske-bot
left a comment
There was a problem hiding this comment.
SKE Code Review
Architectural Feedback
- Server Deletion Synchronization & NIC Attachment Race:
Inpkg/provider/delete.go#L170-L183,WaitUntilServerDeletedis retained but is no longer invoked anywhere in the codebase (previously called afterDeleteServer). As a consequence,p.client.DeleteServerinitiates asynchronous VM termination, butdeleteMachineNICsis called immediately afterwards. In STACKIT IaaS, deleting a NIC while its server is still shutting down / terminating will fail because the network interface remains bound to the active instance. Re-evaluating whetherWaitUntilServerDeletedshould be awaited prior to NIC cleanup prevents race conditions with STACKIT infrastructure during migrated machine teardown. - Simplification of Deletion Control Flow & Dead Code Elimination:
Inpkg/provider/delete.go#L53-L75, bothdeleteServersanddeleteMachineNICsreturn(bool, error). However, both functions return(true, nil)wheneverallErrors == nil. Because the boolean is alwaystrueon success, the conditional returnsif serverAlreadyDeleted && !migratedandif nicAlreadyDeletedensure that lines 72–74 (pkg/provider/delete.go#L72-L74) are completely unreachable. RefactoringdeleteServersanddeleteMachineNICsto return solelyerrorsimplifies the control flow, eliminates misleading variable naming (*AlreadyDeletedvs successful deletion), and allows completion logging to execute as intended. - Defensive Guard on
providerSpec.Networking:
Inpkg/provider/delete.go#L64,providerSpec.Networking.NetworkIDis dereferenced directly. InDeleteMachine,req.Secretis not validated throughValidateProviderSpecNSecret. IfproviderSpec.Networkingisnilor specifiesNICIDsinstead ofNetworkID, this causes a nil pointer dereference or an invalid STACKIT API call with an empty path parameter. Guarding this invocation withif migrated && providerSpec.Networking != nil && providerSpec.Networking.NetworkID != ""ensures safe teardown.
Findings & Feedback
- All findings and concrete recommendations have been provided as inline code suggestions above.
Verdict
Comments with suggestions and architectural feedback.
stackit-ske-bot
left a comment
There was a problem hiding this comment.
SKE Code Review
Findings & Feedback
All findings and concrete recommendations have been provided as inline code suggestions above.
Verdict
Comments provided with inline suggestions for nil-pointer protection, dead code cleanup, error status code wrapping, and robust network ID handling.
How to categorize this PR?
/kind enhancement
/hold
wip
What this PR does / why we need it:
This PR involves migration of machines from OpenStack to STACKIT provider. There are mainly two controller involved in the change:
Creation
The newly created machine is created with STACKIT provider ID (stackit://project-id/server-id), and for the migrated machines with
stackit.cloud/migrated-machine: trueannotaion the creation will not work, to be sure not to mess with half created machines.Delete
While deleting machine it needs to list and delete all ports if a machine with the
stackit.cloud/migrated-machineannotation gets deleted.NOTE: There is a fallback to get the server by name in case there is no providerID during deletion. Normally this is done with a label containing the machine name and a label selector. In case of a migrated machine with the
stackit.cloud/migrated-machineannotation the deletion needs to get all servers and filters internally.Special notes for your reviewer:
Breaking changes: