Skip to content

[ws-proxy] prevent podIP being used with many workspaces #20826

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

Merged
merged 2 commits into from
May 20, 2025
Merged

Conversation

iQQBot
Copy link
Contributor

@iQQBot iQQBot commented May 20, 2025

Description

[ws-proxy] prevent podIP being used with many workspaces

Related Issue(s)

Fixes CLC-1368

How to test

  1. make sure we can start workspace and access
image

Documentation

Preview status

Gitpod was successfully deployed to your preview environment.

Build Options

Build
  • /werft with-werft
    Run the build with werft instead of GHA
  • leeway-no-cache
  • /werft no-test
    Run Leeway with --dont-test
Publish
  • /werft publish-to-npm
  • /werft publish-to-jb-marketplace
Installer
  • analytics=segment
  • with-dedicated-emulation
  • workspace-feature-flags
    Add desired feature flags to the end of the line above, space separated
Preview Environment / Integration Tests
  • /werft with-local-preview
    If enabled this will build install/preview
  • /werft with-preview
  • /werft with-large-vm
  • /werft with-gce-vm
    If enabled this will create the environment on GCE infra
  • /werft preemptible
    Saves cost. Untick this only if you're really sure you need a non-preemtible machine.
  • with-integration-tests=all
    Valid options are all, workspace, webapp, ide, jetbrains, vscode, ssh. If enabled, with-preview and with-large-vm will be enabled.
  • with-monitoring

/hold

@iQQBot
Copy link
Contributor Author

iQQBot commented May 20, 2025

/unhold

@iQQBot iQQBot requested a review from Copilot May 20, 2025 18:40
@iQQBot iQQBot requested a review from kylos101 May 20, 2025 18:40
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR addresses the issue of preventing pod IP addresses from being used across many workspaces by adding IP-based indexing and validation into the WorkspaceInfo provider. Key changes include:

  • Adding a new index function for IP addresses.
  • Enhancing the WorkspaceInfo lookup logic with IP address conflict checks and warnings.
  • Introducing a helper function (workspacesInfoByIPAddress) to retrieve workspaces by IP.

return nil
}

if len(wsInfos) == 1 && wsInfos[0].WorkspaceID != workspaceID {
Copy link
Preview

Copilot AI May 20, 2025

Choose a reason for hiding this comment

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

[nitpick] Returning nil when a workspace ID conflict is detected may obscure the underlying issue; consider adding more explicit error handling or detailed documentation to clarify this behavior.

Copilot uses AI. Check for mistakes.

Copy link
Contributor

@kylos101 kylos101 left a comment

Choose a reason for hiding this comment

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

@iQQBot just one blocking question Re: logging workspaceID

@iQQBot iQQBot requested a review from kylos101 May 20, 2025 20:41
@roboquat roboquat merged commit 6385d6f into main May 20, 2025
20 checks passed
@roboquat roboquat deleted the pd/CLC-1368 branch May 20, 2025 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants