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

Don't look up services in all namespaces. #2651

Merged
merged 4 commits into from
Aug 15, 2019

Conversation

tejal29
Copy link
Member

@tejal29 tejal29 commented Aug 14, 2019

fixes #2495,

In #2640, i made changes to collect all namespaces for deployed resources.
In PR, we go through all namespaces in the context and then look for services in each namespace.

Copy link
Contributor

@priyawadhwa priyawadhwa left a comment

Choose a reason for hiding this comment

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

LGTM -- I think we just need to get namespaces from user defined port forwarding, which I added here along with unit tests.

that way people can still port forward additional resources which skaffold didn't deploy.

@tejal29
Copy link
Member Author

tejal29 commented Aug 14, 2019

hmm, for user defined port forwarding, why do we need to fetch it? We should be able to get the specific resource right?

@priyawadhwa
Copy link
Contributor

ah that's true, nevermind!

@codecov
Copy link

codecov bot commented Aug 14, 2019

Codecov Report

Merging #2651 into master will increase coverage by 0.22%.
The diff coverage is 73.68%.

Impacted Files Coverage Δ
...affold/kubernetes/portforward/forwarder_manager.go 31.57% <0%> (ø) ⬆️
...ffold/kubernetes/portforward/resource_forwarder.go 88% <77.77%> (+32%) ⬆️
...g/skaffold/kubernetes/portforward/pod_forwarder.go 85.48% <0%> (-1.48%) ⬇️
...ffold/kubernetes/portforward/port_forward_entry.go 100% <0%> (ø) ⬆️
...kubernetes/portforward/port_forward_integration.go 0% <0%> (ø) ⬆️

Copy link
Contributor

@priyawadhwa priyawadhwa left a comment

Choose a reason for hiding this comment

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

LGTM

},
},
}, {
description: "services present but does not expose any port",
Copy link
Contributor

Choose a reason for hiding this comment

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

is this possible for a service?

Copy link
Member Author

Choose a reason for hiding this comment

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

you wont normally do it. But yes, you can not have any ports defined in the Spec and the service is created.

$ kubectl apply -f microservices/leeroy-app/kubernetes/
service/leeroy-app created
deployment.apps/leeroy-app created

$ git diff microservices/leeroy-app/kubernetes/
diff --git a/examples/microservices/leeroy-app/kubernetes/deployment.yaml b/examples/microservices/leeroy-app/kubernetes/deployment.yaml
index 56ef7152..46feab6d 100644
--- a/examples/microservices/leeroy-app/kubernetes/deployment.yaml
+++ b/examples/microservices/leeroy-app/kubernetes/deployment.yaml
@@ -6,9 +6,6 @@ metadata:
     app: leeroy-app
 spec:
   clusterIP: None
-  ports:
-    - port: 50051
-      name: leeroy-app
   selector:
     app: leeroy-app
 ---
tejaldesai@@examples (move_resolve_namespace)$ 

@balopat balopat closed this Aug 14, 2019
@balopat balopat reopened this Aug 14, 2019
@tejal29 tejal29 merged commit 3cc1e79 into GoogleContainerTools:master Aug 15, 2019
@tejal29 tejal29 deleted the fix_port_forwarding branch September 18, 2019 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Skaffold dev fails when user cannot list deployments at cluster scope
4 participants