Skip to content

Commit f01c627

Browse files
fix(configure-module): skip HTTP route host check (#161)
Ignore the HTTP route conflict on host name during clone and restore procedures. Refs NethServer/dev#7684
1 parent 8b48eb0 commit f01c627

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

imageroot/actions/configure-module/12validate-webtop-domain

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ host = data.get("hostname")
2323
# do not test if it is the same host
2424
oldHost = os.environ.get('WEBTOP_HOSTNAME','')
2525

26+
# Skip validation during restore and clone:
27+
if oldHost == '' and os.getenv('AGENT_TASK_USER') == os.getenv('AGENT_ID'):
28+
sys.exit(0)
29+
30+
# Fail if hostname is used by other apps:
2631
if host != oldHost and agent.http_route_in_use(domain=host):
2732
agent.set_status('validation-failed')
2833
json.dump([{'field':'hostname','parameter':'hostname','value':host,'error':'domain_already_used_in_traefik'}],fp=sys.stdout)

0 commit comments

Comments
 (0)