-
Notifications
You must be signed in to change notification settings - Fork 8
feat: upgrade cluster-api to v1.9.11 with v1beta2 conditions #352
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
969138b
a02cd77
80cae03
94f12b0
b17559b
b30341b
fe2c00e
ae66a2b
33fc4f3
a8f4dcd
9a024a0
926b377
7221ab4
83cbe3f
7097446
9cb522b
78b371d
4b756f2
98104d8
303b67d
66aa22b
cb902f3
d22c362
b63845c
4283ded
4f09093
cd2e8e9
b8c4301
07ecdc1
dc984b5
e1f4784
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,8 +20,6 @@ import ( | |
| "strings" | ||
|
|
||
| metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
| clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" | ||
| "sigs.k8s.io/cluster-api/errors" | ||
|
|
||
| "github.com/ionos-cloud/cluster-api-provider-ionoscloud/internal/util/ptr" | ||
| ) | ||
|
|
@@ -38,7 +36,7 @@ const ( | |
|
|
||
| // MachineProvisionedCondition documents the status of the provisioning of a IonosCloudMachine and | ||
| // the underlying VM. | ||
| MachineProvisionedCondition clusterv1.ConditionType = "MachineProvisioned" | ||
| MachineProvisionedCondition = "MachineProvisioned" | ||
|
|
||
| // WaitingForClusterInfrastructureReason (Severity=Info) indicates that the IonosCloudMachine is currently | ||
| // waiting for the cluster infrastructure to become ready. | ||
|
|
@@ -296,47 +294,11 @@ type IonosCloudMachineStatus struct { | |
| //+optional | ||
| MachineNetworkInfo *MachineNetworkInfo `json:"machineNetworkInfo,omitempty"` | ||
|
|
||
| // FailureReason will be set in the event that there is a terminal problem | ||
| // reconciling the Machine and will contain a succinct value suitable | ||
| // for machine interpretation. | ||
| // | ||
| // This field should not be set for transitive errors that a controller | ||
| // faces that are expected to be fixed automatically over | ||
| // time (like service outages), but instead indicate that something is | ||
| // fundamentally wrong with the Machine's spec or the configuration of | ||
| // the controller, and that manual intervention is required. Examples | ||
| // of terminal errors would be invalid combinations of settings in the | ||
| // spec, values that are unsupported by the controller, or the | ||
| // responsible controller itself being critically misconfigured. | ||
| // | ||
| // Any transient errors that occur during the reconciliation of IonosCloudMachines | ||
| // can be added as events to the IonosCloudMachine object and/or logged in the | ||
| // controller's output. | ||
| //+optional | ||
| FailureReason *errors.MachineStatusError `json:"failureReason,omitempty"` | ||
|
|
||
| // FailureMessage will be set in the event that there is a terminal problem | ||
| // reconciling the Machine and will contain a more verbose string suitable | ||
| // for logging and human consumption. | ||
| // | ||
| // This field should not be set for transitive errors that a controller | ||
| // faces that are expected to be fixed automatically over | ||
| // time (like service outages), but instead indicate that something is | ||
| // fundamentally wrong with the Machine's spec or the configuration of | ||
| // the controller, and that manual intervention is required. Examples | ||
| // of terminal errors would be invalid combinations of settings in the | ||
| // spec, values that are unsupported by the controller, or the | ||
| // responsible controller itself being critically misconfigured. | ||
| // | ||
| // Any transient errors that occur during the reconciliation of IonosCloudMachines | ||
| // can be added as events to the IonosCloudMachine object and/or logged in the | ||
| // controller's output. | ||
| //+optional | ||
| FailureMessage *string `json:"failureMessage,omitempty"` | ||
|
|
||
| // Conditions defines current service state of the IonosCloudMachine. | ||
| //+optional | ||
| Conditions clusterv1.Conditions `json:"conditions,omitempty"` | ||
| //+listType=map | ||
| //+listMapKey=type | ||
| Conditions []metav1.Condition `json:"conditions,omitempty"` | ||
|
|
||
| // CurrentRequest shows the current provisioning request for any | ||
| // cloud resource that is being provisioned. | ||
|
|
@@ -406,13 +368,13 @@ type IonosCloudMachineList struct { | |
| Items []IonosCloudMachine `json:"items"` | ||
| } | ||
|
|
||
| // GetConditions returns the observations of the operational state of the IonosCloudMachine resource. | ||
| func (m *IonosCloudMachine) GetConditions() clusterv1.Conditions { | ||
| // GetV1Beta2Conditions returns the v1beta2 conditions from the status. | ||
| func (m *IonosCloudMachine) GetV1Beta2Conditions() []metav1.Condition { | ||
| return m.Status.Conditions | ||
| } | ||
|
|
||
| // SetConditions sets the underlying service state of the IonosCloudMachine to the predescribed clusterv1.Conditions. | ||
| func (m *IonosCloudMachine) SetConditions(conditions clusterv1.Conditions) { | ||
| // SetV1Beta2Conditions sets the v1beta2 conditions in the status. | ||
| func (m *IonosCloudMachine) SetV1Beta2Conditions(conditions []metav1.Condition) { | ||
| m.Status.Conditions = conditions | ||
| } | ||
|
Comment on lines
+371
to
+379
|
||
|
|
||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New v1beta2 condition accessor methods (GetV1Beta2Conditions/SetV1Beta2Conditions) are introduced here, but there are no tests covering the expected behavior (returning nil when Status.V1Beta2 is nil, initializing Status.V1Beta2 on Set, and preserving list-map semantics). Adding a small unit test alongside existing status/conditions tests would help prevent regressions.