Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cws test servers #58

Merged
merged 6 commits into from
Oct 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion config/config-matterwick.default.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@
"CWSSplitKey": "",
"CWSSplitServerID": "",
"CloudDefaultProductID": "",
"CloudDefaultTrialProductID": ""
"CloudDefaultTrialProductID": "",
"CWSPublicPort": "",
"CWSPrivatePort": ""

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

}
}
2 changes: 2 additions & 0 deletions server/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ type CWS struct {
CloudDefaultProductID string
CloudDefaultTrialProductID string
DockerHubCredentials string
CWSPublicPort string
CWSPrivatePort string
}

// MatterwickConfig defines all config for to run the server
Expand Down
2 changes: 1 addition & 1 deletion server/spinwick.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ func (s *Server) createCWSSpinWick(pr *model.PullRequest, logger logrus.FieldLog
_, err = cloudClient.CreateWebhook(&cloudModel.CreateWebhookRequest{
// We use the namespace as the owner so it's easily fetched later
OwnerID: namespace.GetName(),
URL: fmt.Sprintf("http://cws-test-service.%s:8077/api/v1/internal/webhook", namespace.GetName()),
URL: fmt.Sprintf("http://cws-test-service.%s:%s/api/v1/internal/webhook", namespace.GetName(), s.Config.CWS.CWSPrivatePort),
})

if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions templates/cws/cws_deployment.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ spec:
imagePullPolicy: IfNotPresent
name: cws-main
ports:
- containerPort: 8076
- containerPort: {{ .Environment.CWSPublicPort }}
name: api
protocol: TCP
- containerPort: 8077
- containerPort: {{ .Environment.CWSPrivatePort }}
name: internal
protocol: TCP
resources: {}
Expand Down