Skip to content

Commit

Permalink
Bump CAPI to v1.9.3
Browse files Browse the repository at this point in the history
  • Loading branch information
mboersma committed Jan 3, 2025
1 parent 2601bfb commit 5142170
Show file tree
Hide file tree
Showing 11 changed files with 205 additions and 247 deletions.
8 changes: 2 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -115,16 +115,12 @@ MOCKGEN_VER := v0.4.0
MOCKGEN_BIN := mockgen
MOCKGEN := $(TOOLS_BIN_DIR)/$(MOCKGEN_BIN)-$(MOCKGEN_VER)

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

CONTROLLER_GEN_VER := v0.15.0
CONTROLLER_GEN_VER := v0.16.0
CONTROLLER_GEN_BIN := controller-gen
CONTROLLER_GEN := $(abspath $(TOOLS_BIN_DIR)/$(CONTROLLER_GEN_BIN)-$(CONTROLLER_GEN_VER))
CONTROLLER_GEN_PKG := sigs.k8s.io/controller-tools/cmd/controller-gen
Expand Down
31 changes: 7 additions & 24 deletions config/crd/bases/addons.cluster.x-k8s.io_helmchartproxies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.15.0
controller-gen.kubebuilder.io/version: v0.16.0
name: helmchartproxies.addons.cluster.x-k8s.io
spec:
group: addons.cluster.x-k8s.io
Expand Down Expand Up @@ -341,20 +341,20 @@ spec:
description: |-
The reason for the condition's last transition in CamelCase.
The specific API may choose whether or not this field is considered a guaranteed API.
This field may not be empty.
This field may be empty.
type: string
severity:
description: |-
Severity provides an explicit classification of Reason code, so the users or machines can immediately
severity provides an explicit classification of Reason code, so the users or machines can immediately
understand the current situation and act accordingly.
The Severity field MUST be set only when Status=False.
type: string
status:
description: Status of the condition, one of True, False, Unknown.
description: status of the condition, one of True, False, Unknown.
type: string
type:
description: |-
Type of condition in CamelCase or in foo.example.com/CamelCase.
type of condition in CamelCase or in foo.example.com/CamelCase.
Many .condition.type values are consistent across resources like Available, but because arbitrary conditions
can be useful (see .node.status.conditions), the ability to deconflict is important.
type: string
Expand All @@ -368,24 +368,8 @@ spec:
description: MatchingClusters is the list of references to Clusters
selected by the ClusterSelector.
items:
description: |-
ObjectReference contains enough information to let you inspect or modify the referred object.
---
New uses of this type are discouraged because of difficulty describing its usage when embedded in APIs.
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.
2. Invalid usage help. It is impossible to add specific help for individual usage. In most embedded usages, there are particular
restrictions like, "must refer only to types A and B" or "UID not honored" or "name must be restricted".
Those cannot be well described when embedded.
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.
4. The fields are both imprecise and overly precise. Kind is not a precise mapping to a URL. This can produce ambiguity
during interpretation and require a REST mapping. In most cases, the dependency is on the group,resource tuple
and the version of the actual struct is irrelevant.
5. We cannot easily change it. Because this type is embedded in many locations, updates to this type
will affect numerous schemas. Don't make new APIs embed an underspecified API type they do not control.
Instead of using this type, create a locally provided and used type that is well-focused on your reference.
For example, ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533 .
description: ObjectReference contains enough information to let
you inspect or modify the referred object.
properties:
apiVersion:
description: API version of the referent.
Expand All @@ -399,7 +383,6 @@ spec:
the event) or if no container name is specified "spec.containers[2]" (container with
index 2 in this pod). This syntax is chosen only to have some well-defined way of
referencing a part of an object.
TODO: this design is not final and this field is subject to change in the future.
type: string
kind:
description: |-
Expand Down
11 changes: 5 additions & 6 deletions config/crd/bases/addons.cluster.x-k8s.io_helmreleaseproxies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.15.0
controller-gen.kubebuilder.io/version: v0.16.0
name: helmreleaseproxies.addons.cluster.x-k8s.io
spec:
group: addons.cluster.x-k8s.io
Expand Down Expand Up @@ -83,7 +83,6 @@ spec:
the event) or if no container name is specified "spec.containers[2]" (container with
index 2 in this pod). This syntax is chosen only to have some well-defined way of
referencing a part of an object.
TODO: this design is not final and this field is subject to change in the future.
type: string
kind:
description: |-
Expand Down Expand Up @@ -348,20 +347,20 @@ spec:
description: |-
The reason for the condition's last transition in CamelCase.
The specific API may choose whether or not this field is considered a guaranteed API.
This field may not be empty.
This field may be empty.
type: string
severity:
description: |-
Severity provides an explicit classification of Reason code, so the users or machines can immediately
severity provides an explicit classification of Reason code, so the users or machines can immediately
understand the current situation and act accordingly.
The Severity field MUST be set only when Status=False.
type: string
status:
description: Status of the condition, one of True, False, Unknown.
description: status of the condition, one of True, False, Unknown.
type: string
type:
description: |-
Type of condition in CamelCase or in foo.example.com/CamelCase.
type of condition in CamelCase or in foo.example.com/CamelCase.
Many .condition.type values are consistent across resources like Available, but because arbitrary conditions
can be useful (see .node.status.conditions), the ability to deconflict is important.
type: string
Expand Down
34 changes: 2 additions & 32 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,31 +22,6 @@ rules:
- addons.cluster.x-k8s.io
resources:
- helmchartproxies
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- addons.cluster.x-k8s.io
resources:
- helmchartproxies/finalizers
verbs:
- update
- apiGroups:
- addons.cluster.x-k8s.io
resources:
- helmchartproxies/status
verbs:
- get
- patch
- update
- apiGroups:
- addons.cluster.x-k8s.io
resources:
- helmreleaseproxies
verbs:
- create
Expand All @@ -59,12 +34,14 @@ rules:
- apiGroups:
- addons.cluster.x-k8s.io
resources:
- helmchartproxies/finalizers
- helmreleaseproxies/finalizers
verbs:
- update
- apiGroups:
- addons.cluster.x-k8s.io
resources:
- helmchartproxies/status
- helmreleaseproxies/status
verbs:
- get
Expand Down Expand Up @@ -104,13 +81,6 @@ rules:
- cluster.x-k8s.io
resources:
- clusters
verbs:
- get
- list
- watch
- apiGroups:
- cluster.x-k8s.io
resources:
- secrets
verbs:
- get
Expand Down
2 changes: 1 addition & 1 deletion controllers/helmchartproxy/helmchartproxy_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func (r *HelmChartProxyReconciler) SetupWithManager(ctx context.Context, mgr ctr
return ctrl.NewControllerManagedBy(mgr).
WithOptions(options).
For(&addonsv1alpha1.HelmChartProxy{}).
WithEventFilter(predicates.ResourceNotPausedAndHasFilterLabel(log, r.WatchFilterValue)).
WithEventFilter(predicates.ResourceNotPausedAndHasFilterLabel(mgr.GetScheme(), log, r.WatchFilterValue)).
Watches(
&clusterv1.Cluster{},
handler.EnqueueRequestsFromMapFunc(r.ClusterToHelmChartProxiesMapper),
Expand Down
12 changes: 6 additions & 6 deletions controllers/helmreleaseproxy/helmreleaseproxy_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,17 @@ func (r *HelmReleaseProxyReconciler) SetupWithManager(ctx context.Context, mgr c
return ctrl.NewControllerManagedBy(mgr).
WithOptions(options).
For(&addonsv1alpha1.HelmReleaseProxy{}).
WithEventFilter(predicates.ResourceNotPausedAndHasFilterLabel(log, r.WatchFilterValue)).
WithEventFilter(predicates.ResourceNotPausedAndHasFilterLabel(mgr.GetScheme(), log, r.WatchFilterValue)).
Watches(
&clusterv1.Cluster{},
handler.EnqueueRequestsFromMapFunc(clusterToHelmReleaseProxies),
builder.WithPredicates(
predicates.All(ctrl.LoggerFrom(ctx),
predicates.Any(ctrl.LoggerFrom(ctx),
predicates.ClusterUnpaused(ctrl.LoggerFrom(ctx)),
predicates.ClusterControlPlaneInitialized(ctrl.LoggerFrom(ctx)),
predicates.All(mgr.GetScheme(), ctrl.LoggerFrom(ctx),
predicates.Any(mgr.GetScheme(), ctrl.LoggerFrom(ctx),
predicates.ClusterUnpaused(mgr.GetScheme(), ctrl.LoggerFrom(ctx)),
predicates.ClusterControlPlaneInitialized(mgr.GetScheme(), ctrl.LoggerFrom(ctx)),
),
predicates.ResourceHasFilterLabel(ctrl.LoggerFrom(ctx), r.WatchFilterValue),
predicates.ResourceHasFilterLabel(mgr.GetScheme(), ctrl.LoggerFrom(ctx), r.WatchFilterValue),
),
)).
Complete(r)
Expand Down
Loading

0 comments on commit 5142170

Please sign in to comment.