Skip to content

Commit c77e919

Browse files
committed
bump Go, buildkit-golang (import from 2024-09-08)
1 parent 1f075d6 commit c77e919

File tree

10 files changed

+35
-91
lines changed

10 files changed

+35
-91
lines changed

go.mod

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/function61/edgerouter
22

3-
go 1.13
3+
go 1.23.1
44

55
require (
66
github.com/aws/aws-lambda-go v1.14.0
@@ -11,16 +11,35 @@ require (
1111
github.com/function61/eventhorizon v0.2.1-0.20200610093004-78aa8b3a710f
1212
github.com/function61/gokit v0.0.0-20200608105953-12235c68c38b
1313
github.com/function61/id v0.0.0-20210304120117-4b4b73375b3b
14-
github.com/go-acme/lego/v3 v3.3.0 // indirect
1514
github.com/gorilla/mux v1.7.4
16-
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect
15+
github.com/peterbourgon/diskv v2.0.1+incompatible
1716
github.com/prometheus/client_golang v1.4.1
1817
github.com/scylladb/termtables v1.0.0
1918
github.com/spf13/cobra v1.0.0
20-
github.com/stretchr/testify v1.6.1 // indirect
21-
golang.org/x/crypto v0.0.0-20201217014255-9d1352758620 // indirect
22-
golang.org/x/net v0.0.0-20201021035429-f5854403a974 // indirect
2319
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9
24-
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
2520
inet.af/netaddr v0.0.0-20230525184311-b8eac61e914a
2621
)
22+
23+
require (
24+
github.com/apcera/termtables v0.0.0-20170405184538-bcbc5dc54055 // indirect
25+
github.com/beorn7/perks v1.0.1 // indirect
26+
github.com/cespare/xxhash/v2 v2.1.1 // indirect
27+
github.com/golang/protobuf v1.3.4 // indirect
28+
github.com/google/btree v1.0.0 // indirect
29+
github.com/hashicorp/hcl v1.0.0 // indirect
30+
github.com/inconshreveable/mousetrap v1.0.0 // indirect
31+
github.com/jmespath/go-jmespath v0.3.0 // indirect
32+
github.com/kataras/jwt v0.1.2 // indirect
33+
github.com/mattn/go-runewidth v0.0.8 // indirect
34+
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
35+
github.com/patrickmn/go-cache v2.1.0+incompatible // indirect
36+
github.com/prometheus/client_model v0.2.0 // indirect
37+
github.com/prometheus/common v0.9.1 // indirect
38+
github.com/prometheus/procfs v0.0.8 // indirect
39+
github.com/spf13/pflag v1.0.5 // indirect
40+
go4.org/intern v0.0.0-20211027215823-ae77deb06f29 // indirect
41+
go4.org/unsafe/assume-no-moving-gc v0.0.0-20230525183740-e7c30c78aeb2 // indirect
42+
golang.org/x/crypto v0.0.0-20201217014255-9d1352758620 // indirect
43+
golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4 // indirect
44+
gopkg.in/square/go-jose.v2 v2.5.1 // indirect
45+
)

go.sum

Lines changed: 0 additions & 62 deletions
Large diffs are not rendered by default.

pkg/erbackend/reverseproxybackend/reverseproxy.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import (
1414
"os"
1515
"path/filepath"
1616
"strings"
17-
"time"
1817

1918
"github.com/cozy/httpcache"
2019
"github.com/cozy/httpcache/diskcache"
@@ -30,10 +29,6 @@ import (
3029
// 3) press F5 from browser. this'll inject 304 Not Modified into cache (browser expects 304 but CACHE NOT)
3130
// 4) now use cURL to request the same resource (= without caching), and you'll get 304 🤦
3231

33-
func init() {
34-
rand.Seed(time.Now().Unix())
35-
}
36-
3732
func New(appId string, opts erconfig.BackendOptsReverseProxy, logger *log.Logger) (http.Handler, error) {
3833
handler, err := NewWithModifyResponse(appId, opts, nil)
3934
if err != nil {

pkg/erbackend/statics3websitebackend/backend.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"bytes"
77
"context"
88
"fmt"
9-
"io/ioutil"
9+
"io"
1010
"net/http"
1111
"strings"
1212
"sync"
@@ -53,7 +53,7 @@ func New(appId string, opts erconfig.BackendOptsS3StaticWebsite) (http.Handler,
5353
}
5454

5555
r.Header.Set("Content-Type", contentType)
56-
r.Body = ioutil.NopCloser(bytes.NewReader(body))
56+
r.Body = io.NopCloser(bytes.NewReader(body))
5757
}
5858

5959
return nil
@@ -70,7 +70,7 @@ func serveCached404Page(url404 string, cacheNotFound *cache404) ([]byte, string,
7070
return nil, "", fmt.Errorf("failed ezhttp.Get 404 page: %w", err)
7171
}
7272

73-
body, err := ioutil.ReadAll(res.Body)
73+
body, err := io.ReadAll(res.Body)
7474
if err != nil {
7575
return nil, "", err
7676
}

pkg/erbackend/statics3websitebackend/deploy.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import (
88
"encoding/json"
99
"fmt"
1010
"io"
11-
"io/ioutil"
1211
"log"
1312
"path"
1413
"path/filepath"
@@ -163,7 +162,7 @@ func uploadAllFiles(ctx context.Context, tarArchive io.Reader, upload *uploadJob
163162
// filePath looks like "images/2018/unificontroller-stats.png"
164163
func createUploadRequest(filePath string, content io.Reader, upload *uploadJob) (*s3.PutObjectInput, error) {
165164
// stupid S3 client requires io.ReadSeeker, so we've to read the entire file in memory......
166-
wholeFileInMemory, err := ioutil.ReadAll(content)
165+
wholeFileInMemory, err := io.ReadAll(content)
167166
if err != nil {
168167
return nil, err
169168
}

pkg/erdiscovery/dockerdiscovery/traefikannotations_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,6 @@ func TestTraefikAnnotationsToApp(t *testing.T) {
163163
}
164164

165165
for _, tc := range tcs {
166-
tc := tc // pin
167-
168166
t.Run(tc.input.Name, func(t *testing.T) {
169167
app, err := traefikAnnotationsToApp(tc.input)
170168
assert.Ok(t, err)

pkg/erserver/ipfilter_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,6 @@ allow_specified {
9595
"your IP (100.56.80.67) is not allowed (implicit deny)",
9696
},
9797
} {
98-
tc := tc // pin
99-
10098
testcaseSubject := fmt.Sprintf("%s -> %s", tc.ip, tc.app) // for failures
10199

102100
t.Run(testcaseSubject, func(t *testing.T) {

pkg/erservercli/servercli.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ package erservercli
44

55
import (
66
"fmt"
7-
"io/ioutil"
87
"os"
98
"path/filepath"
109

@@ -93,7 +92,7 @@ func installAsService(opts Options) error {
9392
return err
9493
}
9594

96-
return ioutil.WriteFile(envFile, []byte(`
95+
return os.WriteFile(envFile, []byte(`
9796
# --- Docker integration
9897
DOCKER_URL=unix:///var/run/docker.sock
9998
NETWORK_NAME=docker_gwbridge

pkg/erservercli/setupdevcerts.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package erservercli
33
import (
44
"errors"
55
"fmt"
6-
"io/ioutil"
76
"os"
87
"os/exec"
98
"path/filepath"
@@ -43,7 +42,7 @@ func setupDevCertsEntry(opts Options) *cobra.Command {
4342
}
4443

4544
func serverCertGenerate(hostname string, opts Options) error {
46-
tempDir, err := ioutil.TempDir("", "edgerouter-mkcert-*")
45+
tempDir, err := os.MkdirTemp("", "edgerouter-mkcert-*")
4746
if err != nil {
4847
return err
4948
}
@@ -78,7 +77,7 @@ func serverCertGenerate(hostname string, opts Options) error {
7877
return err
7978
}
8079

81-
if err := translateIfSudoError(ioutil.WriteFile(
80+
if err := translateIfSudoError(os.WriteFile(
8281
opts.ConfigDir().DevelopmentCertificate(),
8382
append(cert, key...),
8483
0600),
@@ -119,7 +118,7 @@ func findReadAndDeleteFile(globPattern string) ([]byte, error) {
119118
return nil, fmt.Errorf("findReadAndDeleteFile: expected 1 match; got %d", len(globMatches))
120119
}
121120

122-
content, err := ioutil.ReadFile(globMatches[0])
121+
content, err := os.ReadFile(globMatches[0])
123122
if err != nil {
124123
return nil, err
125124
}

turbobob.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,14 @@
66
"builders": [
77
{
88
"name": "default",
9-
"uses": "docker://fn61/buildkit-golang:20231229_0955_79a9c09c",
9+
"uses": "docker://fn61/buildkit-golang:20240908_1146_f9b94bc0",
1010
"mount_source": "",
1111
"mount_destination": "/workspace",
1212
"workdir": "/workspace",
1313
"commands": {
1414
"build": ["build-go-project.sh", "--directory=cmd/edgerouter/", "--binary-basename=edgerouter"],
1515
"dev": ["bash"]
1616
},
17-
"dev_ports": ["80:80", "443:443"],
1817
"dev_shell_commands": [
1918
{ "command": "rel/edgerouter_linux-amd64 serve", "important": true },
2019
{ "command": "source env-discovery-dev.env && source env-docker-integration.env && bob tips", "important": true }

0 commit comments

Comments
 (0)