Skip to content

Commit

Permalink
Check that Tessera ports are available
Browse files Browse the repository at this point in the history
Signed-off-by: rodion <rodion.lim@partior.com>
  • Loading branch information
rodion-lim-partior committed Jun 28, 2024
1 parent 3fea393 commit f545bf6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/stacks/stack_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,7 @@ func (s *StackManager) copyDataExchangeConfigToVolumes() error {

func (s *StackManager) createMember(id string, index int, options *types.InitOptions, external bool) (*types.Organization, error) {
serviceBase := options.ServicesBasePort + (index * 100)
ptmBase := options.PtmBasePort + (index * 10)
member := &types.Organization{
ID: id,
Index: &index,
Expand All @@ -565,6 +566,7 @@ func (s *StackManager) createMember(id string, index int, options *types.InitOpt
ExposedConnectorPort: serviceBase + 2,
ExposedUIPort: serviceBase + 3,
ExposedDatabasePort: serviceBase + 4,
ExposePtmTpPort: ptmBase,
External: external,
OrgName: options.OrgNames[index],
NodeName: options.NodeNames[index],
Expand Down Expand Up @@ -783,6 +785,7 @@ func (s *StackManager) checkPortsAvailable() error {
ports = append(ports, member.ExposedDatabasePort)
ports = append(ports, member.ExposedUIPort)
ports = append(ports, member.ExposedTokensPorts...)
ports = append(ports, member.ExposePtmTpPort)

if !member.External {
ports = append(ports, member.ExposedFireflyAdminSPIPort)
Expand Down
1 change: 1 addition & 0 deletions pkg/types/organization.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ type Organization struct {
ExposedUIPort int `json:"exposedUiPort,omitempty"`
ExposedSandboxPort int `json:"exposedSandboxPort,omitempty"`
ExposedTokensPorts []int `json:"exposedTokensPorts,omitempty"`
ExposePtmTpPort int `json:"exposePtmTpPort,omitempty"`
External bool `json:"external,omitempty"`
OrgName string `json:"orgName,omitempty"`
NodeName string `json:"nodeName,omitempty"`
Expand Down

0 comments on commit f545bf6

Please sign in to comment.