Skip to content

Commit ad7185c

Browse files
committed
Bump CAPI to v1.11.1
1 parent 1a4a56e commit ad7185c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+2037
-615
lines changed

.golangci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ linters:
8989
alias: utilruntime
9090
- pkg: sigs.k8s.io/controller-runtime
9191
alias: ctrl
92-
- pkg: sigs.k8s.io/cluster-api/api/v1beta1
92+
- pkg: sigs.k8s.io/cluster-api/api/core/v1beta2
9393
alias: clusterv1
9494
- pkg: sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3
9595
alias: clusterctlv1

Makefile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -309,16 +309,16 @@ download-cluster-api-crd: generate-modules ## Run to download Cluster API CRDs f
309309
DOCKER_TEMPLATES := test/e2e/data/addons-helm
310310

311311
.PHONY: generate-e2e-templates
312-
generate-e2e-templates: $(KUSTOMIZE) $(addprefix generate-e2e-templates-, v1.5 main) ## Generate cluster templates for all versions
312+
generate-e2e-templates: $(KUSTOMIZE) $(addprefix generate-e2e-templates-, v1beta1 main) ## Generate cluster templates for all versions
313313

314-
.PHONY: generate-e2e-templates-v1.5
315-
generate-e2e-templates-v1.5: $(KUSTOMIZE)
316-
$(KUSTOMIZE) build $(DOCKER_TEMPLATES)/v1.5/cluster-template --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/v1.5/cluster-template.yaml
314+
.PHONY: generate-e2e-templates-v1beta1
315+
generate-e2e-templates-v1beta1: $(KUSTOMIZE)
316+
$(KUSTOMIZE) build $(DOCKER_TEMPLATES)/v1beta1/cluster-template --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/v1beta1/cluster-template.yaml
317317

318318
.PHONY: generate-e2e-templates-main
319319
generate-e2e-templates-main: $(KUSTOMIZE) ## Generate templates for e2e tests on main branch.
320-
$(KUSTOMIZE) build $(DOCKER_TEMPLATES)/v1beta1/cluster-template --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/v1beta1/cluster-template.yaml
321-
$(KUSTOMIZE) build $(DOCKER_TEMPLATES)/v1beta1/cluster-template-upgrades --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/v1beta1/cluster-template-upgrades.yaml
320+
$(KUSTOMIZE) build $(DOCKER_TEMPLATES)/v1beta2/cluster-template --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/v1beta2/cluster-template.yaml
321+
$(KUSTOMIZE) build $(DOCKER_TEMPLATES)/v1beta2/cluster-template-upgrades --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/v1beta2/cluster-template-upgrades.yaml
322322

323323
.PHONY: generate-flavors
324324
generate-flavors: $(KUSTOMIZE) ## Generate template flavors.

api/v1alpha1/condition_consts.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,11 @@ limitations under the License.
1616

1717
package v1alpha1
1818

19-
import clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
20-
2119
// HelmChartProxy Conditions and Reasons.
2220
const (
2321
// HelmReleaseProxySpecsUpToDateCondition indicates that the HelmReleaseProxy specs are up to date with the HelmChartProxy specs,
2422
// meaning that the HelmReleaseProxies are created/updated, value template parsing succeeded, and the orphaned HelmReleaseProxies are deleted.
25-
HelmReleaseProxySpecsUpToDateCondition clusterv1.ConditionType = "HelmReleaseProxySpecsUpToDate"
23+
HelmReleaseProxySpecsUpToDateCondition = "HelmReleaseProxySpecsUpToDate"
2624

2725
// HelmReleaseProxySpecsUpdatingReason indicates that the HelmReleaseProxy entity is not yet updated by the corresponding controller.
2826
HelmReleaseProxySpecsUpdatingReason = "HelmReleaseProxySpecsUpdating"
@@ -44,13 +42,13 @@ const (
4442

4543
// HelmReleaseProxiesReadyCondition indicates that the HelmReleaseProxies are ready, meaning that the Helm installation, upgrade
4644
// or deletion is complete.
47-
HelmReleaseProxiesReadyCondition clusterv1.ConditionType = "HelmReleaseProxiesReady"
45+
HelmReleaseProxiesReadyCondition = "HelmReleaseProxiesReady"
4846
)
4947

5048
// HelmReleaseProxy Conditions and Reasons.
5149
const (
5250
// HelmReleaseReadyCondition indicates the current status of the underlying Helm release managed by the HelmReleaseProxy.
53-
HelmReleaseReadyCondition clusterv1.ConditionType = "HelmReleaseReady"
51+
HelmReleaseReadyCondition = "HelmReleaseReady"
5452

5553
// PreparingToHelmInstallReason indicates that the HelmReleaseProxy is preparing to install the Helm release.
5654
PreparingToHelmInstallReason = "PreparingToHelmInstall"
@@ -71,7 +69,7 @@ const (
7169
HelmReleaseGetFailedReason = "HelmReleaseGetFailed"
7270

7371
// ClusterAvailableCondition indicates that the Cluster to install the Helm release on is available.
74-
ClusterAvailableCondition clusterv1.ConditionType = "ClusterAvailable"
72+
ClusterAvailableCondition = "ClusterAvailable"
7573

7674
// GetClusterFailedReason indicates that the HelmReleaseProxy failed to get the Cluster.
7775
GetClusterFailedReason = "GetClusterFailed"

api/v1alpha1/helmchartproxy_types.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ package v1alpha1
1919
import (
2020
corev1 "k8s.io/api/core/v1"
2121
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
22-
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
22+
clusterv1 "sigs.k8s.io/cluster-api/api/core/v1beta2"
2323
)
2424

2525
// ReconcileStrategy is a string representation of the reconciliation strategy of a HelmChartProxy.
@@ -242,7 +242,7 @@ type TLSConfig struct {
242242
type HelmChartProxyStatus struct {
243243
// Conditions defines current state of the HelmChartProxy.
244244
// +optional
245-
Conditions clusterv1.Conditions `json:"conditions,omitempty"`
245+
Conditions []metav1.Condition `json:"conditions,omitempty"`
246246

247247
// MatchingClusters is the list of references to Clusters selected by the ClusterSelector.
248248
// +optional
@@ -269,7 +269,7 @@ type HelmChartProxy struct {
269269
Status HelmChartProxyStatus `json:"status,omitempty"`
270270
}
271271

272-
//+kubebuilder:object:root=true
272+
// +kubebuilder:object:root=true
273273

274274
// HelmChartProxyList contains a list of HelmChartProxy.
275275
type HelmChartProxyList struct {
@@ -279,12 +279,12 @@ type HelmChartProxyList struct {
279279
}
280280

281281
// GetConditions returns the list of conditions for an HelmChartProxy API object.
282-
func (c *HelmChartProxy) GetConditions() clusterv1.Conditions {
282+
func (c *HelmChartProxy) GetConditions() []metav1.Condition {
283283
return c.Status.Conditions
284284
}
285285

286286
// SetConditions will set the given conditions on an HelmChartProxy object.
287-
func (c *HelmChartProxy) SetConditions(conditions clusterv1.Conditions) {
287+
func (c *HelmChartProxy) SetConditions(conditions []metav1.Condition) {
288288
c.Status.Conditions = conditions
289289
}
290290

api/v1alpha1/helmreleaseproxy_types.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ package v1alpha1
1919
import (
2020
corev1 "k8s.io/api/core/v1"
2121
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
22-
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
2322
)
2423

2524
const (
@@ -95,7 +94,7 @@ type HelmReleaseProxySpec struct {
9594
type HelmReleaseProxyStatus struct {
9695
// Conditions defines current state of the HelmReleaseProxy.
9796
// +optional
98-
Conditions clusterv1.Conditions `json:"conditions,omitempty"`
97+
Conditions []metav1.Condition `json:"conditions,omitempty"`
9998

10099
// Status is the current status of the Helm release.
101100
// +optional
@@ -129,7 +128,7 @@ type HelmReleaseProxy struct {
129128
Status HelmReleaseProxyStatus `json:"status,omitempty"`
130129
}
131130

132-
//+kubebuilder:object:root=true
131+
// +kubebuilder:object:root=true
133132

134133
// HelmReleaseProxyList contains a list of HelmReleaseProxy.
135134
type HelmReleaseProxyList struct {
@@ -139,12 +138,12 @@ type HelmReleaseProxyList struct {
139138
}
140139

141140
// GetConditions returns the list of conditions for an HelmReleaseProxy API object.
142-
func (r *HelmReleaseProxy) GetConditions() clusterv1.Conditions {
141+
func (r *HelmReleaseProxy) GetConditions() []metav1.Condition {
143142
return r.Status.Conditions
144143
}
145144

146145
// SetConditions will set the given conditions on an HelmReleaseProxy object.
147-
func (r *HelmReleaseProxy) SetConditions(conditions clusterv1.Conditions) {
146+
func (r *HelmReleaseProxy) SetConditions(conditions []metav1.Condition) {
148147
r.Status.Conditions = conditions
149148
}
150149

api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 2 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 29 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -322,51 +322,56 @@ spec:
322322
conditions:
323323
description: Conditions defines current state of the HelmChartProxy.
324324
items:
325-
description: Condition defines an observation of a Cluster API resource
326-
operational state.
325+
description: Condition contains details for one aspect of the current
326+
state of this API Resource.
327327
properties:
328328
lastTransitionTime:
329329
description: |-
330330
lastTransitionTime is the last time the condition transitioned from one status to another.
331-
This should be when the underlying condition changed. If that is not known, then using the time when
332-
the API field changed is acceptable.
331+
This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
333332
format: date-time
334333
type: string
335334
message:
336335
description: |-
337336
message is a human readable message indicating details about the transition.
338-
This field may be empty.
339-
maxLength: 10240
340-
minLength: 1
337+
This may be an empty string.
338+
maxLength: 32768
341339
type: string
340+
observedGeneration:
341+
description: |-
342+
observedGeneration represents the .metadata.generation that the condition was set based upon.
343+
For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
344+
with respect to the current state of the instance.
345+
format: int64
346+
minimum: 0
347+
type: integer
342348
reason:
343349
description: |-
344-
reason is the reason for the condition's last transition in CamelCase.
345-
The specific API may choose whether or not this field is considered a guaranteed API.
346-
This field may be empty.
347-
maxLength: 256
350+
reason contains a programmatic identifier indicating the reason for the condition's last transition.
351+
Producers of specific condition types may define expected values and meanings for this field,
352+
and whether the values are considered a guaranteed API.
353+
The value should be a CamelCase string.
354+
This field may not be empty.
355+
maxLength: 1024
348356
minLength: 1
349-
type: string
350-
severity:
351-
description: |-
352-
severity provides an explicit classification of Reason code, so the users or machines can immediately
353-
understand the current situation and act accordingly.
354-
The Severity field MUST be set only when Status=False.
355-
maxLength: 32
357+
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
356358
type: string
357359
status:
358360
description: status of the condition, one of True, False, Unknown.
361+
enum:
362+
- "True"
363+
- "False"
364+
- Unknown
359365
type: string
360366
type:
361-
description: |-
362-
type of condition in CamelCase or in foo.example.com/CamelCase.
363-
Many .condition.type values are consistent across resources like Available, but because arbitrary conditions
364-
can be useful (see .node.status.conditions), the ability to deconflict is important.
365-
maxLength: 256
366-
minLength: 1
367+
description: type of condition in CamelCase or in foo.example.com/CamelCase.
368+
maxLength: 316
369+
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
367370
type: string
368371
required:
369372
- lastTransitionTime
373+
- message
374+
- reason
370375
- status
371376
- type
372377
type: object

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

Lines changed: 29 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -328,51 +328,56 @@ spec:
328328
conditions:
329329
description: Conditions defines current state of the HelmReleaseProxy.
330330
items:
331-
description: Condition defines an observation of a Cluster API resource
332-
operational state.
331+
description: Condition contains details for one aspect of the current
332+
state of this API Resource.
333333
properties:
334334
lastTransitionTime:
335335
description: |-
336336
lastTransitionTime is the last time the condition transitioned from one status to another.
337-
This should be when the underlying condition changed. If that is not known, then using the time when
338-
the API field changed is acceptable.
337+
This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
339338
format: date-time
340339
type: string
341340
message:
342341
description: |-
343342
message is a human readable message indicating details about the transition.
344-
This field may be empty.
345-
maxLength: 10240
346-
minLength: 1
343+
This may be an empty string.
344+
maxLength: 32768
347345
type: string
346+
observedGeneration:
347+
description: |-
348+
observedGeneration represents the .metadata.generation that the condition was set based upon.
349+
For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
350+
with respect to the current state of the instance.
351+
format: int64
352+
minimum: 0
353+
type: integer
348354
reason:
349355
description: |-
350-
reason is the reason for the condition's last transition in CamelCase.
351-
The specific API may choose whether or not this field is considered a guaranteed API.
352-
This field may be empty.
353-
maxLength: 256
356+
reason contains a programmatic identifier indicating the reason for the condition's last transition.
357+
Producers of specific condition types may define expected values and meanings for this field,
358+
and whether the values are considered a guaranteed API.
359+
The value should be a CamelCase string.
360+
This field may not be empty.
361+
maxLength: 1024
354362
minLength: 1
355-
type: string
356-
severity:
357-
description: |-
358-
severity provides an explicit classification of Reason code, so the users or machines can immediately
359-
understand the current situation and act accordingly.
360-
The Severity field MUST be set only when Status=False.
361-
maxLength: 32
363+
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
362364
type: string
363365
status:
364366
description: status of the condition, one of True, False, Unknown.
367+
enum:
368+
- "True"
369+
- "False"
370+
- Unknown
365371
type: string
366372
type:
367-
description: |-
368-
type of condition in CamelCase or in foo.example.com/CamelCase.
369-
Many .condition.type values are consistent across resources like Available, but because arbitrary conditions
370-
can be useful (see .node.status.conditions), the ability to deconflict is important.
371-
maxLength: 256
372-
minLength: 1
373+
description: type of condition in CamelCase or in foo.example.com/CamelCase.
374+
maxLength: 316
375+
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
373376
type: string
374377
required:
375378
- lastTransitionTime
379+
- message
380+
- reason
376381
- status
377382
- type
378383
type: object

config/default/manager_pull_policy.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ spec:
88
spec:
99
containers:
1010
- name: manager
11-
imagePullPolicy: Always
11+
imagePullPolicy: IfNotPresent

controllers/controllers_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2525
"k8s.io/utils/ptr"
2626
addonsv1alpha1 "sigs.k8s.io/cluster-api-addon-provider-helm/api/v1alpha1"
27-
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
27+
clusterv1 "sigs.k8s.io/cluster-api/api/core/v1beta2"
2828
"sigs.k8s.io/cluster-api/util/conditions"
2929
"sigs.k8s.io/cluster-api/util/secret"
3030
"sigs.k8s.io/controller-runtime/pkg/client"
@@ -81,8 +81,8 @@ var (
8181
},
8282
},
8383
Spec: clusterv1.ClusterSpec{
84-
ClusterNetwork: &clusterv1.ClusterNetwork{
85-
APIServerPort: ptr.To(int32(1234)),
84+
ClusterNetwork: clusterv1.ClusterNetwork{
85+
APIServerPort: int32(1234),
8686
},
8787
},
8888
}
@@ -152,7 +152,7 @@ var _ = Describe("Testing HelmChartProxy and HelmReleaseProxy reconcile", func()
152152
Expect(err).ToNot(HaveOccurred())
153153

154154
patch := client.MergeFrom(cluster.DeepCopy())
155-
conditions.MarkTrue(cluster, clusterv1.ControlPlaneInitializedCondition)
155+
cluster.Status.Initialization.ControlPlaneInitialized = ptr.To(true)
156156
err = k8sClient.Status().Patch(ctx, cluster, patch)
157157
Expect(err).ToNot(HaveOccurred())
158158

@@ -224,8 +224,8 @@ var _ = Describe("Testing HelmChartProxy and HelmReleaseProxy reconcile", func()
224224

225225
readyCondition := conditions.Get(helmChartProxy, clusterv1.ReadyCondition)
226226
Expect(readyCondition).NotTo(BeNil())
227-
Expect(readyCondition.Status).To(Equal(corev1.ConditionFalse))
228-
Expect(readyCondition.Message).To(Equal(releaseFailedMessage))
227+
Expect(readyCondition.Status).To(Equal(metav1.ConditionFalse))
228+
Expect(readyCondition.Message).To(ContainSubstring(releaseFailedMessage))
229229

230230
By("Making HelmChartProxy uninstallable")
231231
failedHelmUninstall = false

0 commit comments

Comments
 (0)