Skip to content

Commit

Permalink
redis2yml. Fix migration of builtin config
Browse files Browse the repository at this point in the history
Middleware "ApiServerMw1" does not exist since commit 33eabf6

Avoid skip removal of other builtin configs if one of them is not found.
  • Loading branch information
DavidePrincipi committed Sep 12, 2023
1 parent 2ab883b commit 94b3968
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions imageroot/bin/redis2yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,20 +82,17 @@ for r in routers:
if "tls" in routers[r] and (not routers[r]["tls"]["certresolver"] and not routers[r]["tls"]["domains"]):
routers[r]["tls"] = {}

# Remove well-known configs
try:
middlewares.pop('http2https-redirectscheme')
middlewares.pop('ApisEndpointMw0')
middlewares.pop('ApisEndpointMw1')
middlewares.pop('ApiServerMw1')
middlewares.pop('ApiServerMw2')
middlewares.pop('ApiServer-stripprefix')
routers.pop('ApisEndpointHttp')
routers.pop('ApiServer-https')
routers.pop('ApiServer-http')
services.pop('ApiServer')
except:
pass
# Remove well-known configs
middlewares.pop('http2https-redirectscheme', None)
middlewares.pop('ApisEndpointMw0', None)
middlewares.pop('ApisEndpointMw1', None)
middlewares.pop('ApiServerMw1', None)
middlewares.pop('ApiServerMw2', None)
middlewares.pop('ApiServer-stripprefix', None)
routers.pop('ApisEndpointHttp', None)
routers.pop('ApiServer-https', None)
routers.pop('ApiServer-http', None)
services.pop('ApiServer', None)

mroutes = rdb.smembers(f'module/{instance}/user_created_routes')
os.makedirs("manual_flags", exist_ok=True)
Expand Down

0 comments on commit 94b3968

Please sign in to comment.