Skip to content

Commit

Permalink
Merge pull request vmware-tanzu#495 from TaoZou1/srpointer
Browse files Browse the repository at this point in the history
Fix bug not using pointer
  • Loading branch information
TaoZou1 authored Jan 22, 2024
2 parents e7fecda + 1349953 commit 5b2b440
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pkg/controllers/staticroute/staticroute_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ func (r *StaticRouteReconciler) GarbageCollector(cancel chan bool, timeout time.

for _, e := range nsxStaticRouteList {
elem := e
UID := r.Service.GetUID(&elem)
UID := r.Service.GetUID(elem)
if UID == nil {
continue
}
Expand Down
6 changes: 3 additions & 3 deletions pkg/nsx/services/staticroute/staticroute.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,11 @@ func (service *StaticRouteService) DeleteStaticRoute(namespace string, uid strin
return service.DeleteStaticRouteByPath(path[2], path[4], *vpc[0].Id, uid)
}

func (service *StaticRouteService) ListStaticRoute() []model.StaticRoutes {
func (service *StaticRouteService) ListStaticRoute() []*model.StaticRoutes {
staticRoutes := service.StaticRouteStore.List()
staticRouteSet := []model.StaticRoutes{}
staticRouteSet := []*model.StaticRoutes{}
for _, staticroute := range staticRoutes {
staticRouteSet = append(staticRouteSet, staticroute.(model.StaticRoutes))
staticRouteSet = append(staticRouteSet, staticroute.(*model.StaticRoutes))
}
return staticRouteSet
}
Expand Down

0 comments on commit 5b2b440

Please sign in to comment.