Skip to content

Commit

Permalink
fix: target service error
Browse files Browse the repository at this point in the history
Signed-off-by: 逆流而上 <[email protected]>
  • Loading branch information
DokiDoki1103 committed Mar 12, 2024
1 parent 98f4d1c commit 207c8e2
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions worker/appm/conversion/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,14 @@ func updateAPISixRoute(as *v1.AppService) error {
backends = append(backends, backend)
}
}
apisixroute.Spec.HTTP[0].Backends = backends //重新定义的后端地址
_, err2 := otherclient.GetAPISixClient().ApisixV2().ApisixRoutes(as.GetNamespace()).Update(context.Background(), &apisixroute, metav1.UpdateOptions{})

get, err := otherclient.GetAPISixClient().ApisixV2().ApisixRoutes(as.GetNamespace()).Get(context.Background(), apisixroute.Name, metav1.GetOptions{})
if err != nil {
logrus.Errorf("get apisix route error: %v", err)
continue
}
get.Spec.HTTP[0].Backends = backends //重新定义的后端地址
_, err2 := otherclient.GetAPISixClient().ApisixV2().ApisixRoutes(as.GetNamespace()).Update(context.Background(), get, metav1.UpdateOptions{})
if err2 != nil {
logrus.Errorf("update apisix route error: %v", err)
continue
Expand Down

0 comments on commit 207c8e2

Please sign in to comment.