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

[v17] Add multi-port support for TCP apps #49711

Open
wants to merge 3 commits into
base: branch/v17
Choose a base branch
from

Commits on Dec 3, 2024

  1. Add Ports field to app spec

    * Add Ports to AppSpecV3
    
    * Validate ports of api/types.AppV3
    
    * Add Ports to lib/config and lib/service/servicecfg
    
    * lib/config TestApps: Improve error messages
    
    * lib/service: Convert servicecfg.PortRange to types.PortRange
    
    * Add multi-port TCP apps to config and tctl tests
    
    * Rename Ports to TCPPorts
    
    * Change port fields to uint16 where possible
    
    * Update comments for Port and EndPort
    
    * Extract port range validation to api/utils/net
    
    * Replace custom check type with require.ErrorAssertionFunc
    ravicious committed Dec 3, 2024
    Configuration menu
    Copy the full SHA
    a0017af View commit details
    Browse the repository at this point in the history
  2. Add TargetPort to RouteToApp & use it to route connections to mul…

    …ti-port TCP apps
    
    * Add TargetPort to RouteToApp and AppMetadata proto messages
    
    * Pass TargetPort during cert generation
    
    * Refactor Pack.makeTLSConfig to accept struct
    
    This will make it easier to add targetPort to it.
    
    * Add labels to UUIDs used by appaccess test pack app servers
    
    This makes them easier to distinguish when routing doesn't work as expected.
    
    * Refactor Pack.CreateAppSession to accept a struct
    
    * TestTCP: Create app session within test
    
    If we kept the old code, we'd need to manually create a session for each
    target port, which would create a lot of duplication.
    
    * Prepare integration test fixtures for multi-port tests
    
    * Add api/utils/net.IsPortInRange
    
    * Use TargetPort when routing TCP connections
    
    * Inline dialMultiPortTCPApp, centralize logic
    
    * Check target port when connecting to single-port app
    
    * Reorder check in IsPortInRange
    
    * Use int instead of uint16
    
    * Extract picking dialTarget to separate function
    
    * Improve err msg for single-port apps when targetPort != uriPort
    
    * Fix unnecessary conversion to int
    ravicious committed Dec 3, 2024
    Configuration menu
    Copy the full SHA
    511d7dd View commit details
    Browse the repository at this point in the history
  3. Pass port from VNet to local proxy

    * Prepare app specs in tests for specifying TCP ports
    
    * Refactor logging in lib/vnet/app_resolver.go
    
    Use libutils.NewPackageLogger, call it log instead of slog which makes
    it harder to use the imported default slog logger instead of the one from
    a struct.
    
    Move creation of logger within TCPAppResolver.resolveTCPHandlerForCluster
    
    * Pass port from VNet to local proxy
    
    * Don't create another package logger
    
    * Don't pass logger to newTCPAppHandler
    
    * Fix typo in comment
    
    * Explicitly pass port to dialHost
    
    * Convert multi-line definitions of simple appSpecs to single-line
    
    * Add TODO comment about validating local port
    
    * Empty commit to trigger CI
    ravicious committed Dec 3, 2024
    Configuration menu
    Copy the full SHA
    ba7e743 View commit details
    Browse the repository at this point in the history