Skip to content

Commit

Permalink
fix: Use OS DNS suffix when DNS suffix set in MEBx is empty-like
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Krieger <[email protected]>
  • Loading branch information
ben-krieger authored and rsdmike committed Jan 15, 2025
1 parent 343c190 commit e89fd98
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/rps/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"rpc/internal/flags"
"rpc/internal/local"
"rpc/pkg/utils"
"strings"
"time"

log "github.com/sirupsen/logrus"
Expand Down Expand Up @@ -129,6 +130,9 @@ func (p Payload) createPayload(dnsSuffix string, hostname string, amtTimeout tim
payload.FQDN = dnsSuffix
} else {
payload.FQDN, _ = p.AMT.GetDNSSuffix()
// Trim whitespace and a trailing . because MEBx may not allow
// unsetting the DNS suffix entry by setting it to an empty string
payload.FQDN = strings.TrimSuffix(strings.TrimSpace(payload.FQDN), ".")
if payload.FQDN == "" {
payload.FQDN, _ = p.AMT.GetOSDNSSuffix()
}
Expand Down

0 comments on commit e89fd98

Please sign in to comment.