Skip to content

Commit

Permalink
fix: create and update domain failure
Browse files Browse the repository at this point in the history
Signed-off-by: 张启航 <[email protected]>
  • Loading branch information
ZhangSetSail committed Nov 19, 2024
1 parent 49828a5 commit 2ddcafc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/controller/apigateway/api_gateway_route.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ func (g Struct) CreateHTTPAPIRoute(w http.ResponseWriter, r *http.Request) {

routeName = strings.ReplaceAll(routeName, "/", "p-p")
routeName = strings.ReplaceAll(routeName, "*", "s-s")
name := r.URL.Query().Get("name")

for _, host := range apisixRouteHTTP.Match.Hosts {
labels[host] = "host"
Expand All @@ -212,8 +213,7 @@ func (g Struct) CreateHTTPAPIRoute(w http.ResponseWriter, r *http.Request) {
httputil.ReturnBcodeError(r, w, bcode.ErrRouteNotFound)
return
}
logrus.Infof("?????????????????%v, -------%v,,,,,,,,,%v", len(roueList.Items), roueList.Items[0].Name, routeName)
if roueList != nil && len(roueList.Items) > 0 && roueList.Items[0].Name != routeName {
if roueList != nil && len(roueList.Items) > 0 && roueList.Items[0].Name != name {
logrus.Errorf("list check route failure: %v", err)
httputil.ReturnBcodeError(r, w, bcode.ErrRouteExist)
return
Expand Down

0 comments on commit 2ddcafc

Please sign in to comment.