Skip to content

Commit

Permalink
api: deprecate FailureMessage and FailureReason
Browse files Browse the repository at this point in the history
  • Loading branch information
chrischdi committed Oct 22, 2024
1 parent 7ac4c86 commit 9331dcc
Show file tree
Hide file tree
Showing 11 changed files with 56 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,14 @@ issues:
- linters:
- staticcheck
text: "SA1019: ((deployment|m|md).Spec.RevisionHistoryLimit|clusterv1.RevisionHistoryAnnotation|c.RolloutUndo) is deprecated"
# Deprecations for MHC MaxUnhealthy, UnhealthyRange
# Deprecations for MHC MaxUnhealthy, UnhealthyRange
- linters:
- staticcheck
text: "SA1019: (mhc|m)(.Spec.MaxUnhealthy|.Spec.UnhealthyRange) is deprecated"
# Deprecations for FailureMessage and FailureReason
- linters:
- staticcheck
text: "SA1019: .*\\.Status\\.(FailureMessage|FailureReason) is deprecated: This field is deprecated and is going to be removed in the next apiVersion. Please see docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details."
# Specific exclude rules for deprecated packages that are still part of the codebase. These
# should be removed as the referenced deprecated packages are removed from the project.
- linters:
Expand Down
6 changes: 6 additions & 0 deletions api/v1beta1/cluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -440,11 +440,17 @@ type ClusterStatus struct {
// FailureReason indicates that there is a fatal problem reconciling the
// state, and will be set to a token value suitable for
// programmatic interpretation.
//
// Deprecated: This field is deprecated and is going to be removed in the next apiVersion. Please see docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details.
//
// +optional
FailureReason *capierrors.ClusterStatusError `json:"failureReason,omitempty"`

// FailureMessage indicates that there is a fatal problem reconciling the
// state, and will be set to a descriptive error message.
//
// Deprecated: This field is deprecated and is going to be removed in the next apiVersion. Please see docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details.
//
// +optional
FailureMessage *string `json:"failureMessage,omitempty"`

Expand Down
6 changes: 6 additions & 0 deletions api/v1beta1/machine_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,9 @@ type MachineStatus struct {
// Any transient errors that occur during the reconciliation of Machines
// can be added as events to the Machine object and/or logged in the
// controller's output.
//
// Deprecated: This field is deprecated and is going to be removed in the next apiVersion. Please see docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details.
//
// +optional
FailureReason *capierrors.MachineStatusError `json:"failureReason,omitempty"`

Expand All @@ -484,6 +487,9 @@ type MachineStatus struct {
// Any transient errors that occur during the reconciliation of Machines
// can be added as events to the Machine object and/or logged in the
// controller's output.
//
// Deprecated: This field is deprecated and is going to be removed in the next apiVersion. Please see docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details.
//
// +optional
FailureMessage *string `json:"failureMessage,omitempty"`

Expand Down
5 changes: 5 additions & 0 deletions api/v1beta1/machineset_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,13 @@ type MachineSetStatus struct {
// Any transient errors that occur during the reconciliation of Machines
// can be added as events to the MachineSet object and/or logged in the
// controller's output.
//
// Deprecated: This field is deprecated and is going to be removed in the next apiVersion. Please see docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details.
//
// +optional
FailureReason *capierrors.MachineSetStatusError `json:"failureReason,omitempty"`
// Deprecated: This field is deprecated and is going to be removed in the next apiVersion. Please see docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details.
//
// +optional
FailureMessage *string `json:"failureMessage,omitempty"`
// Conditions defines current service state of the MachineSet.
Expand Down
6 changes: 6 additions & 0 deletions bootstrap/kubeadm/api/v1beta1/kubeadmconfig_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -427,10 +427,16 @@ type KubeadmConfigStatus struct {
DataSecretName *string `json:"dataSecretName,omitempty"`

// FailureReason will be set on non-retryable errors
//
// Deprecated: This field is deprecated and is going to be removed in the next apiVersion. Please see docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details.
//
// +optional
FailureReason string `json:"failureReason,omitempty"`

// FailureMessage will be set on non-retryable errors
//
// Deprecated: This field is deprecated and is going to be removed in the next apiVersion. Please see docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details.
//
// +optional
FailureMessage string `json:"failureMessage,omitempty"`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,11 +290,17 @@ type KubeadmControlPlaneStatus struct {
// FailureReason indicates that there is a terminal problem reconciling the
// state, and will be set to a token value suitable for
// programmatic interpretation.
//
// Deprecated: This field is deprecated and is going to be removed in the next apiVersion. Please see docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details.
//
// +optional
FailureReason errors.KubeadmControlPlaneStatusError `json:"failureReason,omitempty"`

// ErrorMessage indicates that there is a terminal problem reconciling the
// state, and will be set to a descriptive error message.
//
// Deprecated: This field is deprecated and is going to be removed in the next apiVersion. Please see docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details.
//
// +optional
FailureMessage *string `json:"failureMessage,omitempty"`

Expand Down
6 changes: 6 additions & 0 deletions exp/api/v1beta1/machinepool_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,17 @@ type MachinePoolStatus struct {

// FailureReason indicates that there is a problem reconciling the state, and
// will be set to a token value suitable for programmatic interpretation.
//
// Deprecated: This field is deprecated and is going to be removed in the next apiVersion. Please see docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details.
//
// +optional
FailureReason *capierrors.MachinePoolStatusFailure `json:"failureReason,omitempty"`

// FailureMessage indicates that there is a problem reconciling the state,
// and will be set to a descriptive error message.
//
// Deprecated: This field is deprecated and is going to be removed in the next apiVersion. Please see docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details.
//
// +optional
FailureMessage *string `json:"failureMessage,omitempty"`

Expand Down
4 changes: 4 additions & 0 deletions internal/contract/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,17 @@ func (b *BootstrapContract) DataSecretName() *String {
}

// FailureReason provides access to the status.failureReason field in an bootstrap object. Note that this field is optional.
//
// Deprecated: This function is deprecated and is going to be removed. Please see docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details.
func (b *BootstrapContract) FailureReason() *String {
return &String{
path: []string{"status", "failureReason"},
}
}

// FailureMessage provides access to the status.failureMessage field in an bootstrap object. Note that this field is optional.
//
// Deprecated: This function is deprecated and is going to be removed. Please see docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details.
func (b *BootstrapContract) FailureMessage() *String {
return &String{
path: []string{"status", "failureMessage"},
Expand Down
4 changes: 4 additions & 0 deletions internal/contract/controlplane.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,17 @@ func (c *ControlPlaneContract) Selector() *String {
}

// FailureReason provides access to the status.failureReason field in an ControlPlane object. Note that this field is optional.
//
// Deprecated: This function is deprecated and is going to be removed. Please see docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details.
func (c *ControlPlaneContract) FailureReason() *String {
return &String{
path: []string{"status", "failureReason"},
}
}

// FailureMessage provides access to the status.failureMessage field in an ControlPlane object. Note that this field is optional.
//
// Deprecated: This function is deprecated and is going to be removed. Please see docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details.
func (c *ControlPlaneContract) FailureMessage() *String {
return &String{
path: []string{"status", "failureMessage"},
Expand Down
4 changes: 4 additions & 0 deletions internal/contract/infrastructure_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,17 @@ func (c *InfrastructureClusterContract) Ready() *Bool {
}

// FailureReason provides access to the status.failureReason field in an InfrastructureCluster object. Note that this field is optional.
//
// Deprecated: This function is deprecated and is going to be removed. Please see docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details.
func (c *InfrastructureClusterContract) FailureReason() *String {
return &String{
path: []string{"status", "failureReason"},
}
}

// FailureMessage provides access to the status.failureMessage field in an InfrastructureCluster object. Note that this field is optional.
//
// Deprecated: This function is deprecated and is going to be removed. Please see docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details.
func (c *InfrastructureClusterContract) FailureMessage() *String {
return &String{
path: []string{"status", "failureMessage"},
Expand Down
4 changes: 4 additions & 0 deletions internal/contract/infrastructure_machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,17 @@ func (m *InfrastructureMachineContract) ReadyConditionType() string {
}

// FailureReason provides access to the status.failureReason field in an InfrastructureMachine object. Note that this field is optional.
//
// Deprecated: This function is deprecated and is going to be removed. Please see docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details.
func (m *InfrastructureMachineContract) FailureReason() *String {
return &String{
path: []string{"status", "failureReason"},
}
}

// FailureMessage provides access to the status.failureMessage field in an InfrastructureMachine object. Note that this field is optional.
//
// Deprecated: This function is deprecated and is going to be removed. Please see docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details.
func (m *InfrastructureMachineContract) FailureMessage() *String {
return &String{
path: []string{"status", "failureMessage"},
Expand Down

0 comments on commit 9331dcc

Please sign in to comment.