Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion docker/windows/Scripts/configure-tentacle.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,14 @@ function Get-PublicHostName
elseif ($publicHostNameConfiguration -eq "FQDN")
{
$computer = Get-CimInstance win32_computersystem
$publicHostName = "$($computer.DNSHostName).$($computer.Domain)"
# On domain-joined machines, DNSHostName is the short name and Domain is the DNS suffix.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we also need to make sure the Linux equivalent script functions correctly?

Currently it executes hostname --fqdn to get the FQDN host name.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From my understanding, linux should be fine as hostname returns the complete FQDN. This problem arises from having to manually construct it on Windows from concatenation of two separate fields (from Win32_ComputerSystem).

# On non-domain-joined machines (e.g. EC2), DNSHostName is already fully qualified and
# Domain is empty or a non-DNS workgroup name, so use DNSHostName as-is.
if ($computer.DNSHostName.Contains('.') -or [string]::IsNullOrEmpty($computer.Domain)) {
$publicHostName = $computer.DNSHostName
} else {
$publicHostName = "$($computer.DNSHostName).$($computer.Domain)"
}
}
elseif ($publicHostNameConfiguration -eq "ComputerName")
{
Expand Down