Skip to content

Commit

Permalink
fix: create route failure (#2077)
Browse files Browse the repository at this point in the history
Signed-off-by: 张启航 <[email protected]>
  • Loading branch information
ZhangSetSail authored Nov 21, 2024
1 parent f7469f7 commit 848c9d5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion api/controller/apigateway/api_gateway_route.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,8 @@ func (g Struct) CreateHTTPAPIRoute(w http.ResponseWriter, r *http.Request) {
}, v1.CreateOptions{})
if err == nil {
name := r.URL.Query().Get("name")
name = name[1:]
if name != "" {
name = name[1:]
err = c.ApisixRoutes(tenant.Namespace).Delete(r.Context(), name, v1.DeleteOptions{})
if err != nil {
logrus.Errorf("delete route %v failure: %v", name, err)
Expand Down
2 changes: 1 addition & 1 deletion builder/sources/registry/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ func newFromTransport(registryURL, username, password string, transport http.Rou
}

if err := registry.Ping(); err != nil {
if errors.Is(err, ErrRegistryNotFound) && !containsScheme {
if err != nil {
// try again with http url
registry.URL = strings.Replace(url, "https", "http", 1)
if err := registry.Ping(); err != nil {
Expand Down

0 comments on commit 848c9d5

Please sign in to comment.