Cleanup NICs when migrate from openstack MCM - #89
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 |
cf02b5c to
d47b553
Compare
55364f4 to
1e553c4
Compare
5b85955 to
17def4f
Compare
| } | ||
|
|
||
| migrated, _ := strconv.ParseBool(req.Machine.Annotations[migratedMachineAnnotation]) | ||
| projectID, serverIDs, err := p.serverIDsForMachine(ctx, req, projectIDFromSecret, providerSpec.Region, migrated) |
There was a problem hiding this comment.
Why does this return multiple serverIDs?
|
|
||
| // Parse ProviderID to extract projectID and serverID | ||
| projectID, serverID, err = parseProviderID(req.Machine.Spec.ProviderID) | ||
| func (p *Provider) serverIDsForMachine(ctx context.Context, req *driver.DeleteMachineRequest, secretProjectID, region string, migrated bool) (projectID string, serverIDs []string, err error) { |
There was a problem hiding this comment.
| func (p *Provider) serverIDsForMachine(ctx context.Context, req *driver.DeleteMachineRequest, secretProjectID, region string, migrated bool) (projectID string, serverIDs []string, err error) { | |
| func (p *Provider) serverIDsForMachine(ctx context.Context, req *driver.DeleteMachineRequest, projectIDFromSecret, region string, migrated bool) (projectID string, serverIDs []string, err error) { |
There was a problem hiding this comment.
Add massive docstring. Explain in detail what this does
| if serverID == "" { | ||
| klog.V(2).Infof("Server is already deleted for machine %q", req.Machine.Name) | ||
| return &driver.DeleteMachineResponse{}, nil | ||
| func (p *Provider) deleteServers(ctx context.Context, projectID, region, machineName string, serverIDs []string) (bool, error) { |
There was a problem hiding this comment.
Why plural? Also you return out of function instantly as soon as you get a 404, what about the other serverIDs?
| // Call STACKIT API to delete server | ||
| err = p.client.DeleteServer(ctx, projectID, providerSpec.Region, serverID) | ||
| func (p *Provider) deleteMachineNICs(ctx context.Context, projectID, region, networkID, machineName string) (bool, error) { | ||
| nics, err := p.client.ListNICs(ctx, projectID, region, networkID) |
|
@aniruddha2000 Please add A LOT of documentation explaining this PR and the individual functions |
How to categorize this PR?
/kind enhancement
/hold
wip
What this PR does / why we need it:
This PR clean up NICs associated with servers when deleting machines.
Special notes for your reviewer:
Breaking changes: