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 c65b0d1
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 364 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
19 changes: 11 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,13 @@ TOOLS_DIR := hack/tools
TOOLS_BIN_DIR := $(abspath $(TOOLS_DIR)/$(BIN_DIR))

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

CONTROLLER_GEN = hack/tools/bin/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 +192,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 +320,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 c65b0d1

Please sign in to comment.