Skip to content

Commit

Permalink
fix lint warnings in pilot (istio#1817)
Browse files Browse the repository at this point in the history
Automatic merge from submit-queue.

fix lint warnings in pilot

I see the following lint warnings in pilot. This PR fixes those
trivial lint warnings.

```
pilot/cmd/pilot-discovery/main.go:176::warning: declaration of "client" shadows declaration at pilot/cmd/pilot-discovery/main.go:103 (vetshadow)
pilot/platform/kube/conversion_test.go:208:13:warning: if block ends with a return statement, so drop this else and outdent its block (golint)
```

**What this PR does / why we need it**:

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
none
```
  • Loading branch information
jmuk authored and istio-merge-robot committed Nov 22, 2017
1 parent e38091d commit 6e3cfc7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
6 changes: 3 additions & 3 deletions pilot/cmd/pilot-discovery/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,13 +173,13 @@ var (
})
case platform.EurekaRegistry:
glog.V(2).Infof("Eureka url: %v", flags.eureka.serverURL)
client := eureka.NewClient(flags.eureka.serverURL)
eurekaClient := eureka.NewClient(flags.eureka.serverURL)
serviceControllers.AddRegistry(
aggregate.Registry{
Name: serviceRegistry,
// TODO: Remove sync time hardcoding!
Controller: eureka.NewController(client, 2*time.Second),
ServiceDiscovery: eureka.NewServiceDiscovery(client),
Controller: eureka.NewController(eurekaClient, 2*time.Second),
ServiceDiscovery: eureka.NewServiceDiscovery(eurekaClient),
ServiceAccounts: eureka.NewServiceAccounts(),
})
default:
Expand Down
3 changes: 1 addition & 2 deletions pilot/platform/kube/conversion_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,8 @@ func TestServiceSecurityAnnotation(t *testing.T) {
Annotations: func() map[string]string {
if test.port > 0 {
return map[string]string{portAuthenticationAnnotationKey(test.port): test.annotationValue}
} else {
return nil
}
return nil
}(),
},
Spec: v1.ServiceSpec{
Expand Down

0 comments on commit 6e3cfc7

Please sign in to comment.