Skip to content

Commit

Permalink
Merge pull request #191 from kubefirst/atlantis-subdomain
Browse files Browse the repository at this point in the history
accommodate subdomains on atlantis url
  • Loading branch information
johndietz authored Oct 10, 2023
2 parents dd0bf1c + 1a5f733 commit 037372b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion internal/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,13 @@ func (clctrl *ClusterController) InitController(def *pkgtypes.ClusterDefinition)
defer segmentClient.Client.Close()

telemetryShim.Transmit(rec.UseTelemetry, segmentClient, segment.MetricClusterInstallStarted, "")

var fullDomainName string
if clctrl.SubdomainName != "" {
fullDomainName = fmt.Sprintf("%s.%s", clctrl.SubdomainName, clctrl.DomainName)
} else {
fullDomainName = clctrl.DomainName
}

//Copy Cluster Definiion to Cluster Controller
clctrl.AlertsEmail = def.AdminEmail
Expand Down Expand Up @@ -200,7 +207,8 @@ func (clctrl *ClusterController) InitController(def *pkgtypes.ClusterDefinition)
clctrl.KubefirstTeam = "undefined"
}
clctrl.AtlantisWebhookSecret = pkg.Random(20)
clctrl.AtlantisWebhookURL = fmt.Sprintf("https://atlantis.%s/events", clctrl.DomainName)

clctrl.AtlantisWebhookURL = fmt.Sprintf("https://atlantis.%s/events", fullDomainName)

// Initialize git parameters
clctrl.GitProvider = def.GitProvider
Expand Down

0 comments on commit 037372b

Please sign in to comment.