Skip to content

Commit aebadae

Browse files
chore(Golang): Webkubectl is now built using Golang v1.16.
1 parent b8d976a commit aebadae

File tree

4 files changed

+7
-8
lines changed

4 files changed

+7
-8
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.15-alpine as gotty-build
1+
FROM golang:1.16-alpine as gotty-build
22

33
ENV CGO_ENABLED=0
44
ENV GOOS=linux

gotty/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/KubeOperator/webkubectl/gotty
22

3-
go 1.15
3+
go 1.16
44

55
require (
66
github.com/NYTimes/gziphandler v1.1.1

gotty/server/handlers.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"encoding/base64"
77
"encoding/json"
88
"fmt"
9-
"io/ioutil"
9+
"io"
1010
"log"
1111
"net/http"
1212
"net/url"
@@ -289,7 +289,7 @@ func (server *Server) handleKubeConfigApi(w http.ResponseWriter, r *http.Request
289289
w.WriteHeader(405)
290290
return
291291
}
292-
body, err := ioutil.ReadAll(r.Body)
292+
body, err := io.ReadAll(r.Body)
293293
if err != nil {
294294
fmt.Printf("read body err, %v\n", err)
295295
result.Message = "Invalid Request Body"
@@ -347,7 +347,7 @@ func (server *Server) handleKubeTokenApi(w http.ResponseWriter, r *http.Request)
347347
w.WriteHeader(405)
348348
return
349349
}
350-
body, err := ioutil.ReadAll(r.Body)
350+
body, err := io.ReadAll(r.Body)
351351
if err != nil {
352352
fmt.Printf("read body err, %v\n", err)
353353
result.Message = "Invalid Request Body"

gotty/server/server.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55
"crypto/tls"
66
"crypto/x509"
77
"html/template"
8-
"io/ioutil"
98
"log"
109
"net"
1110
"net/http"
@@ -48,7 +47,7 @@ func New(factory Factory, options *Options, redisOptions *RedisOptions) (*Server
4847
}
4948
if options.IndexFile != "" {
5049
path := homedir.Expand(options.IndexFile)
51-
indexData, err = ioutil.ReadFile(path)
50+
indexData, err = os.ReadFile(path)
5251
if err != nil {
5352
return nil, errors.Wrapf(err, "failed to read custom index file at `%s`", path)
5453
}
@@ -268,7 +267,7 @@ func (server *Server) setupHTTPServer(handler http.Handler) (*http.Server, error
268267

269268
func (server *Server) tlsConfig() (*tls.Config, error) {
270269
caFile := homedir.Expand(server.options.TLSCACrtFile)
271-
caCert, err := ioutil.ReadFile(caFile)
270+
caCert, err := os.ReadFile(caFile)
272271
if err != nil {
273272
return nil, errors.New("could not open CA crt file " + caFile)
274273
}

0 commit comments

Comments
 (0)