File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -171,12 +171,18 @@ func (p *Provider) DeleteMachine(ctx context.Context, req *driver.DeleteMachineR
171171 return nil , status .Error (codes .Internal , err .Error ())
172172 }
173173
174+ if req .Machine .Spec .ProviderID == "" {
175+ klog .Infof ("machine has no provider id attached anymore, already deleted and therefore skipping deletion" )
176+ return & driver.DeleteMachineResponse {}, nil
177+ }
178+
174179 id := decodeMachineID (req .Machine .Spec .ProviderID )
175180
176181 mfr := & models.V1MachineFindRequest {
177182 ID : id ,
178183 AllocationProject : providerSpec .Project ,
179184 Tags : []string {fmt .Sprintf ("%s=%s" , tag .ClusterID , clusterIDTag )},
185+ AllocationRole : models .V1MachineAllocationRoleMachine ,
180186 }
181187
182188 resp , err := m .Machine ().FindMachines (machine .NewFindMachinesParams ().WithBody (mfr ), nil )
You can’t perform that action at this time.
0 commit comments