Skip to content

Feature support multiple clusters - #149

Open
bomoko wants to merge 2 commits into
mainfrom
feature-support-multiple-clusters
Open

bomoko wants to merge 2 commits into
mainfrom
feature-support-multiple-clusters

Conversation

@bomoko

@bomoko bomoko commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

SSH portal support was only partially supported up until now, this PR completes the implementation

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

The rsync transfer path selects SSH options incorrectly for local→remote vs remote→local transfers and needs conditional logic to pick the actual remote endpoint.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR aims to complete SSH portal support for multi-cluster setups by allowing SSH token retrieval to use a different host/port than the SSH tunnel endpoint, and by adjusting how per-environment SSH options are selected during transfers.

Changes:

  • Extend utils.ApiConn.Init to accept optional tokenHost/tokenPort overrides for SSH token retrieval.
  • Fix an environment selection error when resolving per-environment SSH options for rsync transfers.
  • Add support for LAGOON_CONFIG_TOKEN_HOST / LAGOON_CONFIG_TOKEN_PORT when building the SSH portal option wrapper.
File summaries
File Description
utils/sshportal.go Adds token host/port override support for SSH token retrieval during API connection initialization.
synchers/syncutils.go Changes which environment name is used to resolve SSH options for rsync transfers (needs conditional handling to support both transfer directions).
cmd/syncSharedFuncs.go Reads token host/port env vars and passes them into the SSH token retrieval initialization path when portal mode is enabled.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread synchers/syncutils.go
Comment on lines +222 to 225
sourceEnvSshOptions := sshOptionWrapper.GetSSHOptionsForEnvironment(sourceEnvironment.EnvironmentName)
rsyncArgs := sshOptions.RsyncArgs

execString := fmt.Sprintf("%s %s --rsync-path=%s %s -e \"ssh%s -o LogLevel=FATAL -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p %s -l %s %s service=%s\" %s %s %s",
Comment thread cmd/syncSharedFuncs.go
Comment on lines +218 to +221
// Resolve token host/port from env vars when using the SSH portal.
// These are only used for token retrieval and do not affect the SSH tunnel endpoint.
tokenHost, _ := os.LookupEnv("LAGOON_CONFIG_TOKEN_HOST")
tokenPort, _ := os.LookupEnv("LAGOON_CONFIG_TOKEN_PORT")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

These aren't user facing, and shouldn't be overridden, so no docs required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants