Skip to content

Commit

Permalink
remote/exporter: Add option to default to fqdn for hostname
Browse files Browse the repository at this point in the history
In distributed setups, the coordinator may point to exporters/places
in different subnets. In order for clients to resolve resources behind
the exporter, they need to know its FQDN instead of just the hostname.

Using an option to change the default avoids conflicts for configs which
rely on the hostname only.

Signed-off-by: Andreas Naumann <[email protected]>
  • Loading branch information
legraps committed Nov 6, 2023
1 parent d08687c commit 803f19f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion labgrid/remote/exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -916,6 +916,13 @@ def main():
default=None,
help='hostname (or IP) published for accessing resources (defaults to the system hostname)'
)
parser.add_argument(
'-f',
'--fqdn',
action='store_true',
default=False,
help='Use fully qualified domain name as default for hostname'
)
parser.add_argument(
'-d',
'--debug',
Expand Down Expand Up @@ -943,7 +950,7 @@ def main():

extra = {
'name': args.name or gethostname(),
'hostname': args.hostname or gethostname(),
'hostname': args.hostname or getfqdn() if args.fqdn else gethostname(),
'resources': args.resources,
'isolated': args.isolated
}
Expand Down

0 comments on commit 803f19f

Please sign in to comment.