Skip to content

Commit 09d43ad

Browse files
authored
Merge pull request #87 from kcp-dev/events
Create events in kcp
2 parents 97f4068 + 11a00cf commit 09d43ad

25 files changed

+434
-182
lines changed

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,10 @@ $(ENVTEST):
118118
test:
119119
./hack/run-tests.sh
120120

121+
.PHONY: test-e2e
122+
test-e2e: $(ENVTEST) $(KCP)
123+
./hack/run-e2e-tests.sh
124+
121125
.PHONY: codegen
122126
codegen: $(YQ)
123127
hack/update-codegen-crds.sh

deploy/crd/kcp.io/syncagent.kcp.io_publishedresources.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ apiVersion: apiextensions.k8s.io/v1
44
kind: CustomResourceDefinition
55
metadata:
66
annotations:
7-
controller-gen.kubebuilder.io/version: v0.16.5
7+
controller-gen.kubebuilder.io/version: v0.18.0
88
name: publishedresources.syncagent.kcp.io
99
spec:
1010
group: syncagent.kcp.io

docs/content/getting-started.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,8 @@ The Sync Agent needs to
180180
* access the workspace of its `APIExport`,
181181
* get the `LogicalCluster`,
182182
* manage its `APIExport`,
183-
* manage `APIResourceSchemas` and
183+
* manage `APIResourceSchemas`,
184+
* create `events` for `APIExports` and
184185
* access the virtual workspace for its `APIExport`.
185186

186187
This can be achieved by applying RBAC like this _in the workspace where the `APIExport` resides_:
@@ -213,6 +214,16 @@ rules:
213214
- watch
214215
- patch
215216
- update
217+
# issue events for APIExports
218+
- apiGroups:
219+
- ""
220+
resources:
221+
- events
222+
verbs:
223+
- get
224+
- create
225+
- patch
226+
- update
216227
# manage APIResourceSchemas
217228
- apiGroups:
218229
- apis.kcp.io

go.mod

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,8 @@ go 1.24.0
55
replace github.com/kcp-dev/api-syncagent/sdk => ./sdk
66

77
replace (
8-
k8s.io/api => github.com/kcp-dev/kubernetes/staging/src/k8s.io/api v0.0.0-20250425143807-ddbe171670d8
9-
k8s.io/apiextensions-apiserver => github.com/kcp-dev/kubernetes/staging/src/k8s.io/apiextensions-apiserver v0.0.0-20250425143807-ddbe171670d8
10-
k8s.io/apiserver => github.com/kcp-dev/kubernetes/staging/src/k8s.io/apiserver v0.0.0-20250425143807-ddbe171670d8
11-
k8s.io/kms => github.com/kcp-dev/kubernetes/staging/src/k8s.io/kms v0.0.0-20250425143807-ddbe171670d8
8+
k8s.io/apiextensions-apiserver => github.com/kcp-dev/kubernetes/staging/src/k8s.io/apiextensions-apiserver v0.0.0-20250821202322-e42d885de52b
9+
k8s.io/apiserver => github.com/kcp-dev/kubernetes/staging/src/k8s.io/apiserver v0.0.0-20250821202322-e42d885de52b
1210
)
1311

1412
require (
@@ -19,10 +17,10 @@ require (
1917
github.com/google/go-cmp v0.7.0
2018
github.com/kcp-dev/api-syncagent/sdk v0.0.0-00010101000000-000000000000
2119
github.com/kcp-dev/code-generator/v2 v2.3.1
22-
github.com/kcp-dev/kcp v0.28.0
23-
github.com/kcp-dev/kcp/sdk v0.28.0
20+
github.com/kcp-dev/kcp v0.28.1
21+
github.com/kcp-dev/kcp/sdk v0.28.1
2422
github.com/kcp-dev/logicalcluster/v3 v3.0.5
25-
github.com/kcp-dev/multicluster-provider v0.1.0
23+
github.com/kcp-dev/multicluster-provider v0.2.1-0.20250901093233-9ef571c8bd47
2624
github.com/openshift-eng/openshift-goimports v0.0.0-20230304234052-c70783e636f2
2725
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2
2826
github.com/spf13/cobra v1.9.1
@@ -31,18 +29,22 @@ require (
3129
github.com/tidwall/sjson v1.2.5
3230
go.uber.org/zap v1.27.0
3331
k8c.io/reconciler v0.5.0
34-
k8s.io/api v0.32.3
35-
k8s.io/apiextensions-apiserver v0.32.3
36-
k8s.io/apimachinery v0.32.3
37-
k8s.io/apiserver v0.32.3
38-
k8s.io/client-go v0.32.3
39-
k8s.io/code-generator v0.32.3
40-
k8s.io/component-base v0.32.3
41-
k8s.io/kube-openapi v0.0.0-20241212222426-2c72e554b1e7
42-
k8s.io/utils v0.0.0-20241210054802-24370beab758
43-
sigs.k8s.io/controller-runtime v0.20.4
44-
sigs.k8s.io/controller-tools v0.16.5
45-
sigs.k8s.io/multicluster-runtime v0.20.4-alpha.7
32+
// Deviating from kcp's kube version (0.32) because more recent multicluster-runtime
33+
// versions are built ontop of controller-runtime 0.21 with Kube 0.33. Ideally in
34+
// the future we should go back to having kcp, controller-runtime and multicluster-runtime
35+
// be in-sync again.
36+
k8s.io/api v0.33.3
37+
k8s.io/apiextensions-apiserver v0.33.3
38+
k8s.io/apimachinery v0.33.3
39+
k8s.io/apiserver v0.33.3
40+
k8s.io/client-go v0.33.3
41+
k8s.io/code-generator v0.33.3
42+
k8s.io/component-base v0.33.3
43+
k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff
44+
k8s.io/utils v0.0.0-20250604170112-4c0f3b243397
45+
sigs.k8s.io/controller-runtime v0.21.0
46+
sigs.k8s.io/controller-tools v0.18.0
47+
sigs.k8s.io/multicluster-runtime v0.21.0-alpha.9
4648
sigs.k8s.io/yaml v1.4.0
4749
)
4850

@@ -53,7 +55,6 @@ require (
5355
github.com/Masterminds/semver/v3 v3.3.1 // indirect
5456
github.com/NYTimes/gziphandler v1.1.1 // indirect
5557
github.com/antlr4-go/antlr/v4 v4.13.1 // indirect
56-
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
5758
github.com/beorn7/perks v1.0.1 // indirect
5859
github.com/blang/semver/v4 v4.0.0 // indirect
5960
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
@@ -76,9 +77,8 @@ require (
7677
github.com/gogo/protobuf v1.3.2 // indirect
7778
github.com/golang/protobuf v1.5.4 // indirect
7879
github.com/google/btree v1.1.3 // indirect
79-
github.com/google/cel-go v0.22.1 // indirect
80+
github.com/google/cel-go v0.23.2 // indirect
8081
github.com/google/gnostic-models v0.6.9 // indirect
81-
github.com/google/gofuzz v1.2.1-0.20210504230335-f78f29fc09ea // indirect
8282
github.com/google/uuid v1.6.0 // indirect
8383
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect
8484
github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3 // indirect
@@ -87,9 +87,8 @@ require (
8787
github.com/inconshreveable/mousetrap v1.1.0 // indirect
8888
github.com/josharian/intern v1.0.0 // indirect
8989
github.com/json-iterator/go v1.1.12 // indirect
90-
github.com/kcp-dev/apimachinery/v2 v2.0.1-0.20250512171935-ebb573a40077 // indirect
91-
github.com/kcp-dev/client-go v0.0.0-20250707095244-decc4df45adb // indirect
92-
github.com/klauspost/compress v1.17.11 // indirect
90+
github.com/kcp-dev/apimachinery/v2 v2.0.1-0.20250728122101-adbf20db3e51 // indirect
91+
github.com/kcp-dev/client-go v0.0.0-20250728134101-0355faa9361b // indirect
9392
github.com/kylelemons/godebug v1.1.0 // indirect
9493
github.com/mailru/easyjson v0.9.0 // indirect
9594
github.com/mattn/go-colorable v0.1.14 // indirect
@@ -100,11 +99,11 @@ require (
10099
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
101100
github.com/modern-go/reflect2 v1.0.2 // indirect
102101
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
103-
github.com/onsi/gomega v1.36.3 // indirect
102+
github.com/onsi/gomega v1.37.0 // indirect
104103
github.com/opencontainers/go-digest v1.0.0 // indirect
105104
github.com/pelletier/go-toml/v2 v2.2.3 // indirect
106105
github.com/pkg/errors v0.9.1 // indirect
107-
github.com/prometheus/client_golang v1.21.1 // indirect
106+
github.com/prometheus/client_golang v1.22.0 // indirect
108107
github.com/prometheus/client_model v0.6.1 // indirect
109108
github.com/prometheus/common v0.63.0 // indirect
110109
github.com/prometheus/procfs v0.16.0 // indirect
@@ -133,17 +132,17 @@ require (
133132
go.opentelemetry.io/otel/trace v1.35.0 // indirect
134133
go.opentelemetry.io/proto/otlp v1.5.0 // indirect
135134
go.uber.org/multierr v1.11.0 // indirect
136-
golang.org/x/crypto v0.37.0 // indirect
135+
golang.org/x/crypto v0.38.0 // indirect
137136
golang.org/x/exp v0.0.0-20250408133849-7e4ce0ab07d0 // indirect
138137
golang.org/x/mod v0.24.0 // indirect
139-
golang.org/x/net v0.39.0 // indirect
138+
golang.org/x/net v0.40.0 // indirect
140139
golang.org/x/oauth2 v0.29.0 // indirect
141-
golang.org/x/sync v0.13.0 // indirect
142-
golang.org/x/sys v0.32.0 // indirect
143-
golang.org/x/term v0.31.0 // indirect
144-
golang.org/x/text v0.24.0 // indirect
140+
golang.org/x/sync v0.14.0 // indirect
141+
golang.org/x/sys v0.33.0 // indirect
142+
golang.org/x/term v0.32.0 // indirect
143+
golang.org/x/text v0.25.0 // indirect
145144
golang.org/x/time v0.11.0 // indirect
146-
golang.org/x/tools v0.32.0 // indirect
145+
golang.org/x/tools v0.33.0 // indirect
147146
gomodules.xyz/jsonpatch/v2 v2.5.0 // indirect
148147
google.golang.org/genproto/googleapis/api v0.0.0-20250324211829-b45e905df463 // indirect
149148
google.golang.org/genproto/googleapis/rpc v0.0.0-20250324211829-b45e905df463 // indirect
@@ -155,10 +154,11 @@ require (
155154
gopkg.in/yaml.v3 v3.0.1 // indirect
156155
k8s.io/component-helpers v0.32.3 // indirect
157156
k8s.io/controller-manager v0.32.3 // indirect
158-
k8s.io/gengo/v2 v2.0.0-20240911193312-2b36238f13e9 // indirect
157+
k8s.io/gengo/v2 v2.0.0-20250513215321-e3bc6f1e78b4 // indirect
159158
k8s.io/klog/v2 v2.130.1 // indirect
160-
k8s.io/kubernetes v1.32.3 // indirect
161-
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.1 // indirect
159+
k8s.io/kubernetes v1.33.3 // indirect
160+
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.2 // indirect
162161
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 // indirect
162+
sigs.k8s.io/randfill v1.0.0 // indirect
163163
sigs.k8s.io/structured-merge-diff/v4 v4.6.0 // indirect
164164
)

0 commit comments

Comments
 (0)