Skip to content

Commit d96216c

Browse files
authored
Merge pull request #7 from gianlucam76/bump
Bump go modules
2 parents 755ecda + b3b0108 commit d96216c

File tree

10 files changed

+194
-195
lines changed

10 files changed

+194
-195
lines changed

.github/workflows/main.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Set up Go
1919
uses: actions/setup-go@v4
2020
with:
21-
go-version: 1.20.8
21+
go-version: 1.22.0
2222
- name: Build
2323
run: make build
2424
- name: FMT
@@ -37,7 +37,7 @@ jobs:
3737
- name: Set up Go
3838
uses: actions/setup-go@v4
3939
with:
40-
go-version: 1.20.8
40+
go-version: 1.22.0
4141
- name: ut
4242
run: make test
4343
env:
@@ -50,7 +50,7 @@ jobs:
5050
- name: Set up Go
5151
uses: actions/setup-go@v4
5252
with:
53-
go-version: 1.20.8
53+
go-version: 1.22.0
5454
- name: fv
5555
run: make create-cluster fv
5656
env:

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Build the manager binary
2-
FROM golang:1.21 as builder
2+
FROM golang:1.22 as builder
33

44
WORKDIR /workspace
55
# Copy the Go Modules manifests

Makefile

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,22 +32,36 @@ GOLANGCI_LINT := $(TOOLS_BIN_DIR)/golangci-lint
3232
GOIMPORTS := $(TOOLS_BIN_DIR)/goimports
3333
GINKGO := $(TOOLS_BIN_DIR)/ginkgo
3434
KUBECTL := $(TOOLS_BIN_DIR)/kubectl
35-
SETUP_ENVTEST := $(TOOLS_BIN_DIR)/setup_envs
3635
CONTROLLER_GEN := $(TOOLS_BIN_DIR)/controller-gen
3736
KIND := $(TOOLS_BIN_DIR)/kind
3837

3938
GOLANGCI_LINT_VERSION := "v1.55.2"
4039

40+
KUSTOMIZE_VER := v4.5.2
41+
KUSTOMIZE_BIN := kustomize
42+
KUSTOMIZE := $(abspath $(TOOLS_BIN_DIR)/$(KUSTOMIZE_BIN)-$(KUSTOMIZE_VER))
43+
KUSTOMIZE_PKG := sigs.k8s.io/kustomize/kustomize/v4
44+
$(KUSTOMIZE): # Build kustomize from tools folder.
45+
CGO_ENABLED=0 GOBIN=$(TOOLS_BIN_DIR) $(GO_INSTALL) $(KUSTOMIZE_PKG) $(KUSTOMIZE_BIN) $(KUSTOMIZE_VER)
46+
47+
SETUP_ENVTEST_VER := v0.0.0-20240215143116-d0396a3d6f9f
48+
SETUP_ENVTEST_BIN := setup-envtest
49+
SETUP_ENVTEST := $(abspath $(TOOLS_BIN_DIR)/$(SETUP_ENVTEST_BIN)-$(SETUP_ENVTEST_VER))
50+
SETUP_ENVTEST_PKG := sigs.k8s.io/controller-runtime/tools/setup-envtest
51+
setup-envtest: $(SETUP_ENVTEST) ## Set up envtest (download kubebuilder assets)
52+
@echo KUBEBUILDER_ASSETS=$(KUBEBUILDER_ASSETS)
53+
54+
$(SETUP_ENVTEST_BIN): $(SETUP_ENVTEST) ## Build a local copy of setup-envtest.
55+
56+
$(SETUP_ENVTEST): # Build setup-envtest from tools folder.
57+
GOBIN=$(TOOLS_BIN_DIR) $(GO_INSTALL) $(SETUP_ENVTEST_PKG) $(SETUP_ENVTEST_BIN) $(SETUP_ENVTEST_VER)
4158

4259
$(CONTROLLER_GEN): $(TOOLS_DIR)/go.mod # Build controller-gen from tools folder.
4360
cd $(TOOLS_DIR); $(GOBUILD) -tags=tools -o $(subst $(TOOLS_DIR)/hack/tools/,,$@) sigs.k8s.io/controller-tools/cmd/controller-gen
4461

4562
$(GOLANGCI_LINT): # Build golangci-lint from tools folder.
4663
cd $(TOOLS_DIR); ./get-golangci-lint.sh $(GOLANGCI_LINT_VERSION)
4764

48-
$(SETUP_ENVTEST): $(TOOLS_DIR)/go.mod # Build setup-envtest from tools folder.
49-
cd $(TOOLS_DIR); $(GOBUILD) -tags=tools -o $(subst $(TOOLS_DIR)/hack/tools/,,$@) sigs.k8s.io/controller-runtime/tools/setup-envtest
50-
5165
$(GOIMPORTS):
5266
cd $(TOOLS_DIR); $(GOBUILD) -tags=tools -o $(subst $(TOOLS_DIR)/hack/tools/,,$@) golang.org/x/tools/cmd/goimports
5367

@@ -69,7 +83,7 @@ help: ## Display this help.
6983
##@ Tools
7084

7185
.PHONY: tools
72-
tools: $(GOLANGCI_LINT) $(GOIMPORTS) $(GINKGO) $(KUBECTL) $(SETUP_ENVTEST) $(CONTROLLER_GEN) ## build all tools
86+
tools: $(GOLANGCI_LINT) $(GOIMPORTS) $(KUSTOMIZE) $(GINKGO) $(KUBECTL) $(SETUP_ENVTEST) $(CONTROLLER_GEN) ## build all tools
7387

7488
.PHONY: clean
7589
clean: ## Remove all built tools
@@ -90,7 +104,11 @@ PKEY ?= id_rsa
90104

91105
.PHONY: docker-build
92106
docker-build: ## Build the docker image for k8s-collector
93-
docker build -t $(REGISTRY)/$(IMAGE_NAME)-$(ARCH):$(TAG) -f Dockerfile .
107+
docker build --load -t $(COLLECTOR_IMG):$(TAG) -f Dockerfile .
108+
109+
.PHONY: docker-buildx
110+
docker-buildx: ## docker build for multiple arch and push to docker hub
111+
docker buildx build --push --platform linux/amd64,linux/arm64 -t $(COLLECTOR_IMG):$(TAG) .
94112

95113
##@ Build
96114

@@ -137,7 +155,7 @@ endif
137155

138156
.PHONY: load-image
139157
load-image: docker-build $(KIND)
140-
$(KIND) load docker-image $(COLLECTOR_IMG)-$(ARCH):$(TAG) --name $(CONTROL_CLUSTER_NAME)
158+
$(KIND) load docker-image $(COLLECTOR_IMG):$(TAG) --name $(CONTROL_CLUSTER_NAME)
141159

142160
.PHONY: create-cluster
143161
create-cluster: $(KIND) $(KUBECTL) ## Create a new kind cluster designed for development

go.mod

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,43 @@
11
module github.com/gianlucam76/k8s_collector
22

3-
go 1.21
3+
go 1.22.0
44

55
require (
66
github.com/go-logr/logr v1.4.1
7-
github.com/onsi/ginkgo/v2 v2.17.1
8-
github.com/onsi/gomega v1.32.0
7+
github.com/onsi/ginkgo/v2 v2.17.2
8+
github.com/onsi/gomega v1.33.0
99
github.com/pkg/errors v0.9.1
10-
github.com/projectsveltos/libsveltos v0.26.0
10+
github.com/projectsveltos/libsveltos v0.28.0
1111
github.com/spf13/pflag v1.0.5
1212
gopkg.in/yaml.v2 v2.4.0
1313
gopkg.in/yaml.v3 v3.0.1
14-
k8s.io/api v0.29.3
15-
k8s.io/apimachinery v0.29.3
16-
k8s.io/client-go v0.29.3
17-
k8s.io/component-base v0.29.1
14+
k8s.io/api v0.29.4
15+
k8s.io/apimachinery v0.29.4
16+
k8s.io/client-go v0.29.4
17+
k8s.io/component-base v0.29.4
1818
k8s.io/klog/v2 v2.120.1
19-
sigs.k8s.io/controller-runtime v0.17.2
19+
sigs.k8s.io/controller-runtime v0.17.3
2020
)
2121

2222
require (
2323
github.com/beorn7/perks v1.0.1 // indirect
2424
github.com/cespare/xxhash/v2 v2.2.0 // indirect
2525
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
2626
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
27-
github.com/evanphx/json-patch/v5 v5.8.0 // indirect
27+
github.com/evanphx/json-patch/v5 v5.9.0 // indirect
2828
github.com/fsnotify/fsnotify v1.7.0 // indirect
2929
github.com/go-openapi/jsonpointer v0.19.6 // indirect
3030
github.com/go-openapi/jsonreference v0.20.2 // indirect
3131
github.com/go-openapi/swag v0.22.4 // indirect
32-
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
32+
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
3333
github.com/gogo/protobuf v1.3.2 // indirect
3434
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
3535
github.com/golang/protobuf v1.5.4 // indirect
3636
github.com/google/gnostic-models v0.6.8 // indirect
3737
github.com/google/go-cmp v0.6.0 // indirect
3838
github.com/google/gofuzz v1.2.0 // indirect
39-
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 // indirect
40-
github.com/google/uuid v1.3.1 // indirect
39+
github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6 // indirect
40+
github.com/google/uuid v1.4.0 // indirect
4141
github.com/imdario/mergo v0.3.13 // indirect
4242
github.com/inconshreveable/mousetrap v1.1.0 // indirect
4343
github.com/josharian/intern v1.0.0 // indirect
@@ -53,21 +53,21 @@ require (
5353
github.com/prometheus/procfs v0.12.0 // indirect
5454
github.com/spf13/cobra v1.8.0 // indirect
5555
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect
56-
golang.org/x/net v0.20.0 // indirect
57-
golang.org/x/oauth2 v0.14.0 // indirect
58-
golang.org/x/sys v0.16.0 // indirect
59-
golang.org/x/term v0.16.0 // indirect
56+
golang.org/x/net v0.24.0 // indirect
57+
golang.org/x/oauth2 v0.18.0 // indirect
58+
golang.org/x/sys v0.19.0 // indirect
59+
golang.org/x/term v0.19.0 // indirect
6060
golang.org/x/text v0.14.0 // indirect
61-
golang.org/x/time v0.3.0 // indirect
62-
golang.org/x/tools v0.17.0 // indirect
61+
golang.org/x/time v0.5.0 // indirect
62+
golang.org/x/tools v0.20.0 // indirect
6363
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
6464
google.golang.org/appengine v1.6.7 // indirect
6565
google.golang.org/protobuf v1.33.0 // indirect
6666
gopkg.in/inf.v0 v0.9.1 // indirect
67-
k8s.io/apiextensions-apiserver v0.29.1 // indirect
67+
k8s.io/apiextensions-apiserver v0.29.4 // indirect
6868
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 // indirect
69-
k8s.io/utils v0.0.0-20240102154912-e7106e64919e // indirect
70-
sigs.k8s.io/cluster-api v1.6.1 // indirect
69+
k8s.io/utils v0.0.0-20240310230437-4693a0247e57 // indirect
70+
sigs.k8s.io/cluster-api v1.7.0 // indirect
7171
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
7272
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
7373
sigs.k8s.io/yaml v1.4.0 // indirect

0 commit comments

Comments
 (0)