Skip to content

Commit 9510521

Browse files
committed
When within-k8s=false report to skylb.
1 parent 78fd722 commit 9510521

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

cmd/skytest/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ skylb/bazel-bin/cmd/skylb/linux_amd64_stripped/skylb --etcd-endpoints="http://lo
2929
1. 注册到skylbserver
3030

3131
```
32-
skylb-apiv2/bazel-bin/cmd/skytest/skytest-server_/skytest-server -within-k8s=true -port=18000 -skylb-endpoints="127.0.0.1:1900" -alsologtostderr -v=2 -log_dir=.
32+
skylb-apiv2/bazel-bin/cmd/skytest/skytest-server_/skytest-server -port=18000 -skylb-endpoints="127.0.0.1:1900" -alsologtostderr -v=2 -log_dir=.
3333
```
3434

3535
2. 不注册到skylbserver

server/server.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,11 +213,11 @@ func startHTTPServer(lis net.Listener, mux *http.ServeMux) {
213213
}
214214

215215
func start0(hostAddr string, servicePort int, spec *pb.ServiceSpec, interceptors ...grpc.UnaryServerInterceptor) (net.Listener, *grpc.Server) {
216-
if *withinK8s {
217-
glog.Infoln("Inside k8s, starting load reporter.")
216+
if !*withinK8s {
217+
glog.Infoln("Outside k8s, starting load reporter.")
218218
go StartSkylbReportLoad(spec, servicePort)
219219
} else {
220-
glog.Warningln("WARNING: Outside k8s, load-reporting disabled.")
220+
glog.Warningln("WARNING: Inside k8s, load-reporting disabled.")
221221
}
222222

223223
lis, err := net.Listen("tcp", hostAddr)

0 commit comments

Comments
 (0)