Skip to content

Commit f2e2d1d

Browse files
committed
chore: fix golangci-lint issues
1 parent 0f26fcb commit f2e2d1d

3 files changed

Lines changed: 8 additions & 11 deletions

File tree

cmd/plugin-backend.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ import (
88
"strconv"
99
"strings"
1010

11-
server "github.com/openshift/monitoring-plugin/pkg"
1211
"github.com/sirupsen/logrus"
12+
13+
server "github.com/openshift/monitoring-plugin/pkg"
1314
)
1415

1516
var (

pkg/proxy/proxy.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,6 @@ func getProxy(kind KindType, proxyUrlString string, serviceCAfile string) (*http
130130
return proxy, nil
131131
}
132132

133-
func handleError(w http.ResponseWriter, code int, err error) {
134-
log.Error(err)
135-
http.Error(w, err.Error(), code)
136-
}
137-
138133
func (h *ProxyHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
139134
h.proxy.ServeHTTP(w, r)
140135
}

pkg/server.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import (
1212

1313
"github.com/gorilla/handlers"
1414
"github.com/gorilla/mux"
15-
"github.com/openshift/monitoring-plugin/pkg/proxy"
1615
"github.com/sirupsen/logrus"
1716
"gopkg.in/yaml.v2"
1817
v1 "k8s.io/api/core/v1"
@@ -21,6 +20,8 @@ import (
2120
"k8s.io/client-go/kubernetes/scheme"
2221
"k8s.io/client-go/rest"
2322
"k8s.io/client-go/tools/record"
23+
24+
"github.com/openshift/monitoring-plugin/pkg/proxy"
2425
)
2526

2627
var log = logrus.WithField("module", "server")
@@ -88,11 +89,11 @@ func CreateServer(ctx context.Context, cfg *Config) (*PluginServer, error) {
8889

8990
func (s *PluginServer) StartHTTPServer() error {
9091
if s.Config.IsTLSEnabled() {
91-
log.Infof("listening for https on %s", s.Server.Addr)
92-
return s.Server.ListenAndServeTLS(s.Config.CertFile, s.Config.PrivateKeyFile)
92+
log.Infof("listening for https on %s", s.Addr)
93+
return s.ListenAndServeTLS(s.Config.CertFile, s.Config.PrivateKeyFile)
9394
}
94-
log.Infof("listening for http on %s", s.Server.Addr)
95-
return s.Server.ListenAndServe()
95+
log.Infof("listening for http on %s", s.Addr)
96+
return s.ListenAndServe()
9697
}
9798

9899
func (s *PluginServer) Shutdown(ctx context.Context) error {

0 commit comments

Comments
 (0)