Skip to content

Commit 07ec67c

Browse files
authored
Merge branch 'kubernetes-sigs:main' into feat/report-port-creation-failure-condition
2 parents 6cd06ff + ec3c3ce commit 07ec67c

File tree

24 files changed

+922
-60
lines changed

24 files changed

+922
-60
lines changed

.golangci.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,15 @@ linters:
186186
- linters:
187187
- staticcheck
188188
text: 'SA1019: "sigs.k8s.io/cluster-api/util/deprecated/v1beta1/conditions" is deprecated: This package is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details.'
189+
- linters:
190+
- staticcheck
191+
text: 'SA1019: .*.Status.Ready is deprecated: This field is deprecated and will be removed in a future API version. Use status.conditions to determine the ready state of the cluster.'
192+
- linters:
193+
- staticcheck
194+
text: 'SA1019: .*.Status.FailureReason is deprecated: This field is deprecated and will be removed in a future API version. Use status.conditions to report failures.'
195+
- linters:
196+
- staticcheck
197+
text: 'SA1019: .*.Status.FailureMessage is deprecated: This field is deprecated and will be removed in a future API version. Use status.conditions to report failures.'
189198
paths:
190199
- zz_generated.*\.go$
191200
- third_party$

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,7 @@ generate-release-notes: $(RELEASE_NOTES_DIR) $(RELEASE_NOTES)
552552
fi
553553
"$(RELEASE_NOTES)" --repository=kubernetes-sigs/cluster-api-provider-openstack \
554554
--prefix-area-label=false --add-kubernetes-version-support=false \
555-
--from=$(PREVIOUS_TAG) --release=$(RELEASE_TAG) >> $(RELEASE_NOTES_DIR)/$(RELEASE_TAG).md
555+
--from=tags/$(PREVIOUS_TAG) --release=$(RELEASE_TAG) >> $(RELEASE_NOTES_DIR)/$(RELEASE_TAG).md
556556

557557
.PHONY: templates
558558
templates: ## Generate cluster templates

api/v1beta1/conditions_consts.go

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,32 @@ const (
7171
// PortCreateFailedReason used when creating a port failed.
7272
PortCreateFailedReason = "PortCreateFailed"
7373
)
74+
75+
const (
76+
// NetworkReadyCondition reports on the current status of the cluster network infrastructure.
77+
// Ready indicates that the network, subnets, and related resources have been successfully provisioned.
78+
NetworkReadyCondition clusterv1beta1.ConditionType = "NetworkReady"
79+
80+
// RouterReadyCondition reports on the current status of the cluster router infrastructure.
81+
// Ready indicates that the router and its interfaces have been successfully provisioned.
82+
RouterReadyCondition clusterv1beta1.ConditionType = "RouterReady"
83+
84+
// SecurityGroupsReadyCondition reports on the current status of the cluster security groups.
85+
// Ready indicates that all required security groups have been successfully provisioned.
86+
SecurityGroupsReadyCondition clusterv1beta1.ConditionType = "SecurityGroupsReady"
87+
88+
// APIEndpointReadyCondition reports on the current status of the cluster API endpoint.
89+
// Ready indicates that the control plane endpoint has been successfully configured.
90+
APIEndpointReadyCondition clusterv1beta1.ConditionType = "APIEndpointReady"
91+
92+
// NetworkReconcileFailedReason is used when network reconciliation fails.
93+
NetworkReconcileFailedReason = "NetworkCreateFailed"
94+
// SubnetReconcileFailedReason is used when subnet reconciliation fails.
95+
SubnetReconcileFailedReason = "SubnetCreateFailed"
96+
// RouterReconcileFailedReason is used when router reconciliation fails.
97+
RouterReconcileFailedReason = "RouterCreateFailed"
98+
// SecurityGroupReconcileFailedReason is used when security group reconciliation fails.
99+
SecurityGroupReconcileFailedReason = "SecurityGroupCreateFailed"
100+
// APIEndpointConfigFailedReason is used when API endpoint configuration fails.
101+
APIEndpointConfigFailedReason = "APIEndpointConfigFailed"
102+
)

api/v1beta1/openstackcluster_types.go

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,12 +196,27 @@ type OpenStackClusterSpec struct {
196196
IdentityRef OpenStackIdentityReference `json:"identityRef"`
197197
}
198198

199+
// ClusterInitialization represents the initialization status of the cluster.
200+
type ClusterInitialization struct {
201+
// Provisioned is set to true when the initial provisioning of the cluster infrastructure is completed.
202+
// The value of this field is never updated after provisioning is completed.
203+
// +optional
204+
Provisioned bool `json:"provisioned,omitempty"`
205+
}
206+
199207
// OpenStackClusterStatus defines the observed state of OpenStackCluster.
200208
type OpenStackClusterStatus struct {
201209
// Ready is true when the cluster infrastructure is ready.
210+
//
211+
// Deprecated: This field is deprecated and will be removed in a future API version.
212+
// Use status.conditions to determine the ready state of the cluster.
202213
// +kubebuilder:default=false
203214
Ready bool `json:"ready"`
204215

216+
// Initialization contains information about the initialization status of the cluster.
217+
// +optional
218+
Initialization *ClusterInitialization `json:"initialization,omitempty"`
219+
205220
// Network contains information about the created OpenStack Network.
206221
// +optional
207222
Network *NetworkStatusWithSubnets `json:"network,omitempty"`
@@ -257,6 +272,9 @@ type OpenStackClusterStatus struct {
257272
// Any transient errors that occur during the reconciliation of
258273
// OpenStackClusters can be added as events to the OpenStackCluster object
259274
// and/or logged in the controller's output.
275+
//
276+
// Deprecated: This field is deprecated and will be removed in a future API version.
277+
// Use status.conditions to report failures.
260278
// +optional
261279
FailureReason *capoerrors.DeprecatedCAPIClusterStatusError `json:"failureReason,omitempty"`
262280

@@ -276,8 +294,18 @@ type OpenStackClusterStatus struct {
276294
// Any transient errors that occur during the reconciliation of
277295
// OpenStackClusters can be added as events to the OpenStackCluster object
278296
// and/or logged in the controller's output.
297+
//
298+
// Deprecated: This field is deprecated and will be removed in a future API version.
299+
// Use status.conditions to report failures.
279300
// +optional
280301
FailureMessage *string `json:"failureMessage,omitempty"`
302+
303+
// Conditions defines current service state of the OpenStackCluster.
304+
// This field surfaces into Cluster's status.conditions[InfrastructureReady] condition.
305+
// The Ready condition must surface issues during the entire lifecycle of the OpenStackCluster
306+
// (both during initial provisioning and after the initial provisioning is completed).
307+
// +optional
308+
Conditions clusterv1beta1.Conditions `json:"conditions,omitempty"`
281309
}
282310

283311
// +genclient
@@ -344,6 +372,16 @@ type ManagedSecurityGroups struct {
344372

345373
var _ IdentityRefProvider = &OpenStackCluster{}
346374

375+
// GetConditions returns the observations of the operational state of the OpenStackCluster resource.
376+
func (c *OpenStackCluster) GetConditions() clusterv1beta1.Conditions {
377+
return c.Status.Conditions
378+
}
379+
380+
// SetConditions sets the underlying service state of the OpenStackCluster to the predescribed clusterv1.Conditions.
381+
func (c *OpenStackCluster) SetConditions(conditions clusterv1beta1.Conditions) {
382+
c.Status.Conditions = conditions
383+
}
384+
347385
// GetIdentifyRef returns the cluster's namespace and IdentityRef.
348386
func (c *OpenStackCluster) GetIdentityRef() (*string, *OpenStackIdentityReference) {
349387
return &c.Namespace, &c.Spec.IdentityRef

api/v1beta1/zz_generated.deepcopy.go

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

cmd/models-schema/zz_generated.openapi.go

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

0 commit comments

Comments
 (0)