Skip to content

Commit 4406866

Browse files
authored
Maintenance changes (#64)
* Checkout before setting up Go This prevents the following error during setup step caused by missing dependency files. Warning: Restore cache failed: Dependencies file is not found in /home/runner/work/telefonistka/telefonistka. Supported file pattern: go.sum * Use Go version from go.mod This consolidates on a single place to specify the Go version. * Replace golang/mock with maintained Uber fork * Replace deprecated exportloopref with copyloopvar Using the deprecated linter results in the following warning. The linter 'exportloopref' is deprecated (since v1.60.2) due to: Since Go1.22 (loopvar) this linter is no longer relevant. Replaced by copyloopvar." Offenders of copyloopvar are removed as they result in the following. The copy of the 'for' variable "tt" can be deleted (Go 1.22+) (copyloopvar) As per https://go.dev/blog/loopvar-preview this should be all safe! * Stop vendoring dependencies Vendoring of dependencies is a strategy that can be useful for certain scenarios. This project does not need to use vendoring and it can be frustrating to work with as it has subtle side-effects in tooling that developers need to be aware of. Additionally, when vendoring is used, vendored dependencies should conventionally be checked in together with the rest of the code which is currently not done. Instead of vendoring switch to use go mod download for fetching dependencies and let the module system take care of the rest. The go.mod and go.sum file should specify all dependencies to achieve hermetic builds. * Upgrade dependencies This resolves a few dependency issues that are seemingly causing friction for security and dependabot updates. Mainly it drops the replace directives in go.mod and upgrades the following dependencies using go get. k8s.io/cli-runtime k8s.io/api k8s.io/apimachinery k8s.io/kubernetes k8s.io/controller-manager github.com/argoproj/argo-cd/v2 github.com/argoproj/gitops-engine@v0.7.1-0.20240905010810-bd7681ae3f8b k8s.io/kubectl sigs.k8s.io/controller-runtime One notable difference here is the upgrade of github.com/argoproj/argo-cd/v2 which further requires a code change to be compatible with new upstream API: it is now requires to pass in an installation ID when setting the instance ID for resource tracking. * Upgrade go-git to v5.13.1 This should fix [1] and [2]. [1] https://github.com/commercetools/telefonistka/security/dependabot/12 [2] https://github.com/commercetools/telefonistka/security/dependabot/13
1 parent 496aed4 commit 4406866

File tree

11 files changed

+258
-1546
lines changed

11 files changed

+258
-1546
lines changed

.github/workflows/lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ jobs:
3030
name: golangci-lint
3131
runs-on: ubuntu-latest
3232
steps:
33+
- uses: actions/checkout@v4
3334
- uses: actions/setup-go@v5
3435
with:
35-
go-version: 1.21
36-
- uses: actions/checkout@v4
36+
go-version-file: go.mod
3737
- run: make get-deps
3838
- run: go mod tidy -diff
3939
- name: golangci-lint

.golangci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ linters:
1010
- durationcheck
1111
- errcheck
1212
- errname
13-
- exportloopref
13+
- copyloopvar
1414
- gci
1515
- gochecknoinits
1616
- gofmt

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ get-deps: $(VENDOR_DIR)
1313

1414
$(VENDOR_DIR):
1515
go generate $$(go list ./internal/pkg/mocks/...)
16-
GO111MODULE=on go mod vendor
16+
go mod download
1717

1818
.PHONY: build
1919
build: $(VENDOR_DIR)

cmd/telefonistka/bump-version-yaml_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ image:
7676
}
7777

7878
for _, tt := range tests {
79-
tt := tt
8079
t.Run(tt.name, func(t *testing.T) {
8180
t.Parallel()
8281
got, err := updateYaml(tt.yamlContent, tt.address, tt.value)

go.mod

Lines changed: 71 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
module github.com/wayfair-incubator/telefonistka
22

3-
go 1.23
3+
go 1.23.0
44

55
toolchain go1.23.4
66

77
require github.com/alexliesenfeld/health v0.8.0
88

99
require (
10-
github.com/argoproj/argo-cd/v2 v2.11.7
11-
github.com/argoproj/gitops-engine v0.7.1-0.20240715141605-18ba62e1f1fb
12-
github.com/bradleyfalzon/ghinstallation/v2 v2.10.0
13-
github.com/cenkalti/backoff/v4 v4.2.1
10+
github.com/argoproj/argo-cd/v2 v2.13.3
11+
github.com/argoproj/gitops-engine v0.7.1-0.20240905010810-bd7681ae3f8b
12+
github.com/bradleyfalzon/ghinstallation/v2 v2.11.0
13+
github.com/cenkalti/backoff/v4 v4.3.0
1414
github.com/go-test/deep v1.1.1
15-
github.com/golang/mock v1.6.0
1615
github.com/google/go-github/v62 v62.0.0
1716
github.com/hashicorp/golang-lru/v2 v2.0.7
1817
github.com/hexops/gotextdiff v1.0.3
@@ -23,25 +22,26 @@ require (
2322
github.com/sirupsen/logrus v1.9.3
2423
github.com/spf13/cobra v1.8.1
2524
github.com/stretchr/testify v1.10.0
25+
go.uber.org/mock v0.5.0
2626
golang.org/x/exp v0.0.0-20241217172543-b2144cdd0a67
27-
golang.org/x/oauth2 v0.21.0
27+
golang.org/x/oauth2 v0.23.0
2828
golang.org/x/tools v0.29.0
29-
google.golang.org/grpc v1.63.2
29+
google.golang.org/grpc v1.66.2
3030
gopkg.in/yaml.v2 v2.4.0
31-
k8s.io/api v0.26.11
32-
k8s.io/apimachinery v0.26.11
31+
k8s.io/api v0.32.1
32+
k8s.io/apimachinery v0.32.1
3333
)
3434

3535
require (
3636
cloud.google.com/go/compute/metadata v0.3.0 // indirect
37-
dario.cat/mergo v1.0.0 // indirect
37+
dario.cat/mergo v1.0.1 // indirect
3838
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
3939
github.com/MakeNowJust/heredoc v1.0.0 // indirect
4040
github.com/Masterminds/goutils v1.1.1 // indirect
41-
github.com/Masterminds/semver/v3 v3.2.1 // indirect
42-
github.com/Masterminds/sprig/v3 v3.2.3 // indirect
43-
github.com/Microsoft/go-winio v0.6.1 // indirect
44-
github.com/ProtonMail/go-crypto v1.0.0 // indirect
41+
github.com/Masterminds/semver/v3 v3.3.0 // indirect
42+
github.com/Masterminds/sprig/v3 v3.3.0 // indirect
43+
github.com/Microsoft/go-winio v0.6.2 // indirect
44+
github.com/ProtonMail/go-crypto v1.1.3 // indirect
4545
github.com/a8m/envsubst v1.4.2 // indirect
4646
github.com/alecthomas/participle/v2 v2.1.1 // indirect
4747
github.com/argoproj/pkg v0.13.7-0.20230626144333-d56162821bd1 // indirect
@@ -52,28 +52,29 @@ require (
5252
github.com/cespare/xxhash/v2 v2.3.0 // indirect
5353
github.com/chai2010/gettext-go v1.0.2 // indirect
5454
github.com/cloudflare/circl v1.3.7 // indirect
55-
github.com/coreos/go-oidc/v3 v3.6.0 // indirect
56-
github.com/cyphar/filepath-securejoin v0.2.4 // indirect
55+
github.com/coreos/go-oidc/v3 v3.11.0 // indirect
56+
github.com/cyphar/filepath-securejoin v0.3.6 // indirect
5757
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
5858
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
5959
github.com/dimchansky/utfbom v1.1.1 // indirect
60-
github.com/docker/distribution v2.8.2+incompatible // indirect
60+
github.com/distribution/reference v0.6.0 // indirect
61+
github.com/dlclark/regexp2 v1.11.4 // indirect
6162
github.com/elliotchance/orderedmap v1.5.1 // indirect
6263
github.com/emicklei/go-restful/v3 v3.12.0 // indirect
6364
github.com/emirpasic/gods v1.18.1 // indirect
6465
github.com/evanphx/json-patch v5.9.0+incompatible // indirect
65-
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
66+
github.com/evanphx/json-patch/v5 v5.9.0 // indirect
6667
github.com/exponent-io/jsonpath v0.0.0-20210407135951-1de76d718b3f // indirect
6768
github.com/fatih/camelcase v1.0.0 // indirect
6869
github.com/fatih/color v1.16.0 // indirect
6970
github.com/felixge/httpsnoop v1.0.4 // indirect
70-
github.com/fvbommel/sortorder v1.1.0 // indirect
71+
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
7172
github.com/go-errors/errors v1.5.1 // indirect
7273
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
73-
github.com/go-git/go-billy/v5 v5.5.0 // indirect
74-
github.com/go-git/go-git/v5 v5.12.0 // indirect
75-
github.com/go-jose/go-jose/v3 v3.0.3 // indirect
76-
github.com/go-logr/logr v1.4.1 // indirect
74+
github.com/go-git/go-billy/v5 v5.6.1 // indirect
75+
github.com/go-git/go-git/v5 v5.13.1 // indirect
76+
github.com/go-jose/go-jose/v4 v4.0.2 // indirect
77+
github.com/go-logr/logr v1.4.2 // indirect
7778
github.com/go-logr/stdr v1.2.2 // indirect
7879
github.com/go-openapi/jsonpointer v0.21.0 // indirect
7980
github.com/go-openapi/jsonreference v0.21.0 // indirect
@@ -86,29 +87,27 @@ require (
8687
github.com/golang-jwt/jwt/v4 v4.5.0 // indirect
8788
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
8889
github.com/golang/protobuf v1.5.4 // indirect
89-
github.com/google/btree v1.1.2 // indirect
90-
github.com/google/gnostic v0.7.0 // indirect
90+
github.com/google/btree v1.1.3 // indirect
9191
github.com/google/gnostic-models v0.6.9-0.20230804172637-c7be7c783f49 // indirect
9292
github.com/google/go-cmp v0.6.0 // indirect
93-
github.com/google/go-github/v60 v60.0.0 // indirect
9493
github.com/google/go-github/v64 v64.0.0 // indirect
9594
github.com/google/go-querystring v1.1.0 // indirect
9695
github.com/google/gofuzz v1.2.0 // indirect
9796
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
9897
github.com/google/uuid v1.6.0 // indirect
9998
github.com/gorilla/mux v1.8.0 // indirect
100-
github.com/gosimple/slug v1.13.1 // indirect
99+
github.com/gorilla/websocket v1.5.3 // indirect
100+
github.com/gosimple/slug v1.14.0 // indirect
101101
github.com/gosimple/unidecode v1.0.1 // indirect
102102
github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 // indirect
103103
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect
104104
github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect
105105
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
106-
github.com/hashicorp/go-retryablehttp v0.7.4 // indirect
107-
github.com/huandu/xstrings v1.3.3 // indirect
108-
github.com/imdario/mergo v0.3.16 // indirect
106+
github.com/hashicorp/go-retryablehttp v0.7.7 // indirect
107+
github.com/huandu/xstrings v1.5.0 // indirect
109108
github.com/inconshreveable/mousetrap v1.1.0 // indirect
110-
github.com/itchyny/gojq v0.12.13 // indirect
111-
github.com/itchyny/timefmt-go v0.1.5 // indirect
109+
github.com/itchyny/gojq v0.12.16 // indirect
110+
github.com/itchyny/timefmt-go v0.1.6 // indirect
112111
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
113112
github.com/jinzhu/copier v0.4.0 // indirect
114113
github.com/jonboulle/clockwork v0.4.0 // indirect
@@ -122,90 +121,88 @@ require (
122121
github.com/mailru/easyjson v0.7.7 // indirect
123122
github.com/mattn/go-colorable v0.1.13 // indirect
124123
github.com/mattn/go-isatty v0.0.20 // indirect
125-
github.com/mitchellh/copystructure v1.0.0 // indirect
124+
github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1 // indirect
125+
github.com/mitchellh/copystructure v1.2.0 // indirect
126126
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
127-
github.com/mitchellh/reflectwalk v1.0.0 // indirect
128-
github.com/moby/spdystream v0.2.0 // indirect
127+
github.com/mitchellh/reflectwalk v1.0.2 // indirect
128+
github.com/moby/spdystream v0.5.0 // indirect
129129
github.com/moby/term v0.5.0 // indirect
130130
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
131131
github.com/modern-go/reflect2 v1.0.2 // indirect
132132
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect
133133
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
134-
github.com/onsi/ginkgo/v2 v2.15.0 // indirect
135-
github.com/onsi/gomega v1.31.0 // indirect
134+
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect
136135
github.com/opencontainers/go-digest v1.0.0 // indirect
137136
github.com/opencontainers/image-spec v1.1.0 // indirect
138137
github.com/patrickmn/go-cache v2.1.0+incompatible // indirect
139138
github.com/pelletier/go-toml/v2 v2.2.0 // indirect
140139
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect
141140
github.com/pjbgf/sha1cd v0.3.0 // indirect
142141
github.com/pkg/errors v0.9.1 // indirect
143-
github.com/pmezard/go-difflib v1.0.0 // indirect
142+
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
144143
github.com/prometheus/client_model v0.6.1 // indirect
145144
github.com/prometheus/common v0.55.0 // indirect
146145
github.com/prometheus/procfs v0.15.1 // indirect
147146
github.com/r3labs/diff v1.1.0 // indirect
148-
github.com/redis/go-redis/v9 v9.5.1 // indirect
147+
github.com/redis/go-redis/v9 v9.6.1 // indirect
149148
github.com/robfig/cron/v3 v3.0.1 // indirect
150149
github.com/russross/blackfriday/v2 v2.1.0 // indirect
151150
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect
152-
github.com/shopspring/decimal v1.2.0 // indirect
151+
github.com/shopspring/decimal v1.4.0 // indirect
153152
github.com/shurcooL/graphql v0.0.0-20230722043721-ed46e5a46466 // indirect
154-
github.com/skeema/knownhosts v1.2.2 // indirect
155-
github.com/spf13/cast v1.6.0 // indirect
153+
github.com/skeema/knownhosts v1.3.0 // indirect
154+
github.com/spf13/cast v1.7.0 // indirect
156155
github.com/spf13/pflag v1.0.5 // indirect
157156
github.com/valyala/bytebufferpool v1.0.0 // indirect
158157
github.com/valyala/fasttemplate v1.2.2 // indirect
159158
github.com/vmihailenco/go-tinylfu v0.2.2 // indirect
160159
github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect
161160
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
161+
github.com/x448/float16 v0.8.4 // indirect
162162
github.com/xanzy/ssh-agent v0.3.3 // indirect
163163
github.com/xlab/treeprint v1.2.0 // indirect
164164
github.com/yuin/gopher-lua v1.1.1 // indirect
165-
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.50.0 // indirect
166-
go.opentelemetry.io/otel v1.25.0 // indirect
167-
go.opentelemetry.io/otel/metric v1.25.0 // indirect
168-
go.opentelemetry.io/otel/trace v1.25.0 // indirect
169-
go.starlark.net v0.0.0-20240408152805-3f0a3703c02a // indirect
165+
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.55.0 // indirect
166+
go.opentelemetry.io/otel v1.30.0 // indirect
167+
go.opentelemetry.io/otel/metric v1.30.0 // indirect
168+
go.opentelemetry.io/otel/trace v1.30.0 // indirect
169+
go.uber.org/automaxprocs v1.5.3 // indirect
170170
golang.org/x/crypto v0.32.0 // indirect
171-
golang.org/x/mod v0.22.0 // indirect
172171
golang.org/x/net v0.34.0 // indirect
173172
golang.org/x/sync v0.10.0 // indirect
174173
golang.org/x/sys v0.29.0 // indirect
175174
golang.org/x/term v0.28.0 // indirect
176175
golang.org/x/text v0.21.0 // indirect
177-
golang.org/x/time v0.5.0 // indirect
176+
golang.org/x/time v0.7.0 // indirect
178177
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
179178
google.golang.org/genproto v0.0.0-20240401170217-c3f982113cda // indirect
180-
google.golang.org/genproto/googleapis/api v0.0.0-20240401170217-c3f982113cda // indirect
181-
google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect
182-
google.golang.org/protobuf v1.34.2 // indirect
179+
google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 // indirect
180+
google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // indirect
181+
google.golang.org/protobuf v1.35.1 // indirect
182+
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
183183
gopkg.in/inf.v0 v0.9.1 // indirect
184184
gopkg.in/op/go-logging.v1 v1.0.0-20160211212156-b2cb9fa56473 // indirect
185185
gopkg.in/warnings.v0 v0.1.2 // indirect
186186
gopkg.in/yaml.v3 v3.0.1 // indirect
187-
k8s.io/apiextensions-apiserver v0.26.10 // indirect
188-
k8s.io/apiserver v0.26.11 // indirect
189-
k8s.io/cli-runtime v0.26.11 // indirect
190-
k8s.io/client-go v0.26.11 // indirect
191-
k8s.io/component-base v0.26.11 // indirect
192-
k8s.io/component-helpers v0.26.11 // indirect
193-
k8s.io/klog/v2 v2.120.1 // indirect
194-
k8s.io/kube-aggregator v0.26.4 // indirect
195-
k8s.io/kube-openapi v0.0.0-20240403164606-bc84c2ddaf99 // indirect
196-
k8s.io/kubectl v0.26.4 // indirect
197-
k8s.io/kubernetes v1.26.11 // indirect
198-
k8s.io/utils v0.0.0-20240310230437-4693a0247e57 // indirect
187+
k8s.io/apiextensions-apiserver v0.32.0 // indirect
188+
k8s.io/apiserver v0.32.1 // indirect
189+
k8s.io/cli-runtime v0.32.1 // indirect
190+
k8s.io/client-go v0.32.1 // indirect
191+
k8s.io/component-base v0.32.1 // indirect
192+
k8s.io/component-helpers v0.32.1 // indirect
193+
k8s.io/controller-manager v0.32.1 // indirect
194+
k8s.io/klog/v2 v2.130.1 // indirect
195+
k8s.io/kube-aggregator v0.31.2 // indirect
196+
k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f // indirect
197+
k8s.io/kubectl v0.32.1 // indirect
198+
k8s.io/kubernetes v1.32.1 // indirect
199+
k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 // indirect
199200
layeh.com/gopher-json v0.0.0-20190114024228-97fed8db8427 // indirect
200201
oras.land/oras-go/v2 v2.5.0 // indirect
201-
sigs.k8s.io/controller-runtime v0.14.7 // indirect
202-
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
203-
sigs.k8s.io/kustomize/api v0.17.1 // indirect
204-
sigs.k8s.io/kustomize/kyaml v0.17.0 // indirect
205-
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
202+
sigs.k8s.io/controller-runtime v0.20.0 // indirect
203+
sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 // indirect
204+
sigs.k8s.io/kustomize/api v0.18.0 // indirect
205+
sigs.k8s.io/kustomize/kyaml v0.18.1 // indirect
206+
sigs.k8s.io/structured-merge-diff/v4 v4.4.2 // indirect
206207
sigs.k8s.io/yaml v1.4.0 // indirect
207208
)
208-
209-
replace sigs.k8s.io/kustomize/api => sigs.k8s.io/kustomize/api v0.12.1
210-
211-
replace sigs.k8s.io/kustomize/kyaml => sigs.k8s.io/kustomize/kyaml v0.13.9

0 commit comments

Comments
 (0)