mirror of
https://github.com/cirruslabs/orchard.git
synced 2026-10-21 10:45:25 +02:00
Port forwarding support (#30)
* Port forwarding support * .golangci.yml: remove and replace deprecated and archived linters * Client: pass credentials when calling WebSocket API methods * API: require ServiceAccountRoleComputeWrite role for port forwarding * Use Buf * Rename Poll() RPC method to Watch() * Split Rendezvous into two parts: Watcher and Proxy (#32) * Split Rendezvous into two parts: Watcher and Proxy * Implement Proxy cancellation * Use Protocol Buffers structure directly in Watcher * Fix TestWatcher after switching to Protocol Buffers structure * portForwardVM(): ensure we also check for gin's context
This commit is contained in:
@@ -9,7 +9,7 @@ import (
|
||||
"fmt"
|
||||
"github.com/cirruslabs/orchard/internal/bootstraptoken"
|
||||
"github.com/cirruslabs/orchard/internal/config"
|
||||
"github.com/cirruslabs/orchard/internal/controller"
|
||||
"github.com/cirruslabs/orchard/internal/netconstants"
|
||||
"github.com/cirruslabs/orchard/pkg/client"
|
||||
"github.com/manifoldco/promptui"
|
||||
"github.com/spf13/cobra"
|
||||
@@ -60,7 +60,7 @@ func runCreate(cmd *cobra.Command, args []string) error {
|
||||
}
|
||||
|
||||
if controllerURL.Port() == "" {
|
||||
controllerURL.Host += fmt.Sprintf(":%d", controller.DefaultPort)
|
||||
controllerURL.Host += fmt.Sprintf(":%d", netconstants.DefaultControllerPort)
|
||||
}
|
||||
|
||||
// Establish trust
|
||||
@@ -89,7 +89,7 @@ func runCreate(cmd *cobra.Command, args []string) error {
|
||||
tlsConfig := &tls.Config{
|
||||
MinVersion: tls.VersionTLS13,
|
||||
RootCAs: privatePool,
|
||||
ServerName: controller.DefaultServerName,
|
||||
ServerName: netconstants.DefaultControllerServerName,
|
||||
}
|
||||
|
||||
client, err := client.New(
|
||||
@@ -131,7 +131,7 @@ func probeControllerCertificate(controllerURL *url.URL) (*x509.Certificate, erro
|
||||
insecureTLSConfig := &tls.Config{
|
||||
MinVersion: tls.VersionTLS13,
|
||||
RootCAs: emptyPool,
|
||||
ServerName: controller.DefaultServerName,
|
||||
ServerName: netconstants.DefaultControllerServerName,
|
||||
InsecureSkipVerify: true,
|
||||
}
|
||||
|
||||
@@ -153,7 +153,7 @@ func probeControllerCertificate(controllerURL *url.URL) (*x509.Certificate, erro
|
||||
formattedControllerCertFingerprint := formatFingerprint(controllerCertFingerprint[:])
|
||||
|
||||
shortControllerName := controllerURL.Hostname()
|
||||
if controllerURL.Port() != strconv.FormatUint(controller.DefaultPort, 10) {
|
||||
if controllerURL.Port() != strconv.FormatUint(netconstants.DefaultControllerPort, 10) {
|
||||
shortControllerName += ":" + controllerURL.Port()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user