Skip to content

Commit ed2306d

Browse files
committed
Update controller to Flux 0.33 and Go 1.18
Signed-off-by: Stefan Prodan <[email protected]>
1 parent 9157596 commit ed2306d

File tree

7 files changed

+221
-152
lines changed

7 files changed

+221
-152
lines changed

.github/workflows/release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
fetch-depth: 0
2323
- uses: actions/setup-go@v2
2424
with:
25-
go-version: 1.17.x
25+
go-version: 1.18.x
2626
- uses: actions/cache@v2
2727
with:
2828
path: ~/go/pkg/mod

.github/workflows/test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- name: Setup Go
2323
uses: actions/setup-go@v2
2424
with:
25-
go-version: 1.17.x
25+
go-version: 1.18.x
2626
- name: Run tests
2727
run: make test
2828
- name: Check if working tree is dirty

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ manifests: controller-gen
5252

5353
# Run go tidy to cleanup go.mod
5454
tidy:
55-
go mod tidy
55+
rm -f go.sum; go mod tidy -compat=1.18
5656

5757
# Run go fmt against code
5858
fmt:

controllers/gitrepository_watcher.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ package controllers
1919
import (
2020
"bytes"
2121
"context"
22-
"crypto/sha1"
2322
"crypto/sha256"
2423
"fmt"
2524
"io"
@@ -140,13 +139,6 @@ func (r *GitRepositoryWatcher) fetchArtifact(ctx context.Context, repository sou
140139

141140
func (r *GitRepositoryWatcher) verifyArtifact(artifact *sourcev1.Artifact, buf *bytes.Buffer, reader io.Reader) error {
142141
hasher := sha256.New()
143-
144-
// for backwards compatibility with source-controller v0.17.2 and older
145-
if len(artifact.Checksum) == 40 {
146-
hasher = sha1.New()
147-
}
148-
149-
// compute checksum
150142
mw := io.MultiWriter(hasher, buf)
151143
if _, err := io.Copy(mw, reader); err != nil {
152144
return err

go.mod

Lines changed: 44 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,76 @@
11
module github.com/fluxcd/source-watcher
22

3-
go 1.17
3+
go 1.18
44

55
require (
6-
github.com/fluxcd/pkg/runtime v0.12.3
7-
github.com/fluxcd/pkg/untar v0.1.0
8-
github.com/fluxcd/source-controller/api v0.20.1
6+
github.com/fluxcd/pkg/runtime v0.17.0
7+
github.com/fluxcd/pkg/untar v0.2.0
8+
github.com/fluxcd/source-controller/api v0.28.0
99
github.com/spf13/pflag v1.0.5
10-
k8s.io/apimachinery v0.23.1
11-
k8s.io/client-go v0.23.1
12-
sigs.k8s.io/controller-runtime v0.11.0
10+
k8s.io/apimachinery v0.25.0
11+
k8s.io/client-go v0.25.0
12+
sigs.k8s.io/controller-runtime v0.12.3
1313
)
1414

1515
require (
16-
cloud.google.com/go v0.81.0 // indirect
16+
cloud.google.com/go v0.97.0 // indirect
17+
github.com/PuerkitoBio/purell v1.1.1 // indirect
18+
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
1719
github.com/beorn7/perks v1.0.1 // indirect
18-
github.com/cespare/xxhash/v2 v2.1.1 // indirect
20+
github.com/cespare/xxhash/v2 v2.1.2 // indirect
1921
github.com/davecgh/go-spew v1.1.1 // indirect
22+
github.com/emicklei/go-restful/v3 v3.8.0 // indirect
2023
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
21-
github.com/fluxcd/pkg/apis/acl v0.0.3 // indirect
22-
github.com/fluxcd/pkg/apis/meta v0.10.2 // indirect
24+
github.com/fluxcd/pkg/apis/acl v0.1.0 // indirect
25+
github.com/fluxcd/pkg/apis/meta v0.15.0 // indirect
2326
github.com/fsnotify/fsnotify v1.5.1 // indirect
24-
github.com/go-logr/logr v1.2.2 // indirect
25-
github.com/go-logr/zapr v1.2.0 // indirect
27+
github.com/go-logr/logr v1.2.3 // indirect
28+
github.com/go-logr/zapr v1.2.3 // indirect
29+
github.com/go-openapi/jsonpointer v0.19.5 // indirect
30+
github.com/go-openapi/jsonreference v0.19.5 // indirect
31+
github.com/go-openapi/swag v0.19.14 // indirect
2632
github.com/gogo/protobuf v1.3.2 // indirect
2733
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
2834
github.com/golang/protobuf v1.5.2 // indirect
29-
github.com/google/go-cmp v0.5.6 // indirect
35+
github.com/google/gnostic v0.5.7-v3refs // indirect
36+
github.com/google/go-cmp v0.5.8 // indirect
3037
github.com/google/gofuzz v1.2.0 // indirect
31-
github.com/google/uuid v1.1.2 // indirect
32-
github.com/googleapis/gnostic v0.5.5 // indirect
38+
github.com/google/uuid v1.3.0 // indirect
3339
github.com/imdario/mergo v0.3.12 // indirect
40+
github.com/josharian/intern v1.0.0 // indirect
3441
github.com/json-iterator/go v1.1.12 // indirect
42+
github.com/mailru/easyjson v0.7.6 // indirect
3543
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
3644
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
3745
github.com/modern-go/reflect2 v1.0.2 // indirect
46+
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
3847
github.com/pkg/errors v0.9.1 // indirect
39-
github.com/prometheus/client_golang v1.11.0 // indirect
48+
github.com/prometheus/client_golang v1.13.0 // indirect
4049
github.com/prometheus/client_model v0.2.0 // indirect
41-
github.com/prometheus/common v0.28.0 // indirect
42-
github.com/prometheus/procfs v0.6.0 // indirect
50+
github.com/prometheus/common v0.37.0 // indirect
51+
github.com/prometheus/procfs v0.8.0 // indirect
4352
go.uber.org/atomic v1.7.0 // indirect
4453
go.uber.org/multierr v1.6.0 // indirect
45-
go.uber.org/zap v1.19.1 // indirect
46-
golang.org/x/net v0.0.0-20211215060638-4ddde0e984e9 // indirect
47-
golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f // indirect
48-
golang.org/x/sys v0.0.0-20211029165221-6e7872819dc8 // indirect
49-
golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b // indirect
54+
go.uber.org/zap v1.23.0 // indirect
55+
golang.org/x/net v0.0.0-20220722155237-a158d28d115b // indirect
56+
golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b // indirect
57+
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f // indirect
58+
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
5059
golang.org/x/text v0.3.7 // indirect
51-
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect
60+
golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect
5261
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
5362
google.golang.org/appengine v1.6.7 // indirect
54-
google.golang.org/protobuf v1.27.1 // indirect
63+
google.golang.org/protobuf v1.28.1 // indirect
5564
gopkg.in/inf.v0 v0.9.1 // indirect
5665
gopkg.in/yaml.v2 v2.4.0 // indirect
57-
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
58-
k8s.io/api v0.23.1 // indirect
59-
k8s.io/apiextensions-apiserver v0.23.0 // indirect
60-
k8s.io/component-base v0.23.0 // indirect
61-
k8s.io/klog/v2 v2.30.0 // indirect
62-
k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65 // indirect
63-
k8s.io/utils v0.0.0-20211208161948-7d6a63dca704 // indirect
64-
sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2 // indirect
65-
sigs.k8s.io/structured-merge-diff/v4 v4.2.0 // indirect
66+
gopkg.in/yaml.v3 v3.0.1 // indirect
67+
k8s.io/api v0.25.0 // indirect
68+
k8s.io/apiextensions-apiserver v0.24.2 // indirect
69+
k8s.io/component-base v0.25.0 // indirect
70+
k8s.io/klog/v2 v2.70.1 // indirect
71+
k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 // indirect
72+
k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed // indirect
73+
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
74+
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
6675
sigs.k8s.io/yaml v1.3.0 // indirect
6776
)

0 commit comments

Comments
 (0)