Skip to content
This repository was archived by the owner on Apr 17, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
27 changes: 18 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ CONTROLLER_GEN ?= ${CURDIR}/bin/controller-gen

STATICCHECK ?= ${CURDIR}/bin/staticcheck

# This really could be left blank, and setup-envtest would just download the
# latest. But we may as well make it hermetic-ish by always downloading the
# same version. I doubt the version matters much (or at all).
ENVTEST_K8S_VERSION ?= 1.26.0
SETUP_ENVTEST ?= ${CURDIR}/bin/setup-envtest

# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
GOBIN ?= $(shell go env GOPATH)/bin

Expand All @@ -100,12 +106,9 @@ all: test docker-build
# Run tests
test: build test-only

test-only:
@echo
@echo "If tests fail due to no matches for kind \"CustomResourceDefinition\" in version \"apiextensions.k8s.io/v1\","
@echo "please remove the old kubebuilder and reinstall it - https://book.kubebuilder.io/quick-start.html#installation"
@echo
go test ${DIRS} -coverprofile cover.out
test-only: build-setup-envtest
KUBEBUILDER_ASSETS="$(shell ${SETUP_ENVTEST} use ${ENVTEST_K8S_VERSION} --bin-dir ${CURDIR}/bin -p path)" \
go test ${DIRS} -coverprofile cover.out

# Builds all binaries (manager and kubectl) and manifests
build: generate fmt vet staticcheck manifests
Expand Down Expand Up @@ -160,7 +163,7 @@ run: build
#
# We build the full manifest last so that the kustomization.yaml file is still
# there in case you want to rerun it manually.
manifests: controller-gen
manifests: build-controller-gen
@echo "Building manifests with image ${HNC_IMG}"
@# See the comment above about the 'paths' arguments
$(CONTROLLER_GEN) crd rbac:roleName=manager-role webhook paths="./api/..." paths="./cmd/..." paths="./internal/..." output:crd:artifacts:config=config/crd/bases
Expand Down Expand Up @@ -189,6 +192,8 @@ manifests: controller-gen

# Run go fmt against code
fmt:
@echo "Go version (for logging posterity):"
@go version
gofmt -l -w ${GOFMT_DIRS}

# check-fmt: Checks gofmt/go fmt has been ran. gofmt -l lists files whose formatting differs from gofmt's, so it fails if there are unformatted go code.
Expand All @@ -206,10 +211,11 @@ staticcheck: build-staticcheck
$(STATICCHECK) ${DIRS}

build-staticcheck:
@echo "If this next step fails, try updating honnef.co/go/tools in go.mod"
go build -o $(STATICCHECK) honnef.co/go/tools/cmd/staticcheck

# Generate code
generate: controller-gen
generate: build-controller-gen
$(CONTROLLER_GEN) object:headerFile=./hack/boilerplate.go.txt paths=./api/...

check-generate: generate
Expand All @@ -219,9 +225,12 @@ check-generate: generate

# Use the version of controller-gen that's checked into vendor/ (see
# hack/tools.go to see how it got there).
controller-gen:
build-controller-gen:
go build -o $(CONTROLLER_GEN) sigs.k8s.io/controller-tools/cmd/controller-gen

build-setup-envtest:
go build -o $(SETUP_ENVTEST) sigs.k8s.io/controller-runtime/tools/setup-envtest

###################### DEPLOYABLE ARTIFACTS AND ACTIONS #########################

# Deploy controller in the configured Kubernetes cluster in ~/.kube/config.
Expand Down
29 changes: 17 additions & 12 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
module sigs.k8s.io/hierarchical-namespaces

go 1.17
go 1.20

require (
contrib.go.opencensus.io/exporter/prometheus v0.4.0
contrib.go.opencensus.io/exporter/stackdriver v0.13.0
github.com/go-logr/logr v1.2.0
github.com/go-logr/zapr v1.2.0
github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 // indirect
github.com/onsi/ginkgo/v2 v2.1.3
github.com/onsi/ginkgo/v2 v2.1.4
github.com/onsi/gomega v1.19.0
github.com/open-policy-agent/cert-controller v0.2.1-0.20220125035755-54af89450964
github.com/spf13/cobra v1.2.1
go.opencensus.io v0.23.0
go.uber.org/zap v1.19.1
honnef.co/go/tools v0.3.0
honnef.co/go/tools v0.4.0
k8s.io/api v0.23.2
k8s.io/apiextensions-apiserver v0.23.2
k8s.io/apimachinery v0.23.2
Expand All @@ -32,7 +32,7 @@ require (
github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect
github.com/Azure/go-autorest/logger v0.2.1 // indirect
github.com/Azure/go-autorest/tracing v0.6.0 // indirect
github.com/BurntSushi/toml v0.4.1 // indirect
github.com/BurntSushi/toml v1.2.1 // indirect
github.com/PuerkitoBio/purell v1.1.1 // indirect
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
github.com/aws/aws-sdk-go v1.23.20 // indirect
Expand Down Expand Up @@ -89,16 +89,16 @@ require (
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 // indirect
golang.org/x/exp/typeparams v0.0.0-20220218215828-6cf2b201936e // indirect
golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3 // indirect
golang.org/x/net v0.0.0-20220403103023-749bd193bc2b // indirect
golang.org/x/exp/typeparams v0.0.0-20221208152030-732eee02a75a // indirect
golang.org/x/mod v0.7.0 // indirect
golang.org/x/net v0.3.0 // indirect
golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f // indirect
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
golang.org/x/sys v0.0.0-20220406163625-3f8b81556e12 // indirect
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
golang.org/x/text v0.3.7
golang.org/x/sync v0.1.0 // indirect
golang.org/x/sys v0.3.0 // indirect
golang.org/x/term v0.3.0 // indirect
golang.org/x/text v0.5.0
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect
golang.org/x/tools v0.1.11-0.20220316014157-77aa08bb151a // indirect
golang.org/x/tools v0.4.1-0.20221208213631-3f74d914ae6d // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
google.golang.org/api v0.44.0 // indirect
Expand All @@ -119,3 +119,8 @@ require (
sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)

require (
github.com/spf13/afero v1.6.0 // indirect
sigs.k8s.io/controller-runtime/tools/setup-envtest v0.0.0-20230208013708-22718275bffe // indirect
)
Loading