Skip to content

Commit 8ada4c8

Browse files
committed
adjust targets for run in prow & downgrade go
1 parent 55ae693 commit 8ada4c8

File tree

7 files changed

+30
-19
lines changed

7 files changed

+30
-19
lines changed

.prow.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,13 @@ presubmits:
2121
preset-goproxy: "true"
2222
spec:
2323
containers:
24-
- image: ghcr.io/kcp-dev/infra/build:1.20.13-1
24+
- image: ghcr.io/kcp-dev/infra/build:1.21.8-1
25+
env:
26+
- name: KUBECONFIG
27+
value: /home/prow/go/src/github.com/kcp-dev/controller-runtime/examples/kcp/.test/kcp.kubeconfig
2528
command:
26-
- cd examples/kcp
27-
- make kcp-server kcp-controller
28-
- make test
29+
- make
30+
- test-kcp-e2e
2931
resources:
3032
requests:
3133
memory: 6Gi

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,3 +133,8 @@ verify-generate: generate ## Verify generated files are up to date
133133
git diff; \
134134
echo "generated files are out of date, run make generate"; exit 1; \
135135
fi
136+
137+
138+
.PHONY: test-kcp-e2e
139+
test-kcp-e2e:
140+
cd examples/kcp && make kcp-server kcp-controller test

examples/kcp/Makefile

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
SHELL := /bin/bash
2+
3+
.PHONY: help
4+
help: ## Display this help.
5+
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
6+
17

28
GO_INSTALL = ./hack/go-install.sh
39

@@ -60,11 +66,11 @@ kcp-server: $(KCP) $(ARTIFACT_DIR)/kcp ## Run the kcp server.
6066
@echo "kcp server is ready and running in the background. To stop run 'make test-cleanup'"
6167

6268
.PHONY: kcp-bootstrap
63-
kcp-bootstrap:
69+
kcp-bootstrap: ## Bootstrap the kcp server.
6470
@go run ./config/main.go
6571

6672
.PHONY: kcp-controller
67-
kcp-controller: build kcp-bootstrap
73+
kcp-controller: build kcp-bootstrap ## Run the kcp-controller.
6874
@echo "Starting kcp-controller in the background. To stop run 'make test-cleanup'"
6975
@if [[ ! -s $(ARTIFACT_DIR)/controller.log ]]; then ( ./bin/kcp-controller >$(ARTIFACT_DIR)/controller.log 2>&1 & ); fi
7076

@@ -78,12 +84,12 @@ test-cleanup: ## Clean up processes and directories from an end-to-end test run.
7884
$(ARTIFACT_DIR)/kcp: ## Create a directory for the kcp server data.
7985
mkdir -p $(ARTIFACT_DIR)/kcp
8086

81-
generate: build
87+
generate: build # Generate code
8288
./hack/update-codegen-crds.sh
8389

8490
run-local: build-controller kcp-bootstrap
8591
./bin/kcp-controller
8692

87-
.PHONY: test
93+
.PHONY: test # Run tests
8894
test:
8995
go test ./... --workspace=root --kubeconfig=$(CURDIR)/$(ARTIFACT_DIR)/kcp.kubeconfig

examples/kcp/config/main.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ limitations under the License.
1717
package main
1818

1919
import (
20-
"github.com/davecgh/go-spew/spew"
2120
kcpclienthelper "github.com/kcp-dev/apimachinery/v2/pkg/client"
2221
apisv1alpha1 "github.com/kcp-dev/kcp/sdk/apis/apis/v1alpha1"
2322
"github.com/kcp-dev/kcp/sdk/apis/core"
@@ -100,7 +99,6 @@ func main() {
10099
if err != nil {
101100
log.Error(err, "unable to create client")
102101
}
103-
spew.Dump(restWidgets)
104102

105103
err = widgets.Bootstrap(ctx, clientRoot, fakeBatteries)
106104
if err != nil {

examples/kcp/controllers/helper.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ package controllers
1919
import (
2020
"context"
2121

22-
"github.com/davecgh/go-spew/spew"
2322
"github.com/kcp-dev/logicalcluster/v3"
2423
"sigs.k8s.io/controller-runtime/pkg/kontext"
2524
"sigs.k8s.io/controller-runtime/pkg/reconcile"
@@ -29,7 +28,6 @@ import (
2928
// cluster clients and cache work out of the box.
3029
func WithClusterInContext(r reconcile.Reconciler) reconcile.Reconciler {
3130
return reconcile.Func(func(ctx context.Context, req reconcile.Request) (reconcile.Result, error) {
32-
spew.Dump(req.NamespacedName, req.ClusterName)
3331
ctx = kontext.WithCluster(ctx, logicalcluster.Name(req.ClusterName))
3432
return r.Reconcile(ctx, req)
3533
})

examples/kcp/go.mod

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/kcp-dev/controller-runtime/examples/kcp
22

3-
go 1.22.2
3+
go 1.21.8
44

55
// IMPORTANT: This is only an example replace directive. This is so examples can be run with the latest version of controller-runtime.
66
// In your own projects, you should not use replace directives like this. Instead, you should use the latest version of controller-runtime.
@@ -114,7 +114,9 @@ require (
114114
replace (
115115
github.com/prometheus/client_golang => github.com/prometheus/client_golang v1.18.0
116116
github.com/prometheus/common => github.com/prometheus/common v0.32.1
117+
k8s.io/api => k8s.io/api v0.29.0
117118
k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.29.0
119+
k8s.io/apimachinery => k8s.io/apimachinery v0.29.0
118120
k8s.io/apiserver => k8s.io/apiserver v0.29.0
119121
k8s.io/client-go => k8s.io/client-go v0.29.0
120122
k8s.io/component-base => k8s.io/component-base v0.29.0

examples/kcp/go.sum

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -931,8 +931,8 @@ github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjY
931931
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
932932
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
933933
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
934-
github.com/onsi/ginkgo/v2 v2.15.0 h1:79HwNRBAZHOEwrczrgSOPy+eFTTlIGELKy5as+ClttY=
935-
github.com/onsi/ginkgo/v2 v2.15.0/go.mod h1:HlxMHtYF57y6Dpf+mc5529KKmSq9h2FpCF+/ZkwUxKM=
934+
github.com/onsi/ginkgo/v2 v2.14.0 h1:vSmGj2Z5YPb9JwCWT6z6ihcUvDhuXLc3sJiqd3jMKAY=
935+
github.com/onsi/ginkgo/v2 v2.14.0/go.mod h1:JkUdW7JkN0V6rFvsHcJ478egV3XH9NxpD27Hal/PhZw=
936936
github.com/onsi/gomega v1.31.0 h1:54UJxxj6cPInHS3a35wm6BK/F9nHYueZ1NVujHDrnXE=
937937
github.com/onsi/gomega v1.31.0/go.mod h1:DW9aCi7U6Yi40wNVAvT6kzFnEVEI5n3DloYBiKiT6zk=
938938
github.com/phpdave11/gofpdf v1.4.2/go.mod h1:zpO6xFn9yxo3YLyMvW8HcKWVdbNqgIfOOp2dXMnm1mY=
@@ -1772,12 +1772,12 @@ honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt
17721772
honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
17731773
honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
17741774
honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las=
1775-
k8s.io/api v0.30.0-beta.0 h1:5nsH5CjCcgbHxWigNtvMu3rulycLWPqrlDe5tSonVQI=
1776-
k8s.io/api v0.30.0-beta.0/go.mod h1:A74Wh+vOyYXQS7SbhLXPF3rW0+CQP078Sqn+yuHQV8Y=
1775+
k8s.io/api v0.29.0 h1:NiCdQMY1QOp1H8lfRyeEf8eOwV6+0xA6XEE44ohDX2A=
1776+
k8s.io/api v0.29.0/go.mod h1:sdVmXoz2Bo/cb77Pxi71IPTSErEW32xa4aXwKH7gfBA=
17771777
k8s.io/apiextensions-apiserver v0.29.0 h1:0VuspFG7Hj+SxyF/Z/2T0uFbI5gb5LRgEyUVE3Q4lV0=
17781778
k8s.io/apiextensions-apiserver v0.29.0/go.mod h1:TKmpy3bTS0mr9pylH0nOt/QzQRrW7/h7yLdRForMZwc=
1779-
k8s.io/apimachinery v0.30.0-beta.0 h1:/gaNLWP5ynEG0ExJ+4w2YCj5/L4MU66RsWEAKciy0/g=
1780-
k8s.io/apimachinery v0.30.0-beta.0/go.mod h1:wEJvNDlfxMRaMhyv38SIHIEC9hah/xuzqUUhxIyUv7Y=
1779+
k8s.io/apimachinery v0.29.0 h1:+ACVktwyicPz0oc6MTMLwa2Pw3ouLAfAon1wPLtG48o=
1780+
k8s.io/apimachinery v0.29.0/go.mod h1:eVBxQ/cwiJxH58eK/jd/vAk4mrxmVlnpBH5J2GbMeis=
17811781
k8s.io/apiserver v0.29.0 h1:Y1xEMjJkP+BIi0GSEv1BBrf1jLU9UPfAnnGGbbDdp7o=
17821782
k8s.io/apiserver v0.29.0/go.mod h1:31n78PsRKPmfpee7/l9NYEv67u6hOL6AfcE761HapDM=
17831783
k8s.io/client-go v0.29.0 h1:KmlDtFcrdUzOYrBhXHgKw5ycWzc3ryPX5mQe0SkG3y8=

0 commit comments

Comments
 (0)