Skip to content

Commit e96e779

Browse files
authored
replace go-install with µget, cleanup Makefile (#418)
1 parent 69737ee commit e96e779

15 files changed

Lines changed: 1089 additions & 430 deletions

Makefile

Lines changed: 154 additions & 238 deletions
Large diffs are not rendered by default.

contrib/kcp/Makefile

Lines changed: 10 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -12,44 +12,20 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
# We need bash for some conditional logic below.
16-
SHELL := /usr/bin/env bash -e
15+
ROOT_DIR = $(abspath ../..)
1716

18-
ROOT_DIR=$(abspath ../..)
19-
GO_INSTALL = $(ROOT_DIR)/hack/go-install.sh
20-
TOOLS_GOBIN_DIR = $(ROOT_DIR)/hack/tools
21-
GOBIN_DIR = $(ROOT_DIR)/bin
22-
PATH := $(GOBIN_DIR):$(TOOLS_GOBIN_DIR):$(PATH)
23-
TMPDIR := $(shell mktemp -d)
17+
export UGET_DIRECTORY := $(ROOT_DIR)/hack/tools
18+
export UGET_CHECKSUMS := $(ROOT_DIR)/hack/tools.checksums
19+
export UGET_VERSIONED_BINARIES = true
2420

25-
# Detect the path used for the install target
26-
ifeq (,$(shell go env GOBIN))
27-
INSTALL_GOBIN=$(shell go env GOPATH)/bin
28-
else
29-
INSTALL_GOBIN=$(shell go env GOBIN)
30-
endif
21+
KCP_APIGEN_VERSION := v0.28.0
3122

32-
33-
KCP_APIGEN_VER := v0.28.0
34-
KCP_APIGEN_BIN := apigen
35-
KCP_APIGEN_GEN := $(TOOLS_GOBIN_DIR)/$(KCP_APIGEN_BIN)-$(KCP_APIGEN_VER)
36-
export KCP_APIGEN_GEN # so hack scripts can use it
37-
38-
all: build
3923
.PHONY: all
24+
all: build
4025

41-
.PHONY: require-%
42-
require-%:
43-
@if ! command -v $* 1> /dev/null 2>&1; then echo "$* not found in \$$PATH"; exit 1; fi
44-
45-
# KCP tool installation targets
46-
$(KCP_APIGEN_GEN):
47-
GOBIN=$(TOOLS_GOBIN_DIR) $(GO_INSTALL) github.com/kcp-dev/kcp/sdk/cmd/apigen $(KCP_APIGEN_BIN) $(KCP_APIGEN_VER)
48-
49-
# KCP runtime targets
50-
run-kcp: $(KCP) ## Start KCP server
51-
$(KCP) start -v=8
26+
.PHONY: install-apigen
27+
install-apigen:
28+
@GO_MODULE=true $(ROOT_DIR)/hack/uget.sh github.com/kcp-dev/kcp/sdk/cmd/apigen apigen $(KCP_APIGEN_VERSION)
5229

53-
# Generate KCP API resources
54-
codegen: $(KCP_APIGEN_GEN) ## Generate KCP API resources from CRDs
30+
codegen: ## Generate KCP API resources from CRDs
5531
./hack/update-kcp-codegen.sh

contrib/kcp/hack/update-kcp-codegen.sh

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,10 @@
1717
set -o errexit
1818
set -o nounset
1919
set -o pipefail
20-
set -o xtrace
2120

22-
if [[ -z "${MAKELEVEL:-}" ]]; then
23-
echo 'You must invoke this script via make'
24-
exit 1
25-
fi
21+
cd "$(dirname "$0")/../../.."
2622

27-
REPO_ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." && pwd)
23+
APIGEN="$(UGET_PRINT_PATH=absolute make -C contrib/kcp --no-print-directory install-apigen)"
2824

2925
# Generate kcp API resources from CRDs
30-
(
31-
${KCP_APIGEN_GEN} --input-dir "${REPO_ROOT}"/deploy/crd --output-dir "${REPO_ROOT}"/contrib/kcp/deploy/resources
32-
)
26+
"$APIGEN" --input-dir deploy/crd --output-dir contrib/kcp/deploy/resources

go.mod

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ require (
2525
github.com/gorilla/mux v1.8.1
2626
github.com/gorilla/securecookie v1.1.1
2727
github.com/headzoo/surf v1.0.1
28-
github.com/kcp-dev/code-generator/v3 v3.0.0-20250707080944-4094fb87e20f
2928
github.com/kcp-dev/kcp/pkg/apis v0.11.0
3029
github.com/kcp-dev/kcp/sdk v0.28.1
3130
github.com/kcp-dev/multicluster-provider v0.2.1-0.20251002133408-9a8d21dc2872
@@ -53,7 +52,6 @@ require (
5352
k8s.io/klog/v2 v2.130.1
5453
k8s.io/utils v0.0.0-20250604170112-4c0f3b243397
5554
sigs.k8s.io/controller-runtime v0.21.0
56-
sigs.k8s.io/controller-tools v0.16.1
5755
sigs.k8s.io/multicluster-runtime v0.21.0-alpha.9.0.20251002124257-36facc7fbe82
5856
sigs.k8s.io/yaml v1.6.0
5957
)
@@ -67,14 +65,12 @@ require (
6765
github.com/antlr4-go/antlr/v4 v4.13.1 // indirect
6866
github.com/beorn7/perks v1.0.1 // indirect
6967
github.com/blang/semver/v4 v4.0.0 // indirect
70-
github.com/bombsimon/logrusr/v3 v3.1.0 // indirect
7168
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
7269
github.com/cespare/xxhash/v2 v2.3.0 // indirect
7370
github.com/coreos/go-semver v0.3.1 // indirect
7471
github.com/coreos/go-systemd/v22 v22.5.0 // indirect
7572
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
7673
github.com/emicklei/go-restful/v3 v3.12.2 // indirect
77-
github.com/fatih/color v1.18.0 // indirect
7874
github.com/felixge/httpsnoop v1.0.4 // indirect
7975
github.com/fsnotify/fsnotify v1.9.0 // indirect
8076
github.com/fxamacker/cbor/v2 v2.9.0 // indirect
@@ -87,7 +83,6 @@ require (
8783
github.com/go-openapi/jsonpointer v0.21.0 // indirect
8884
github.com/go-openapi/jsonreference v0.21.0 // indirect
8985
github.com/go-openapi/swag v0.23.0 // indirect
90-
github.com/gobuffalo/flect v1.0.2 // indirect
9186
github.com/gogo/protobuf v1.3.2 // indirect
9287
github.com/golang/protobuf v1.5.4 // indirect
9388
github.com/google/btree v1.1.3 // indirect
@@ -106,8 +101,6 @@ require (
106101
github.com/kylelemons/godebug v1.1.0 // indirect
107102
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect
108103
github.com/mailru/easyjson v0.9.0 // indirect
109-
github.com/mattn/go-colorable v0.1.13 // indirect
110-
github.com/mattn/go-isatty v0.0.20 // indirect
111104
github.com/moby/term v0.5.2 // indirect
112105
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
113106
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect
@@ -121,7 +114,6 @@ require (
121114
github.com/prometheus/client_model v0.6.1 // indirect
122115
github.com/prometheus/common v0.62.0 // indirect
123116
github.com/prometheus/procfs v0.15.1 // indirect
124-
github.com/sirupsen/logrus v1.9.3 // indirect
125117
github.com/stoewer/go-strcase v1.3.0 // indirect
126118
github.com/tidwall/match v1.1.1 // indirect
127119
github.com/tidwall/pretty v1.2.0 // indirect
@@ -163,7 +155,6 @@ require (
163155
google.golang.org/protobuf v1.36.5 // indirect
164156
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
165157
gopkg.in/inf.v0 v0.9.1 // indirect
166-
gopkg.in/yaml.v2 v2.4.0 // indirect
167158
k8s.io/gengo/v2 v2.0.0-20250604051438-85fd79dbfd9f // indirect
168159
k8s.io/kube-openapi v0.0.0-20250710124328-f3f2b991d03b // indirect
169160
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.2 // indirect

go.sum

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
1414
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
1515
github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM=
1616
github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ=
17-
github.com/bombsimon/logrusr/v3 v3.1.0 h1:zORbLM943D+hDMGgyjMhSAz/iDz86ZV72qaak/CA0zQ=
18-
github.com/bombsimon/logrusr/v3 v3.1.0/go.mod h1:PksPPgSFEL2I52pla2glgCyyd2OqOHAnFF5E+g8Ixco=
1917
github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8=
2018
github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
2119
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
@@ -43,8 +41,6 @@ github.com/evanphx/json-patch v5.9.11+incompatible h1:ixHHqfcGvxhWkniF1tWxBHA0yb
4341
github.com/evanphx/json-patch v5.9.11+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
4442
github.com/evanphx/json-patch/v5 v5.9.11 h1:/8HVnzMq13/3x9TPvjG08wUGqBTmZBsCWzjTM0wiaDU=
4543
github.com/evanphx/json-patch/v5 v5.9.11/go.mod h1:3j+LviiESTElxA4p3EMKAB9HXj3/XEtnUf6OZxqIQTM=
46-
github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM=
47-
github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU=
4844
github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=
4945
github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
5046
github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k=
@@ -72,8 +68,6 @@ github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+Gr
7268
github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ=
7369
github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI=
7470
github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8=
75-
github.com/gobuffalo/flect v1.0.2 h1:eqjPGSo2WmjgY2XlpGwo2NXgL3RucAKo4k4qQMNA5sA=
76-
github.com/gobuffalo/flect v1.0.2/go.mod h1:A5msMlrHtLqh9umBSnvabjsMrCcCpAyzglnDvkbYKHs=
7771
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
7872
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
7973
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
@@ -130,8 +124,6 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr
130124
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
131125
github.com/kcp-dev/apimachinery/v2 v2.0.1-0.20250728122101-adbf20db3e51 h1:l38RDS+VUMx9etvyaCgJIZa4nM7FaNevNubWN0kDZY4=
132126
github.com/kcp-dev/apimachinery/v2 v2.0.1-0.20250728122101-adbf20db3e51/go.mod h1:rF1jfvUfPjFXs+HV/LN1BtPzAz1bfjJOwVa+hAVfroQ=
133-
github.com/kcp-dev/code-generator/v3 v3.0.0-20250707080944-4094fb87e20f h1:Qfpk7+Y5gwWV8FNY6zu+l5hbKWlFZ6oJqgL67RoCEJg=
134-
github.com/kcp-dev/code-generator/v3 v3.0.0-20250707080944-4094fb87e20f/go.mod h1:1EZhJqiFvXq1N0xKJnJOf8kQ++wuwLkqFGIRVSoVACk=
135127
github.com/kcp-dev/kcp/pkg/apis v0.11.0 h1:K6p+tNHNcvfACCPLcHgY0EMLeaIwR1jS491FyLfXMII=
136128
github.com/kcp-dev/kcp/pkg/apis v0.11.0/go.mod h1:8cUAmfMJcksauz53UtsLYG8Phhx62rvuCnd/5t/Zihk=
137129
github.com/kcp-dev/kcp/sdk v0.28.1 h1:bTtuHVjFRjbwFEqXTPxc1J1JP2Hc3mTYqQ2xfJsi16M=
@@ -159,11 +151,6 @@ github.com/mailru/easyjson v0.9.0 h1:PrnmzHw7262yW8sTBwxi1PdJA3Iw/EKBa8psRf7d9a4
159151
github.com/mailru/easyjson v0.9.0/go.mod h1:1+xMtQp2MRNVL/V1bOzuP3aP8VNwRW55fQUto+XFtTU=
160152
github.com/martinlindhe/base36 v1.1.1 h1:1F1MZ5MGghBXDZ2KJ3QfxmiydlWOGB8HCEtkap5NkVg=
161153
github.com/martinlindhe/base36 v1.1.1/go.mod h1:vMS8PaZ5e/jV9LwFKlm0YLnXl/hpOihiBxKkIoc3g08=
162-
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
163-
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
164-
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
165-
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
166-
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
167154
github.com/moby/term v0.5.2 h1:6qk3FJAFDs6i/q3W/pQ97SX192qKfZgGjCQqfCJkgzQ=
168155
github.com/moby/term v0.5.2/go.mod h1:d3djjFCrjnB+fl8NJux+EJzu0msscUP+f8it8hPkFLc=
169156
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
@@ -176,10 +163,6 @@ github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 h1:n6/
176163
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00/go.mod h1:Pm3mSP3c5uWn86xMLZ5Sa7JB9GsEZySvHYXCTK4E9q4=
177164
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
178165
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
179-
github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
180-
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
181-
github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE=
182-
github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU=
183166
github.com/onsi/ginkgo/v2 v2.22.1 h1:QW7tbJAUDyVDVOM5dFa7qaybo+CRfR7bemlQUN6Z8aM=
184167
github.com/onsi/ginkgo/v2 v2.22.1/go.mod h1:S6aTpoRsSq2cZOd+pssHAlKW/Q/jZt6cPrPlnj4a1xM=
185168
github.com/onsi/gomega v1.36.2 h1:koNYke6TVk6ZmnyHrCXba/T/MoLBXFjeC1PtvYgw0A8=
@@ -352,11 +335,8 @@ golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7w
352335
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
353336
golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
354337
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
355-
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
356338
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
357-
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
358339
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
359-
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
360340
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
361341
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
362342
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
@@ -430,10 +410,6 @@ gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
430410
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
431411
gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc=
432412
gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc=
433-
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
434-
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
435-
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
436-
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
437413
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
438414
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
439415
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
@@ -467,8 +443,6 @@ sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.2 h1:jpcvIRr3GLoUo
467443
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.2/go.mod h1:Ve9uj1L+deCXFrPOk1LpFXqTg7LCFzFso6PA48q/XZw=
468444
sigs.k8s.io/controller-runtime v0.21.0 h1:CYfjpEuicjUecRk+KAeyYh+ouUBn4llGyDYytIGcJS8=
469445
sigs.k8s.io/controller-runtime v0.21.0/go.mod h1:OSg14+F65eWqIu4DceX7k/+QRAbTTvxeQSNSOQpukWM=
470-
sigs.k8s.io/controller-tools v0.16.1 h1:gvIsZm+2aimFDIBiDKumR7EBkc+oLxljoUVfRbDI6RI=
471-
sigs.k8s.io/controller-tools v0.16.1/go.mod h1:0I0xqjR65YTfoO12iR+mZR6s6UAVcUARgXRlsu0ljB0=
472446
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 h1:gBQPwqORJ8d8/YNZWEjoZs7npUVDpVXUUOFfW6CgAqE=
473447
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8/go.mod h1:mdzfpAEoE6DHQEN0uh9ZbOCuHbLK5wOm7dK4ctXE9Tg=
474448
sigs.k8s.io/kustomize/api v0.20.1 h1:iWP1Ydh3/lmldBnH/S5RXgT98vWYMaTUL1ADcr+Sv7I=

hack/build-image.sh

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright 2025 The Kube Bind Authors.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
set -eu
18+
19+
echo "Building images locally with tag $REV for platforms: $PLATFORMS"
20+
21+
command -v docker >/dev/null 2>&1 || { echo "docker not found. Please install Docker"; exit 1; }
22+
docker buildx version >/dev/null 2>&1 || { echo "docker buildx not found. Please enable buildx in Docker"; exit 1; }
23+
24+
# Create buildx builder if it doesn't exist
25+
docker buildx create --name kube-bind-builder --use 2>/dev/null || docker buildx use kube-bind-builder 2>/dev/null || true
26+
docker buildx inspect --bootstrap >/dev/null 2>&1
27+
28+
# Check if building for multiple platforms
29+
if [[ "$PLATFORMS" == *","* ]]; then
30+
echo "Multi-platform build detected. Images will be pushed to registry instead of loaded locally."
31+
LOAD_FLAG="--push"
32+
else
33+
echo "Single platform build. Images will be loaded to local Docker daemon."
34+
LOAD_FLAG="--load"
35+
fi
36+
37+
echo "Building konnector image..."
38+
docker buildx build \
39+
--platform $PLATFORMS \
40+
--build-arg LDFLAGS="$LDFLAGS" \
41+
-t "$IMAGE_REPO/konnector:$REV" \
42+
-f Dockerfile.konnector \
43+
$LOAD_FLAG .
44+
45+
echo "Building backend image..."
46+
docker buildx build \
47+
--platform $PLATFORMS \
48+
--build-arg LDFLAGS="$LDFLAGS" \
49+
-t "$IMAGE_REPO)/backend:$REV" \
50+
-f Dockerfile \
51+
$LOAD_FLAG .
52+
53+
echo "Successfully built images:"
54+
echo " $IMAGE_REPO/konnector:$REV ($PLATFORMS)"
55+
echo " $IMAGE_REPO/backend:$REV ($PLATFORMS)"

hack/go-install.sh

Lines changed: 0 additions & 62 deletions
This file was deleted.

hack/helm-build.sh

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright 2025 The Kube Bind Authors.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
set -eu
18+
19+
echo "Building Helm charts locally..."
20+
21+
HELM="$(UGET_PRINT_PATH=absolute make --no-print-directory install-helm)"
22+
23+
# Set chart version to semver format for local builds (0.0.0-<git-sha>)
24+
CHART_VERSION="0.0.0-$REV";
25+
26+
for chart_dir in deploy/charts/*/; do
27+
if [ -f "${chart_dir}Chart.yaml" ]; then
28+
chart_name=$(basename "$chart_dir")
29+
echo "Processing chart: $chart_name"
30+
31+
cp "${chart_dir}Chart.yaml" "${chart_dir}Chart.yaml.bak"
32+
sed -i.tmp "s/^version:.*/version: $CHART_VERSION/" "${chart_dir}Chart.yaml"
33+
sed -i.tmp "s/^appVersion:.*/appVersion: $CHART_VERSION/" "${chart_dir}Chart.yaml"
34+
rm -f "${chart_dir}Chart.yaml.tmp"
35+
36+
"$HELM" package "$chart_dir" --version "$CHART_VERSION" --destination ./bin/
37+
echo "Packaged: ./bin/$chart_name-$CHART_VERSION.tgz"
38+
39+
mv "${chart_dir}Chart.yaml.bak" "${chart_dir}Chart.yaml"
40+
fi
41+
done
42+
43+
echo "Helm charts built successfully in ./bin/"

0 commit comments

Comments
 (0)