Skip to content

Fix tentacle hostname resolution on non-domain-joined machines#1207

Merged
wlthomson merged 1 commit intomainfrom
wlthomson/fix-url-registration-for-ecs-tentacle
Apr 9, 2026
Merged

Fix tentacle hostname resolution on non-domain-joined machines#1207
wlthomson merged 1 commit intomainfrom
wlthomson/fix-url-registration-for-ecs-tentacle

Conversation

@wlthomson
Copy link
Copy Markdown
Contributor

@wlthomson wlthomson commented Apr 8, 2026

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=FQDN so the container would register
using 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.ps1 script constructs the FQDN by concatenating DNSHostName and Domain. On a domain-joined machine this is correct (DNSHostName is the short name and Domain is the DNS suffix). However, on a non-domain-joined machine like an EC2 instance, DNSHostName is already fully qualified and Domain is empty.

This PR adds a conditional to check if DNSHostName already contains a dot or Domain is empty before attempting to join them.

How to review this PR

  • Main risk here is regressions. The conditional is intentionally restrictive to reduce the risk of changing desired existing behaviour, but the risk is still there.

Quality ✔️

  • Unit testing this area is difficult, and adding an integration test for this use-case feels a bit disproportionate.
  • If there are concerns, I can do some manual testing against a real EC2 instance (but again, time cost is high vs. the value of this change).

Pre-requisites

  • I have read How we use GitHub Issues for help deciding when and where it's appropriate to make an issue.
  • I have considered informing or consulting the right people, according to the ownership map.
  • I have considered appropriate testing for my change.

@wlthomson wlthomson requested a review from a team as a code owner April 8, 2026 03:49
@wlthomson wlthomson requested a review from a team April 8, 2026 04:38
{
$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).

@wlthomson wlthomson merged commit b9dd6ed into main Apr 9, 2026
51 checks passed
@wlthomson wlthomson deleted the wlthomson/fix-url-registration-for-ecs-tentacle branch April 9, 2026 02:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants