Skip to content

Commit

Permalink
Remove hack/tools go module
Browse files Browse the repository at this point in the history
The hack/tools go module seems to exist just so we could install
kustomize and controller-gen. These can be installed now with `go
install`, and we have already installed `golangci_lint` that way.

Signed-off-by: Huy Mai <[email protected]>
  • Loading branch information
mquhuy committed May 30, 2024
1 parent c91577a commit 8f50d28
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 368 deletions.
2 changes: 0 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ COPY go.mod go.mod
COPY go.sum go.sum
COPY apis/go.mod apis/go.mod
COPY apis/go.sum apis/go.sum
COPY hack/tools/go.mod hack/tools/go.mod
COPY hack/tools/go.sum hack/tools/go.sum
COPY pkg/hardwareutils/go.mod pkg/hardwareutils/go.mod
COPY pkg/hardwareutils/go.sum pkg/hardwareutils/go.sum
RUN go mod download
Expand Down
23 changes: 12 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,16 @@ ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
# instead of storing it
#
#
BIN_DIR := bin
TOOLS_DIR := hack/tools
TOOLS_BIN_DIR := $(abspath $(TOOLS_DIR)/$(BIN_DIR))
TOOLS_BIN_DIR := $(abspath $(hack/tools/bin))

CRD_OPTIONS ?= "crd:allowDangerousTypes=true,crdVersions=v1"
KUSTOMIZE = tools/bin/kustomize
CONTROLLER_GEN = tools/bin/controller-gen
KUSTOMIZE = $(TOOLS_BIN_DIR)/kustomize
KUSTOMIZE_PKG = sigs.k8s.io/kustomize/kustomize/v4
KUSTOMIZE_VER = v4.5.7

CONTROLLER_GEN = $(TOOLS_BIN_DIR)/controller-gen
CONTROLLER_GEN_PKG = sigs.k8s.io/controller-tools/cmd/controller-gen
CONTROLLER_GEN_VER = v0.12.1
GINKGO = tools/bin/ginkgo
GINKGO_VER = v2.17.1

Expand Down Expand Up @@ -187,11 +190,11 @@ deploy: $(KUSTOMIZE) manifests ## Deploy controller in the configured Kubernete
make set-manifest-image-bmo MANIFEST_IMG=$(IMG_NAME) MANIFEST_TAG=$(IMG_TAG)
$< build config/default | kubectl apply -f -

$(CONTROLLER_GEN): hack/tools/go.mod
cd hack/tools; go build -o $(abspath $@) sigs.k8s.io/controller-tools/cmd/controller-gen
$(CONTROLLER_GEN):
GOBIN=$(TOOLS_BIN_DIR) go install $(CONTROLLER_GEN_PKG)@$(CONTROLLER_GEN_VER)

$(KUSTOMIZE): hack/tools/go.mod
cd hack/tools; go build -o $(abspath $@) sigs.k8s.io/kustomize/kustomize/v4
$(KUSTOMIZE):
GOBIN=$(TOOLS_BIN_DIR) go install $(KUSTOMIZE_PKG)@$(KUSTOMIZE_VER)

.PHONY: build-e2e
build-e2e:
Expand Down Expand Up @@ -315,8 +318,6 @@ mod: ## Clean up go module settings
cd apis; go mod verify
cd pkg/hardwareutils; go mod tidy
cd pkg/hardwareutils; go mod verify
cd hack/tools; go mod tidy
cd hack/tools; go mod verify
cd test; go mod tidy
cd test; go mod verify

Expand Down
2 changes: 1 addition & 1 deletion docs/releasing.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ This triggers two things:

We also need to create one or more tags for the Go modules ecosystem:

- For any subdirectory with `go.mod` in it (excluding `hack/tools`), create
- For any subdirectory with `go.mod` in it, create
another Git tag with directory prefix, ie. `git tag apis/v0.x.y`,
`git tag test/v0.x.y` and `git tag pkg/hardwareutils/v0.x.y`. This enables the
tags to be used as a Gomodule version for any downstream users. **NOTE**: Do
Expand Down
70 changes: 0 additions & 70 deletions hack/tools/go.mod

This file was deleted.

Loading

0 comments on commit 8f50d28

Please sign in to comment.