Fix tentacle hostname resolution on non-domain-joined machines#1207
Merged
Fix tentacle hostname resolution on non-domain-joined machines#1207
Conversation
hnrkndrssn
reviewed
Apr 8, 2026
| { | ||
| $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. |
Contributor
There was a problem hiding this comment.
Do we also need to make sure the Linux equivalent script functions correctly?
Currently it executes hostname --fqdn to get the FQDN host name.
Contributor
Author
There was a problem hiding this comment.
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).
hnrkndrssn
approved these changes
Apr 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background
A customer running the Windows Tentacle container in ECS on EC2 reported that their Tentacle was being registered in
Octopus with an invalid URL. They had configured
PublicHostNameConfiguration=FQDNso the container would registerusing its internal EC2 DNS hostname (e.g.
ip-xxx-xx-x-x.ec2.internal). This seems to be the right configuration when the Octopus server and the ECS task are in the same VPC, so should be supported.Fixes HPY-1292
Results
The
configure-tentacle.ps1script constructs the FQDN by concatenatingDNSHostNameandDomain. On a domain-joined machine this is correct (DNSHostNameis the short name andDomainis the DNS suffix). However, on a non-domain-joined machine like an EC2 instance,DNSHostNameis already fully qualified andDomainis empty.This PR adds a conditional to check if
DNSHostNamealready contains a dot orDomainis empty before attempting to join them.How to review this PR
Quality ✔️
Pre-requisites