Skip to content

Commit

Permalink
feat(port-forward): Add support for managed database
Browse files Browse the repository at this point in the history
  • Loading branch information
erebe committed Dec 28, 2023
1 parent 6713db1 commit 5481a73
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
7 changes: 5 additions & 2 deletions cmd/port-forward.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ func portForwardRequestFromSelect() (*pkg.PortForwardRequest, error) {

return &pkg.PortForwardRequest{
ServiceID: service.ID,
ServiceType: strings.ToUpper(string(service.Type)),
ProjectID: project.ID,
OrganizationID: orga.ID,
EnvironmentID: env.ID,
Expand Down Expand Up @@ -175,6 +176,7 @@ func portForwardRequestFromContext(currentContext utils.QoveryContext) (*pkg.Por

return &pkg.PortForwardRequest{
ServiceID: currentContext.ServiceId,
ServiceType: strings.ToUpper(string(currentContext.ServiceType)),
ProjectID: currentContext.ProjectId,
OrganizationID: currentContext.OrganizationId,
EnvironmentID: currentContext.EnvironmentId,
Expand Down Expand Up @@ -290,10 +292,11 @@ func portForwardRequestWithApplicationUrl(args []string) (*pkg.PortForwardReques
ProjectID: project.ID,
EnvironmentID: environment.ID,
ServiceID: service.ID,
ServiceType: strings.ToUpper(string(service.Type)),
ClusterID: environment.ClusterID,
PodName: podName,
Port: 8000,
LocalPort: 8000,
Port: 0,
LocalPort: 0,
}, nil
}

Expand Down
8 changes: 4 additions & 4 deletions pkg/port-forward.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@ import (
"errors"
"fmt"
"github.com/appscode/go-querystring/query"
"github.com/gorilla/websocket"
"github.com/qovery/qovery-cli/utils"
log "github.com/sirupsen/logrus"
"io"
"net"
"net/http"
"net/url"
"regexp"

"github.com/gorilla/websocket"
"github.com/qovery/qovery-cli/utils"
log "github.com/sirupsen/logrus"
)

type PortForwardRequest struct {
Expand All @@ -22,6 +21,7 @@ type PortForwardRequest struct {
OrganizationID utils.Id `url:"organization"`
ClusterID utils.Id `url:"cluster"`
PodName string `url:"pod_name,omitempty"`
ServiceType string `url:"service_type"`
Port uint16 `url:"port"`
LocalPort uint16
}
Expand Down

0 comments on commit 5481a73

Please sign in to comment.