Skip to content

Commit c5c42b7

Browse files
committed
Fix a bug where creating domain path
1 parent efc8423 commit c5c42b7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pkg/cloud/user_credentials.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,12 @@ func (c *client) ResolveDomain(domain *Domain) error {
7070
domain.Name = tokens[len(tokens)-1]
7171
}
7272
// Ensure the path begins with ROOT.
73-
if strings.EqualFold(tokens[0], rootDomain) {
73+
if !strings.EqualFold(tokens[0], rootDomain) {
7474
tokens = append([]string{rootDomain}, tokens...)
7575
} else {
76-
domain.Path = rootDomain + domainDelimiter + strings.Join(tokens, domainDelimiter)
76+
tokens[0] = rootDomain
7777
}
78+
domain.Path = strings.Join(tokens, domainDelimiter)
7879
}
7980

8081
// Set present search/list parameters.

0 commit comments

Comments
 (0)