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

Forward service ports #609

Merged
merged 11 commits into from Jan 6, 2020
Merged

Forward service ports #609

merged 11 commits into from Jan 6, 2020

Conversation

rberrelleza
Copy link
Member

@rberrelleza rberrelleza commented Jan 3, 2020

Fixes #577

Proposed changes

  • forwardscan now take a string. if a string is given, the forward will go to a service in the namespace instead of to the local dev env
name: hello-world
image: okteto/golang:1
workdir: /okteto
command: ["bash"]
forward:
  - 8080:8080
  - 3306:mariadb:3306

@rlamana how do you think we should show this in the CLI's UI? Separate from the forward?

This is how it looks right now. It's sorted so the dev env ports are shown first
image

t.Run(tt.name, func(t *testing.T) {
c := fake.NewSimpleClientset(ns)
for _, p := range tt.pods {
c.Tracker().Add(&p)

Choose a reason for hiding this comment

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

Error return value of (k8s.io/client-go/testing.ObjectTracker).Add is not checked (from errcheck)

@codecov
Copy link

codecov bot commented Jan 3, 2020

Codecov Report

Merging #609 into master will decrease coverage by 2.91%.
The diff coverage is 47.5%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #609      +/-   ##
==========================================
- Coverage      40%   37.08%   -2.92%     
==========================================
  Files          35       41       +6     
  Lines        3090     3559     +469     
==========================================
+ Hits         1236     1320      +84     
- Misses       1775     2158     +383     
- Partials       79       81       +2
Impacted Files Coverage Δ
pkg/model/serializer.go 84.84% <ø> (+0.95%) ⬆️
cmd/up.go 6.52% <0%> (-0.06%) ⬇️
cmd/build.go 0% <0%> (ø) ⬆️
cmd/down.go 0% <0%> (ø) ⬆️
pkg/k8s/services/crud.go 6.06% <28.57%> (ø)
pkg/k8s/forward/manager.go 32.08% <31.96%> (ø)
pkg/model/dev.go 61.3% <50%> (-0.24%) ⬇️
pkg/k8s/pods/pod.go 7.1% <87.5%> (ø)
pkg/model/forward.go 94.87% <94.87%> (ø)
pkg/k8s/services/translate.go 0% <0%> (ø)
... and 5 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8f42326...6679b9f. Read the comment docs.

Copy link
Contributor

@pchico83 pchico83 left a comment

Choose a reason for hiding this comment

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

I would make the remote port mandatory as kubectl does. I find it quite confusing to make it optional.
Also, could you document the new syntax?

@rberrelleza
Copy link
Member Author

I would make the remote port mandatory as kubectl does. I find it quite confusing to make it optional.

Yeah, I was doubtful about that one as well. I'll remove it.

Also, could you document the new syntax?
Yes, I'll do it once we release the new version.

@rberrelleza rberrelleza merged commit 0101c44 into master Jan 6, 2020
@rberrelleza rberrelleza deleted the forward-service branch January 6, 2020 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Access services in my namespace directly from my local machine
4 participants