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

Improving error message for service not in default namespace #5312

Closed
wants to merge 1 commit into from

Conversation

rbrishabh
Copy link
Contributor

Fixes #5271

Hey @josedonizetti @medyagh

Does this fix the issue?

I am very new with go-lang, so I might have gone wrong.
If I went wrong, please point me in the correct direction and I will be more than happy to look into this!

Thanks! =)

@k8s-ci-robot
Copy link
Contributor

Hi @rbrishabh. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Sep 11, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: rbrishabh
To complete the pull request process, please assign afbjorklund
You can assign the PR to them by writing /assign @afbjorklund in a comment when ready.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@minikube-bot
Copy link
Collaborator

Can one of the admins verify this patch?

@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Sep 11, 2019
@TravisBuddy
Copy link

Travis tests have failed

Hey @rbrishabh,
Please read the following log in order to understand the failure reason.
It'll be awesome if you fix what's wrong and commit the changes.

1st Build

View build log

make test
which go-bindata || GO111MODULE=off GOBIN=/home/travis/gopath/bin go get github.com/jteeuwen/go-bindata/...
PATH="/home/travis/gopath/bin:/home/travis/.gimme/versions/go1.12.9.linux.amd64/bin:/home/travis/bin:/home/travis/bin:/home/travis/.local/bin:/usr/local/lib/jvm/openjdk11/bin:/opt/pyenv/shims:/home/travis/.phpenv/shims:/home/travis/perl5/perlbrew/bin:/home/travis/.nvm/versions/node/v8.12.0/bin:/home/travis/.rvm/gems/ruby-2.5.3/bin:/home/travis/.rvm/gems/ruby-2.5.3@global/bin:/home/travis/.rvm/rubies/ruby-2.5.3/bin:/home/travis/gopath/bin:/home/travis/.gimme/versions/go1.11.1.linux.amd64/bin:/usr/local/maven-3.6.0/bin:/usr/local/cmake-3.12.4/bin:/usr/local/clang-7.0.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/home/travis/.rvm/bin:/home/travis/.phpenv/bin:/opt/pyenv/bin:/home/travis/.yarn/bin:/home/travis/gopath/bin" go-bindata -nomemcopy -o pkg/minikube/assets/assets.go -pkg assets deploy/addons/...
gofmt -s -w pkg/minikube/assets/assets.go
which go-bindata || GO111MODULE=off GOBIN=/home/travis/gopath/bin go get github.com/jteeuwen/go-bindata/...
/home/travis/gopath/bin/go-bindata
PATH="/home/travis/gopath/bin:/home/travis/.gimme/versions/go1.12.9.linux.amd64/bin:/home/travis/bin:/home/travis/bin:/home/travis/.local/bin:/usr/local/lib/jvm/openjdk11/bin:/opt/pyenv/shims:/home/travis/.phpenv/shims:/home/travis/perl5/perlbrew/bin:/home/travis/.nvm/versions/node/v8.12.0/bin:/home/travis/.rvm/gems/ruby-2.5.3/bin:/home/travis/.rvm/gems/ruby-2.5.3@global/bin:/home/travis/.rvm/rubies/ruby-2.5.3/bin:/home/travis/gopath/bin:/home/travis/.gimme/versions/go1.11.1.linux.amd64/bin:/usr/local/maven-3.6.0/bin:/usr/local/cmake-3.12.4/bin:/usr/local/clang-7.0.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/home/travis/.rvm/bin:/home/travis/.phpenv/bin:/opt/pyenv/bin:/home/travis/.yarn/bin:/home/travis/gopath/bin" go-bindata -nomemcopy -o pkg/minikube/translate/translations.go -pkg translate translations/...
gofmt -s -w pkg/minikube/translate/translations.go
./test.sh
= go mod ================================================================
ok
= make lint =============================================================
golangci/golangci-lint info checking GitHub for tag 'v1.17.1'
golangci/golangci-lint info found version: 1.17.1 for v1.17.1/linux/amd64
golangci/golangci-lint info installed out/linters/golangci-lint
pkg/minikube/service/service.go:222:25: too few arguments in call to errors.Wrapf (typecheck)
			Err: errors.Wrapf(err),
			                     ^
Makefile:334: recipe for target 'lint-ci' failed
make[1]: *** [lint-ci] Error 1
= boilerplate ===========================================================
ok
= schema_check ==========================================================
ok
= go test ===============================================================
# k8s.io/minikube/pkg/minikube/service
pkg/minikube/service/service.go:222:21: not enough arguments in call to "github.com/pkg/errors".Wrapf
	have (error)
	want (error, string, ...interface {})
FAIL	k8s.io/minikube/cmd/minikube/cmd [build failed]
FAIL	k8s.io/minikube/cmd/minikube/cmd/config [build failed]
ok  	k8s.io/minikube/pkg/drivers	0.015s	coverage: 19.6% of statements
ok  	k8s.io/minikube/pkg/drivers/kvm	0.031s	coverage: 2.3% of statements
ok  	k8s.io/minikube/pkg/minikube/assets	0.041s	coverage: 61.8% of statements
ok  	k8s.io/minikube/pkg/minikube/bootstrapper	1.679s	coverage: 72.9% of statements
FAIL	k8s.io/minikube/pkg/minikube/bootstrapper/kubeadm [build failed]
ok  	k8s.io/minikube/pkg/minikube/cluster	0.198s	coverage: 54.2% of statements
ok  	k8s.io/minikube/pkg/minikube/config	0.023s	coverage: 76.0% of statements
ok  	k8s.io/minikube/pkg/minikube/cruntime	0.009s	coverage: 62.4% of statements
ok  	k8s.io/minikube/pkg/minikube/extract	0.020s	coverage: 56.7% of statements
ok  	k8s.io/minikube/pkg/minikube/kubeconfig	0.048s	coverage: 75.6% of statements
ok  	k8s.io/minikube/pkg/minikube/logs	0.060s	coverage: 1.4% of statements
ok  	k8s.io/minikube/pkg/minikube/machine	0.043s	coverage: 11.3% of statements
ok  	k8s.io/minikube/pkg/minikube/notify	0.038s	coverage: 81.5% of statements
ok  	k8s.io/minikube/pkg/minikube/out	0.010s	coverage: 70.3% of statements
ok  	k8s.io/minikube/pkg/minikube/problem	0.010s	coverage: 42.9% of statements
ok  	k8s.io/minikube/pkg/minikube/proxy	0.011s	coverage: 100.0% of statements
# k8s.io/minikube/pkg/minikube/service [k8s.io/minikube/pkg/minikube/service.test]
pkg/minikube/service/service.go:222: not enough arguments in call to "github.com/pkg/errors".Wrapf
	have (error)
	want (error, string, ...interface {})
ok  	k8s.io/minikube/pkg/minikube/registry	0.014s	coverage: 100.0% of statements
FAIL	k8s.io/minikube/pkg/minikube/service [build failed]
ok  	k8s.io/minikube/pkg/minikube/sshutil	0.305s	coverage: 75.0% of statements
ok  	k8s.io/minikube/pkg/minikube/translate	0.013s	coverage: 8.4% of statements
ok  	k8s.io/minikube/pkg/minikube/tunnel	2.067s	coverage: 64.5% of statements
ok  	k8s.io/minikube/pkg/util	1.727s	coverage: 61.6% of statements
ok  	k8s.io/minikube/pkg/util/lock	0.004s	coverage: 59.1% of statements
ok  	k8s.io/minikube/pkg/util/retry	0.002s	coverage: 0.0% of statements
Makefile:232: recipe for target 'test' failed
make: *** [test] Error 20
TravisBuddy Request Identifier: bea2a4b0-d46b-11e9-847a-07722ef8bbdd

@TravisBuddy
Copy link

Travis tests have failed

Hey @rbrishabh,
Please read the following log in order to understand the failure reason.
It'll be awesome if you fix what's wrong and commit the changes.

1st Build

View build log

make test
which go-bindata || GO111MODULE=off GOBIN=/home/travis/gopath/bin go get github.com/jteeuwen/go-bindata/...
PATH="/home/travis/gopath/bin:/home/travis/.gimme/versions/go1.12.9.linux.amd64/bin:/home/travis/bin:/home/travis/bin:/home/travis/.local/bin:/usr/local/lib/jvm/openjdk11/bin:/opt/pyenv/shims:/home/travis/.phpenv/shims:/home/travis/perl5/perlbrew/bin:/home/travis/.nvm/versions/node/v8.12.0/bin:/home/travis/.rvm/gems/ruby-2.5.3/bin:/home/travis/.rvm/gems/ruby-2.5.3@global/bin:/home/travis/.rvm/rubies/ruby-2.5.3/bin:/home/travis/gopath/bin:/home/travis/.gimme/versions/go1.11.1.linux.amd64/bin:/usr/local/maven-3.6.0/bin:/usr/local/cmake-3.12.4/bin:/usr/local/clang-7.0.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/home/travis/.rvm/bin:/home/travis/.phpenv/bin:/opt/pyenv/bin:/home/travis/.yarn/bin:/home/travis/gopath/bin" go-bindata -nomemcopy -o pkg/minikube/assets/assets.go -pkg assets deploy/addons/...
gofmt -s -w pkg/minikube/assets/assets.go
which go-bindata || GO111MODULE=off GOBIN=/home/travis/gopath/bin go get github.com/jteeuwen/go-bindata/...
/home/travis/gopath/bin/go-bindata
PATH="/home/travis/gopath/bin:/home/travis/.gimme/versions/go1.12.9.linux.amd64/bin:/home/travis/bin:/home/travis/bin:/home/travis/.local/bin:/usr/local/lib/jvm/openjdk11/bin:/opt/pyenv/shims:/home/travis/.phpenv/shims:/home/travis/perl5/perlbrew/bin:/home/travis/.nvm/versions/node/v8.12.0/bin:/home/travis/.rvm/gems/ruby-2.5.3/bin:/home/travis/.rvm/gems/ruby-2.5.3@global/bin:/home/travis/.rvm/rubies/ruby-2.5.3/bin:/home/travis/gopath/bin:/home/travis/.gimme/versions/go1.11.1.linux.amd64/bin:/usr/local/maven-3.6.0/bin:/usr/local/cmake-3.12.4/bin:/usr/local/clang-7.0.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/home/travis/.rvm/bin:/home/travis/.phpenv/bin:/opt/pyenv/bin:/home/travis/.yarn/bin:/home/travis/gopath/bin" go-bindata -nomemcopy -o pkg/minikube/translate/translations.go -pkg translate translations/...
gofmt -s -w pkg/minikube/translate/translations.go
./test.sh
= go mod ================================================================
ok
= make lint =============================================================
golangci/golangci-lint info checking GitHub for tag 'v1.17.1'
golangci/golangci-lint info found version: 1.17.1 for v1.17.1/linux/amd64
golangci/golangci-lint info installed out/linters/golangci-lint
pkg/minikube/service/service.go:222:25: too few arguments in call to errors.Wrapf (typecheck)
			Err: errors.Wrapf(err),
			                     ^
Makefile:334: recipe for target 'lint-ci' failed
make[1]: *** [lint-ci] Error 1
= boilerplate ===========================================================
ok
= schema_check ==========================================================
ok
= go test ===============================================================
# k8s.io/minikube/pkg/minikube/service
pkg/minikube/service/service.go:222:21: not enough arguments in call to "github.com/pkg/errors".Wrapf
	have (error)
	want (error, string, ...interface {})
FAIL	k8s.io/minikube/cmd/minikube/cmd [build failed]
FAIL	k8s.io/minikube/cmd/minikube/cmd/config [build failed]
ok  	k8s.io/minikube/pkg/drivers	0.009s	coverage: 19.6% of statements
ok  	k8s.io/minikube/pkg/drivers/kvm	0.028s	coverage: 2.3% of statements
ok  	k8s.io/minikube/pkg/minikube/assets	0.034s	coverage: 61.8% of statements
ok  	k8s.io/minikube/pkg/minikube/bootstrapper	2.034s	coverage: 72.9% of statements
FAIL	k8s.io/minikube/pkg/minikube/bootstrapper/kubeadm [build failed]
ok  	k8s.io/minikube/pkg/minikube/cluster	0.465s	coverage: 54.2% of statements
ok  	k8s.io/minikube/pkg/minikube/config	0.019s	coverage: 76.0% of statements
ok  	k8s.io/minikube/pkg/minikube/cruntime	0.015s	coverage: 62.4% of statements
ok  	k8s.io/minikube/pkg/minikube/extract	0.012s	coverage: 56.7% of statements
ok  	k8s.io/minikube/pkg/minikube/kubeconfig	0.039s	coverage: 75.6% of statements
ok  	k8s.io/minikube/pkg/minikube/logs	0.032s	coverage: 1.4% of statements
ok  	k8s.io/minikube/pkg/minikube/machine	0.055s	coverage: 11.3% of statements
ok  	k8s.io/minikube/pkg/minikube/notify	0.045s	coverage: 81.5% of statements
ok  	k8s.io/minikube/pkg/minikube/out	0.009s	coverage: 70.3% of statements
ok  	k8s.io/minikube/pkg/minikube/problem	0.008s	coverage: 42.9% of statements
ok  	k8s.io/minikube/pkg/minikube/proxy	0.019s	coverage: 100.0% of statements
# k8s.io/minikube/pkg/minikube/service [k8s.io/minikube/pkg/minikube/service.test]
pkg/minikube/service/service.go:222: not enough arguments in call to "github.com/pkg/errors".Wrapf
	have (error)
	want (error, string, ...interface {})
ok  	k8s.io/minikube/pkg/minikube/registry	0.028s	coverage: 100.0% of statements
FAIL	k8s.io/minikube/pkg/minikube/service [build failed]
--- FAIL: TestNewSSHClient (0.80s)
    ssh_mock.go:173: Listening on 127.0.0.1:44909
    ssh_mock.go:83: Accepting...
    ssh_mock.go:83: Accepting...
    ssh_mock.go:132: exec request received: &{Type:exec WantReply:true Payload:[0 0 0 3 102 111 111] ch:0xc0001320c0 mux:<nil>}
    sshutil_test.go:60: Error running "foo": wait: remote command exited without exit status or exit signal
    ssh_mock.go:189: Stopping
FAIL
coverage: 75.0% of statements
FAIL	k8s.io/minikube/pkg/minikube/sshutil	0.803s
ok  	k8s.io/minikube/pkg/minikube/translate	0.005s	coverage: 8.4% of statements
ok  	k8s.io/minikube/pkg/minikube/tunnel	2.017s	coverage: 64.5% of statements
ok  	k8s.io/minikube/pkg/util	1.906s	coverage: 61.6% of statements
ok  	k8s.io/minikube/pkg/util/lock	0.004s	coverage: 59.1% of statements
ok  	k8s.io/minikube/pkg/util/retry	0.002s	coverage: 0.0% of statements
Makefile:232: recipe for target 'test' failed
make: *** [test] Error 20
TravisBuddy Request Identifier: 7c168d40-d46c-11e9-847a-07722ef8bbdd

@TravisBuddy
Copy link

Travis tests have failed

Hey @rbrishabh,
Please read the following log in order to understand the failure reason.
It'll be awesome if you fix what's wrong and commit the changes.

1st Build

View build log

make test
which go-bindata || GO111MODULE=off GOBIN=/home/travis/gopath/bin go get github.com/jteeuwen/go-bindata/...
PATH="/home/travis/gopath/bin:/home/travis/.gimme/versions/go1.12.9.linux.amd64/bin:/home/travis/bin:/home/travis/bin:/home/travis/.local/bin:/usr/local/lib/jvm/openjdk11/bin:/opt/pyenv/shims:/home/travis/.phpenv/shims:/home/travis/perl5/perlbrew/bin:/home/travis/.nvm/versions/node/v8.12.0/bin:/home/travis/.rvm/gems/ruby-2.5.3/bin:/home/travis/.rvm/gems/ruby-2.5.3@global/bin:/home/travis/.rvm/rubies/ruby-2.5.3/bin:/home/travis/gopath/bin:/home/travis/.gimme/versions/go1.11.1.linux.amd64/bin:/usr/local/maven-3.6.0/bin:/usr/local/cmake-3.12.4/bin:/usr/local/clang-7.0.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/home/travis/.rvm/bin:/home/travis/.phpenv/bin:/opt/pyenv/bin:/home/travis/.yarn/bin:/home/travis/gopath/bin" go-bindata -nomemcopy -o pkg/minikube/assets/assets.go -pkg assets deploy/addons/...
gofmt -s -w pkg/minikube/assets/assets.go
which go-bindata || GO111MODULE=off GOBIN=/home/travis/gopath/bin go get github.com/jteeuwen/go-bindata/...
/home/travis/gopath/bin/go-bindata
PATH="/home/travis/gopath/bin:/home/travis/.gimme/versions/go1.12.9.linux.amd64/bin:/home/travis/bin:/home/travis/bin:/home/travis/.local/bin:/usr/local/lib/jvm/openjdk11/bin:/opt/pyenv/shims:/home/travis/.phpenv/shims:/home/travis/perl5/perlbrew/bin:/home/travis/.nvm/versions/node/v8.12.0/bin:/home/travis/.rvm/gems/ruby-2.5.3/bin:/home/travis/.rvm/gems/ruby-2.5.3@global/bin:/home/travis/.rvm/rubies/ruby-2.5.3/bin:/home/travis/gopath/bin:/home/travis/.gimme/versions/go1.11.1.linux.amd64/bin:/usr/local/maven-3.6.0/bin:/usr/local/cmake-3.12.4/bin:/usr/local/clang-7.0.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/home/travis/.rvm/bin:/home/travis/.phpenv/bin:/opt/pyenv/bin:/home/travis/.yarn/bin:/home/travis/gopath/bin" go-bindata -nomemcopy -o pkg/minikube/translate/translations.go -pkg translate translations/...
gofmt -s -w pkg/minikube/translate/translations.go
./test.sh
= go mod ================================================================
ok
= make lint =============================================================
golangci/golangci-lint info checking GitHub for tag 'v1.17.1'
golangci/golangci-lint info found version: 1.17.1 for v1.17.1/linux/amd64
golangci/golangci-lint info installed out/linters/golangci-lint
pkg/minikube/service/service.go:222: File is not `goimports`-ed (goimports)
			Err: errors.Wrapf(err, "Error getting service %s", service),	
Makefile:334: recipe for target 'lint-ci' failed
make[1]: *** [lint-ci] Error 1
= boilerplate ===========================================================
ok
= schema_check ==========================================================
ok
= go test ===============================================================
ok  	k8s.io/minikube/cmd/minikube/cmd	0.063s	coverage: 16.7% of statements
ok  	k8s.io/minikube/cmd/minikube/cmd/config	0.056s	coverage: 18.9% of statements
ok  	k8s.io/minikube/pkg/drivers	0.008s	coverage: 19.6% of statements
ok  	k8s.io/minikube/pkg/drivers/kvm	0.059s	coverage: 2.3% of statements
ok  	k8s.io/minikube/pkg/minikube/assets	0.037s	coverage: 61.8% of statements
ok  	k8s.io/minikube/pkg/minikube/bootstrapper	2.605s	coverage: 72.9% of statements
ok  	k8s.io/minikube/pkg/minikube/bootstrapper/kubeadm	0.075s	coverage: 29.5% of statements
ok  	k8s.io/minikube/pkg/minikube/cluster	0.444s	coverage: 54.2% of statements
ok  	k8s.io/minikube/pkg/minikube/config	0.028s	coverage: 76.0% of statements
ok  	k8s.io/minikube/pkg/minikube/cruntime	0.009s	coverage: 62.4% of statements
ok  	k8s.io/minikube/pkg/minikube/extract	0.008s	coverage: 56.7% of statements
ok  	k8s.io/minikube/pkg/minikube/kubeconfig	0.039s	coverage: 75.6% of statements
ok  	k8s.io/minikube/pkg/minikube/logs	0.043s	coverage: 1.4% of statements
ok  	k8s.io/minikube/pkg/minikube/machine	0.031s	coverage: 11.3% of statements
ok  	k8s.io/minikube/pkg/minikube/notify	0.019s	coverage: 77.8% of statements
ok  	k8s.io/minikube/pkg/minikube/out	0.009s	coverage: 70.3% of statements
ok  	k8s.io/minikube/pkg/minikube/problem	0.008s	coverage: 42.9% of statements
ok  	k8s.io/minikube/pkg/minikube/proxy	0.009s	coverage: 100.0% of statements
ok  	k8s.io/minikube/pkg/minikube/registry	0.018s	coverage: 100.0% of statements
ok  	k8s.io/minikube/pkg/minikube/service	0.038s	coverage: 35.9% of statements
ok  	k8s.io/minikube/pkg/minikube/sshutil	0.163s	coverage: 75.0% of statements
ok  	k8s.io/minikube/pkg/minikube/translate	0.010s	coverage: 8.4% of statements
ok  	k8s.io/minikube/pkg/minikube/tunnel	2.033s	coverage: 64.5% of statements
ok  	k8s.io/minikube/pkg/util	1.281s	coverage: 61.6% of statements
ok  	k8s.io/minikube/pkg/util/lock	0.004s	coverage: 59.1% of statements
ok  	k8s.io/minikube/pkg/util/retry	0.002s	coverage: 0.0% of statements
ok
Makefile:232: recipe for target 'test' failed
make: *** [test] Error 4
TravisBuddy Request Identifier: 5d1629e0-d495-11e9-847a-07722ef8bbdd

@@ -266,7 +266,7 @@ func WaitAndMaybeOpenService(api libmachine.API, namespace string, service strin
chkSVC := func() error { return CheckService(namespace, service) }

if err := retry.Expo(chkSVC, time.Duration(interval)*time.Second, time.Duration(wait)*time.Second); err != nil {
return errors.Wrapf(err, "Could not find finalized endpoint being pointed to by %s", service)
return errors.Wrapf(err, "Service %s was not found in default namespace, please try again with 'minikube service %s -n %s'", service, service, namespace)
Copy link
Contributor

Choose a reason for hiding this comment

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

Hi,
I'm not the core reviewer, but I believe it's not the best solution.
function CheckService
looks like:

  212 // CheckService checks if a service is listening on a port.                                                             
  213 func CheckService(namespace string, service string) error {                                                             
  214         client, err := K8s.GetCoreClient()                                                                              
  215         if err != nil {                                                                                                 
  216                 return errors.Wrap(err, "Error getting kubernetes client")                                              
  217         }                                                                                                               
  218                                                                                                                         
  219         svc, err := client.Services(namespace).Get(service, meta.GetOptions{})                                          
  220         if err != nil {                                                                                                 
  221                 return &retry.RetriableError{                                                                           
  222                         Err: errors.Wrapf(err, "Error getting service %s", service),                                    
  223                 }                                                                                                       
  224         }                                                                                                               
  225         if len(svc.Spec.Ports) == 0 {                                                                                   
  226                 return fmt.Errorf("%s:%s has no ports", namespace, service)                                             
  227         }                                                                                                               
  228         glog.Infof("Found service: %+v", svc)                                                                           
  229         return nil                                                                                                      
  230 } 

what if error was returned due to no ports?
maybe before printing error about default namespace we should check if namespace == "default" and embed error msg from CheckService

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hey @n0npax ! Thanks, I'll take another look at this today!

@tstromberg
Copy link
Contributor

@minikube-bot OK to test

@RA489
Copy link

RA489 commented Sep 18, 2019

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Sep 18, 2019
@sharifelgamal
Copy link
Collaborator

@minikube-bot OK to test

@tstromberg tstromberg added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 23, 2019
@medyagh
Copy link
Member

medyagh commented Sep 25, 2019

@rbrishabh do you mind pasting before and after output of this PR ?

@rbrishabh
Copy link
Contributor Author

I am not able to test this locally, unfortunately!

@minikube-bot
Copy link
Collaborator

Error: running mkcmp: exit status 1

@medyagh
Copy link
Member

medyagh commented Nov 6, 2019

@rbrishabh sorry this PR went stale. I just noticed we have a newer PR #5844

sadly I have to close this one in favor of the newer one. I hope you still consider picking up another good-first issue

@medyagh medyagh closed this Nov 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve error message for service not in default namespace.
9 participants