Skip to content

Commit a9f3b6a

Browse files
committed
Move tools to dedicated module
This move allows to remove tool dependencies from the main mod file. This is beneficial to reduce false positives in security scanners, and to differentiate between CVEs in the operator code or its dependencies, vs CVEs in the dependencies of the tools used to build the operator. By moving the tools module to internal, we ensure that nobody can import the tools module. We had seen a few users importing this project as a Go library, even tho we never intended this project to be used as a library :)
1 parent b02afe5 commit a9f3b6a

File tree

6 files changed

+374
-150
lines changed

6 files changed

+374
-150
lines changed

Makefile

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -153,15 +153,6 @@ run::just-run
153153
just-run: ## Just runs 'go run main.go' without regenerating any manifests or deploying RBACs
154154
KUBECONFIG=${HOME}/.kube/config OPERATOR_NAMESPACE=$(K8S_OPERATOR_NAMESPACE) ENABLE_DEBUG_PPROF=true go run ./main.go -metrics-bind-address 127.0.0.1:9782 --zap-devel $(OPERATOR_ARGS)
155155

156-
.PHONY: delve
157-
delve::generate ## Deploys CRD, Namespace, RBACs and starts Delve debugger
158-
delve::install
159-
delve::deploy-namespace-rbac
160-
delve::just-delve
161-
162-
just-delve: install-tools ## Just starts Delve debugger
163-
KUBECONFIG=${HOME}/.kube/config OPERATOR_NAMESPACE=$(K8S_OPERATOR_NAMESPACE) dlv debug
164-
165156
install: manifests ## Install CRDs into a cluster
166157
kubectl apply -f config/crd/bases
167158

@@ -268,4 +259,4 @@ docker-registry-secret:
268259

269260
.PHONY: install-tools
270261
install-tools:
271-
grep _ tools/tools.go | awk -F '"' '{print $$2}' | xargs -t go install -mod=mod
262+
cd internal/tools; grep _ tools.go | awk -F '"' '{print $$2}' | xargs -t go install -mod=mod

go.mod

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -7,55 +7,38 @@ toolchain go1.23.0
77
require (
88
github.com/cloudflare/cfssl v1.6.5
99
github.com/eclipse/paho.mqtt.golang v1.5.0
10-
github.com/elastic/crd-ref-docs v0.1.0
1110
github.com/go-logr/logr v1.4.2
1211
github.com/go-stomp/stomp v2.1.4+incompatible
1312
github.com/michaelklishin/rabbit-hole/v2 v2.16.0
1413
github.com/onsi/ginkgo/v2 v2.22.2
1514
github.com/onsi/gomega v1.36.2
1615
github.com/rabbitmq/amqp091-go v1.10.0
1716
github.com/rabbitmq/rabbitmq-stream-go-client v1.4.11
18-
github.com/sclevine/yj v0.0.0-20210612025309-737bdf40a5d1
1917
golang.org/x/mod v0.22.0
2018
golang.org/x/net v0.33.0
2119
golang.org/x/text v0.21.0
22-
golang.org/x/vuln v1.1.3
2320
gopkg.in/ini.v1 v1.67.0
2421
k8s.io/api v0.31.2
2522
k8s.io/apimachinery v0.31.3
2623
k8s.io/client-go v0.31.2
2724
k8s.io/klog/v2 v2.130.1
2825
k8s.io/utils v0.0.0-20240921022957-49e7df575cb6
2926
sigs.k8s.io/controller-runtime v0.19.3
30-
sigs.k8s.io/controller-runtime/tools/setup-envtest v0.0.0-20240927101401-4381fa0aeee4
31-
sigs.k8s.io/controller-tools v0.16.5
32-
sigs.k8s.io/kind v0.26.0
33-
sigs.k8s.io/kustomize/kustomize/v5 v5.5.0
3427
)
3528

3629
require (
37-
github.com/BurntSushi/toml v1.4.0 // indirect
38-
github.com/Masterminds/goutils v1.1.1 // indirect
39-
github.com/Masterminds/semver v1.5.0 // indirect
40-
github.com/Masterminds/sprig v2.22.0+incompatible // indirect
41-
github.com/alessio/shellescape v1.4.2 // indirect
4230
github.com/beorn7/perks v1.0.1 // indirect
43-
github.com/blang/semver/v4 v4.0.0 // indirect
4431
github.com/cespare/xxhash/v2 v2.3.0 // indirect
4532
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
4633
github.com/emicklei/go-restful/v3 v3.12.1 // indirect
4734
github.com/evanphx/json-patch v5.7.0+incompatible // indirect
4835
github.com/evanphx/json-patch/v5 v5.9.0 // indirect
49-
github.com/fatih/color v1.18.0 // indirect
5036
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
51-
github.com/go-errors/errors v1.5.1 // indirect
5237
github.com/go-logr/zapr v1.3.0 // indirect
5338
github.com/go-openapi/jsonpointer v0.21.0 // indirect
5439
github.com/go-openapi/jsonreference v0.21.0 // indirect
5540
github.com/go-openapi/swag v0.23.0 // indirect
5641
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
57-
github.com/gobuffalo/flect v1.0.3 // indirect
58-
github.com/goccy/go-yaml v1.12.0 // indirect
5942
github.com/gogo/protobuf v1.3.2 // indirect
6043
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
6144
github.com/golang/protobuf v1.5.4 // indirect
@@ -65,45 +48,30 @@ require (
6548
github.com/google/go-cmp v0.6.0 // indirect
6649
github.com/google/gofuzz v1.2.0 // indirect
6750
github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad // indirect
68-
github.com/google/safetext v0.0.0-20240722112252-5a72de7e7962 // indirect
69-
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
7051
github.com/google/uuid v1.6.0 // indirect
7152
github.com/gorilla/websocket v1.5.3 // indirect
72-
github.com/hashicorp/hcl v1.0.0 // indirect
73-
github.com/huandu/xstrings v1.5.0 // indirect
7453
github.com/imdario/mergo v0.3.16 // indirect
75-
github.com/inconshreveable/mousetrap v1.1.0 // indirect
7654
github.com/jmoiron/sqlx v1.3.5 // indirect
7755
github.com/josharian/intern v1.0.0 // indirect
7856
github.com/json-iterator/go v1.1.12 // indirect
7957
github.com/klauspost/compress v1.17.10 // indirect
8058
github.com/mailru/easyjson v0.7.7 // indirect
81-
github.com/mattn/go-colorable v0.1.13 // indirect
82-
github.com/mattn/go-isatty v0.0.20 // indirect
83-
github.com/mitchellh/copystructure v1.2.0 // indirect
84-
github.com/mitchellh/reflectwalk v1.0.2 // indirect
8559
github.com/moby/spdystream v0.5.0 // indirect
8660
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
8761
github.com/modern-go/reflect2 v1.0.2 // indirect
88-
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect
8962
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
9063
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect
91-
github.com/pborman/uuid v1.2.1 // indirect
9264
github.com/pelletier/go-toml v1.9.5 // indirect
9365
github.com/pierrec/lz4 v2.6.1+incompatible // indirect
9466
github.com/pkg/errors v0.9.1 // indirect
9567
github.com/prometheus/client_golang v1.20.4 // indirect
9668
github.com/prometheus/client_model v0.6.1 // indirect
9769
github.com/prometheus/common v0.59.1 // indirect
9870
github.com/prometheus/procfs v0.15.1 // indirect
99-
github.com/sergi/go-diff v1.3.1 // indirect
10071
github.com/spaolacci/murmur3 v1.1.0 // indirect
101-
github.com/spf13/afero v1.11.0 // indirect
102-
github.com/spf13/cobra v1.8.1 // indirect
10372
github.com/spf13/pflag v1.0.5 // indirect
10473
github.com/weppos/publicsuffix-go v0.30.2-0.20230730094716-a20f9abcc222 // indirect
10574
github.com/x448/float16 v0.8.4 // indirect
106-
github.com/xlab/treeprint v1.2.0 // indirect
10775
github.com/zmap/zcrypto v0.0.0-20231219022726-a1f61fb1661c // indirect
10876
github.com/zmap/zlint/v3 v3.6.0 // indirect
10977
go.uber.org/multierr v1.11.0 // indirect
@@ -113,11 +81,9 @@ require (
11381
golang.org/x/oauth2 v0.23.0 // indirect
11482
golang.org/x/sync v0.10.0 // indirect
11583
golang.org/x/sys v0.28.0 // indirect
116-
golang.org/x/telemetry v0.0.0-20240916140951-1b7b43a8aaf2 // indirect
11784
golang.org/x/term v0.27.0 // indirect
11885
golang.org/x/time v0.6.0 // indirect
11986
golang.org/x/tools v0.28.0 // indirect
120-
golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da // indirect
12187
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
12288
google.golang.org/protobuf v1.36.1 // indirect
12389
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
@@ -127,9 +93,6 @@ require (
12793
k8s.io/apiextensions-apiserver v0.31.2 // indirect
12894
k8s.io/kube-openapi v0.0.0-20240903163716-9e1beecbcb38 // indirect
12995
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
130-
sigs.k8s.io/kustomize/api v0.18.0 // indirect
131-
sigs.k8s.io/kustomize/cmd/config v0.15.0 // indirect
132-
sigs.k8s.io/kustomize/kyaml v0.18.1 // indirect
13396
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
13497
sigs.k8s.io/yaml v1.4.0 // indirect
13598
)

0 commit comments

Comments
 (0)