Skip to content

Commit 2c67c0e

Browse files
committed
Bump CAPI to v1.9.3
1 parent 28c7631 commit 2c67c0e

File tree

11 files changed

+205
-247
lines changed

11 files changed

+205
-247
lines changed

Makefile

+2-6
Original file line numberDiff line numberDiff line change
@@ -115,16 +115,12 @@ MOCKGEN_VER := v0.4.0
115115
MOCKGEN_BIN := mockgen
116116
MOCKGEN := $(TOOLS_BIN_DIR)/$(MOCKGEN_BIN)-$(MOCKGEN_VER)
117117

118-
# This is a commit from CR main (22.05.2024).
119-
# Intentionally using a commit from main to use a setup-envtest version
120-
# that uses binaries from controller-tools, not GCS.
121-
# CR PR: https://github.com/kubernetes-sigs/controller-runtime/pull/2811
122-
SETUP_ENVTEST_VER := v0.0.0-20240522175850-2e9781e9fc60
118+
SETUP_ENVTEST_VER := release-0.19
123119
SETUP_ENVTEST_BIN := setup-envtest
124120
SETUP_ENVTEST := $(abspath $(TOOLS_BIN_DIR)/$(SETUP_ENVTEST_BIN)-$(SETUP_ENVTEST_VER))
125121
SETUP_ENVTEST_PKG := sigs.k8s.io/controller-runtime/tools/setup-envtest
126122

127-
CONTROLLER_GEN_VER := v0.15.0
123+
CONTROLLER_GEN_VER := v0.16.0
128124
CONTROLLER_GEN_BIN := controller-gen
129125
CONTROLLER_GEN := $(abspath $(TOOLS_BIN_DIR)/$(CONTROLLER_GEN_BIN)-$(CONTROLLER_GEN_VER))
130126
CONTROLLER_GEN_PKG := sigs.k8s.io/controller-tools/cmd/controller-gen

config/crd/bases/addons.cluster.x-k8s.io_helmchartproxies.yaml

+7-24
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.15.0
6+
controller-gen.kubebuilder.io/version: v0.16.0
77
name: helmchartproxies.addons.cluster.x-k8s.io
88
spec:
99
group: addons.cluster.x-k8s.io
@@ -341,20 +341,20 @@ spec:
341341
description: |-
342342
The reason for the condition's last transition in CamelCase.
343343
The specific API may choose whether or not this field is considered a guaranteed API.
344-
This field may not be empty.
344+
This field may be empty.
345345
type: string
346346
severity:
347347
description: |-
348-
Severity provides an explicit classification of Reason code, so the users or machines can immediately
348+
severity provides an explicit classification of Reason code, so the users or machines can immediately
349349
understand the current situation and act accordingly.
350350
The Severity field MUST be set only when Status=False.
351351
type: string
352352
status:
353-
description: Status of the condition, one of True, False, Unknown.
353+
description: status of the condition, one of True, False, Unknown.
354354
type: string
355355
type:
356356
description: |-
357-
Type of condition in CamelCase or in foo.example.com/CamelCase.
357+
type of condition in CamelCase or in foo.example.com/CamelCase.
358358
Many .condition.type values are consistent across resources like Available, but because arbitrary conditions
359359
can be useful (see .node.status.conditions), the ability to deconflict is important.
360360
type: string
@@ -368,24 +368,8 @@ spec:
368368
description: MatchingClusters is the list of references to Clusters
369369
selected by the ClusterSelector.
370370
items:
371-
description: |-
372-
ObjectReference contains enough information to let you inspect or modify the referred object.
373-
---
374-
New uses of this type are discouraged because of difficulty describing its usage when embedded in APIs.
375-
1. Ignored fields. It includes many fields which are not generally honored. For instance, ResourceVersion and FieldPath are both very rarely valid in actual usage.
376-
2. Invalid usage help. It is impossible to add specific help for individual usage. In most embedded usages, there are particular
377-
restrictions like, "must refer only to types A and B" or "UID not honored" or "name must be restricted".
378-
Those cannot be well described when embedded.
379-
3. Inconsistent validation. Because the usages are different, the validation rules are different by usage, which makes it hard for users to predict what will happen.
380-
4. The fields are both imprecise and overly precise. Kind is not a precise mapping to a URL. This can produce ambiguity
381-
during interpretation and require a REST mapping. In most cases, the dependency is on the group,resource tuple
382-
and the version of the actual struct is irrelevant.
383-
5. We cannot easily change it. Because this type is embedded in many locations, updates to this type
384-
will affect numerous schemas. Don't make new APIs embed an underspecified API type they do not control.
385-
386-
387-
Instead of using this type, create a locally provided and used type that is well-focused on your reference.
388-
For example, ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533 .
371+
description: ObjectReference contains enough information to let
372+
you inspect or modify the referred object.
389373
properties:
390374
apiVersion:
391375
description: API version of the referent.
@@ -399,7 +383,6 @@ spec:
399383
the event) or if no container name is specified "spec.containers[2]" (container with
400384
index 2 in this pod). This syntax is chosen only to have some well-defined way of
401385
referencing a part of an object.
402-
TODO: this design is not final and this field is subject to change in the future.
403386
type: string
404387
kind:
405388
description: |-

config/crd/bases/addons.cluster.x-k8s.io_helmreleaseproxies.yaml

+5-6
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.15.0
6+
controller-gen.kubebuilder.io/version: v0.16.0
77
name: helmreleaseproxies.addons.cluster.x-k8s.io
88
spec:
99
group: addons.cluster.x-k8s.io
@@ -83,7 +83,6 @@ spec:
8383
the event) or if no container name is specified "spec.containers[2]" (container with
8484
index 2 in this pod). This syntax is chosen only to have some well-defined way of
8585
referencing a part of an object.
86-
TODO: this design is not final and this field is subject to change in the future.
8786
type: string
8887
kind:
8988
description: |-
@@ -348,20 +347,20 @@ spec:
348347
description: |-
349348
The reason for the condition's last transition in CamelCase.
350349
The specific API may choose whether or not this field is considered a guaranteed API.
351-
This field may not be empty.
350+
This field may be empty.
352351
type: string
353352
severity:
354353
description: |-
355-
Severity provides an explicit classification of Reason code, so the users or machines can immediately
354+
severity provides an explicit classification of Reason code, so the users or machines can immediately
356355
understand the current situation and act accordingly.
357356
The Severity field MUST be set only when Status=False.
358357
type: string
359358
status:
360-
description: Status of the condition, one of True, False, Unknown.
359+
description: status of the condition, one of True, False, Unknown.
361360
type: string
362361
type:
363362
description: |-
364-
Type of condition in CamelCase or in foo.example.com/CamelCase.
363+
type of condition in CamelCase or in foo.example.com/CamelCase.
365364
Many .condition.type values are consistent across resources like Available, but because arbitrary conditions
366365
can be useful (see .node.status.conditions), the ability to deconflict is important.
367366
type: string

config/rbac/role.yaml

+2-32
Original file line numberDiff line numberDiff line change
@@ -22,31 +22,6 @@ rules:
2222
- addons.cluster.x-k8s.io
2323
resources:
2424
- helmchartproxies
25-
verbs:
26-
- create
27-
- delete
28-
- get
29-
- list
30-
- patch
31-
- update
32-
- watch
33-
- apiGroups:
34-
- addons.cluster.x-k8s.io
35-
resources:
36-
- helmchartproxies/finalizers
37-
verbs:
38-
- update
39-
- apiGroups:
40-
- addons.cluster.x-k8s.io
41-
resources:
42-
- helmchartproxies/status
43-
verbs:
44-
- get
45-
- patch
46-
- update
47-
- apiGroups:
48-
- addons.cluster.x-k8s.io
49-
resources:
5025
- helmreleaseproxies
5126
verbs:
5227
- create
@@ -59,12 +34,14 @@ rules:
5934
- apiGroups:
6035
- addons.cluster.x-k8s.io
6136
resources:
37+
- helmchartproxies/finalizers
6238
- helmreleaseproxies/finalizers
6339
verbs:
6440
- update
6541
- apiGroups:
6642
- addons.cluster.x-k8s.io
6743
resources:
44+
- helmchartproxies/status
6845
- helmreleaseproxies/status
6946
verbs:
7047
- get
@@ -104,13 +81,6 @@ rules:
10481
- cluster.x-k8s.io
10582
resources:
10683
- clusters
107-
verbs:
108-
- get
109-
- list
110-
- watch
111-
- apiGroups:
112-
- cluster.x-k8s.io
113-
resources:
11484
- secrets
11585
verbs:
11686
- get

controllers/helmchartproxy/helmchartproxy_controller.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ func (r *HelmChartProxyReconciler) SetupWithManager(ctx context.Context, mgr ctr
5252
return ctrl.NewControllerManagedBy(mgr).
5353
WithOptions(options).
5454
For(&addonsv1alpha1.HelmChartProxy{}).
55-
WithEventFilter(predicates.ResourceNotPausedAndHasFilterLabel(log, r.WatchFilterValue)).
55+
WithEventFilter(predicates.ResourceNotPausedAndHasFilterLabel(mgr.GetScheme(), log, r.WatchFilterValue)).
5656
Watches(
5757
&clusterv1.Cluster{},
5858
handler.EnqueueRequestsFromMapFunc(r.ClusterToHelmChartProxiesMapper),

controllers/helmreleaseproxy/helmreleaseproxy_controller.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -67,17 +67,17 @@ func (r *HelmReleaseProxyReconciler) SetupWithManager(ctx context.Context, mgr c
6767
return ctrl.NewControllerManagedBy(mgr).
6868
WithOptions(options).
6969
For(&addonsv1alpha1.HelmReleaseProxy{}).
70-
WithEventFilter(predicates.ResourceNotPausedAndHasFilterLabel(log, r.WatchFilterValue)).
70+
WithEventFilter(predicates.ResourceNotPausedAndHasFilterLabel(mgr.GetScheme(), log, r.WatchFilterValue)).
7171
Watches(
7272
&clusterv1.Cluster{},
7373
handler.EnqueueRequestsFromMapFunc(clusterToHelmReleaseProxies),
7474
builder.WithPredicates(
75-
predicates.All(ctrl.LoggerFrom(ctx),
76-
predicates.Any(ctrl.LoggerFrom(ctx),
77-
predicates.ClusterUnpaused(ctrl.LoggerFrom(ctx)),
78-
predicates.ClusterControlPlaneInitialized(ctrl.LoggerFrom(ctx)),
75+
predicates.All(mgr.GetScheme(), ctrl.LoggerFrom(ctx),
76+
predicates.Any(mgr.GetScheme(), ctrl.LoggerFrom(ctx),
77+
predicates.ClusterUnpaused(mgr.GetScheme(), ctrl.LoggerFrom(ctx)),
78+
predicates.ClusterControlPlaneInitialized(mgr.GetScheme(), ctrl.LoggerFrom(ctx)),
7979
),
80-
predicates.ResourceHasFilterLabel(ctrl.LoggerFrom(ctx), r.WatchFilterValue),
80+
predicates.ResourceHasFilterLabel(mgr.GetScheme(), ctrl.LoggerFrom(ctx), r.WatchFilterValue),
8181
),
8282
)).
8383
Complete(r)

0 commit comments

Comments
 (0)