Skip to content

Commit

Permalink
Fix issue when clean subnetport
Browse files Browse the repository at this point in the history
Report error below:
	/root/nsx-operator/cmd_clean/main.go:81 +0xa25
panic: interface conversion: interface {} is *model.VpcSubnetPort, not model.VpcSubnetPort [recovered]
	panic: interface conversion: interface {} is *model.VpcSubnetPort, not model.VpcSubnetPort

Signed-off-by: Xie Zheng <[email protected]>
  • Loading branch information
zhengxiexie committed Feb 1, 2024
1 parent e5cdcd6 commit a988d9a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/nsx/services/subnetport/subnetport.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ func (service *SubnetPortService) Cleanup() error {
subnetPorts := service.SubnetPortStore.List()
log.Info("cleanup subnetports", "count", len(subnetPorts))
for _, subnetPort := range subnetPorts {
subnetPortID := types.UID(*subnetPort.(model.VpcSubnetPort).Id)
subnetPortID := types.UID(*subnetPort.(*model.VpcSubnetPort).Id)
err := service.DeleteSubnetPort(subnetPortID)
if err != nil {
log.Error(err, "cleanup subnetport failed", "subnetPortID", subnetPortID)
Expand Down

0 comments on commit a988d9a

Please sign in to comment.