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

feat(port-forward): Add support for managed database #233

Merged
merged 1 commit into from
Dec 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading