diff --git a/config/crd/bases/exp.infrastructure.cluster.x-k8s.io_azuremachinepools.yaml b/config/crd/bases/exp.infrastructure.cluster.x-k8s.io_azuremachinepools.yaml index ebfbf8926d8..01a2d4cbc87 100644 --- a/config/crd/bases/exp.infrastructure.cluster.x-k8s.io_azuremachinepools.yaml +++ b/config/crd/bases/exp.infrastructure.cluster.x-k8s.io_azuremachinepools.yaml @@ -339,8 +339,52 @@ spec: status: description: AzureMachinePoolStatus defines the observed state of AzureMachinePool properties: + conditions: + description: Conditions defines current service state of the AzureMachinePool. + items: + description: Condition defines an observation of a Cluster API resource + operational state. + properties: + lastTransitionTime: + description: Last time the condition transitioned from one status + to another. This should be when the underlying condition changed. + If that is not known, then using the time when the API field + changed is acceptable. + format: date-time + type: string + message: + description: A human readable message indicating details about + the transition. This field may be empty. + type: string + reason: + 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. + type: string + severity: + description: 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. + type: string + type: + description: 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 + required: + - status + - type + type: object + type: array failureMessage: - description: "ErrorMessage will be set in the event that there is + description: "FailureMessage will be set in the event that there is a terminal problem reconciling the MachinePool and will contain a more verbose string suitable for logging and human consumption. \n This field should not be set for transitive errors that a controller @@ -356,9 +400,9 @@ spec: output." type: string failureReason: - description: "ErrorReason will be set in the event that there is a - terminal problem reconciling the MachinePool and will contain a - succinct value suitable for machine interpretation. \n This field + description: "FailureReason will be set in the event that there is + a terminal problem reconciling the MachinePool and will contain + a succinct value suitable for machine interpretation. \n 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 diff --git a/exp/api/v1alpha3/azuremachinepool_types.go b/exp/api/v1alpha3/azuremachinepool_types.go index 5c7b5ddc56a..d64f7371f2c 100644 --- a/exp/api/v1alpha3/azuremachinepool_types.go +++ b/exp/api/v1alpha3/azuremachinepool_types.go @@ -18,6 +18,7 @@ package v1alpha3 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha3" "sigs.k8s.io/cluster-api/errors" infrav1 "sigs.k8s.io/cluster-api-provider-azure/api/v1alpha3" @@ -126,7 +127,7 @@ type ( // +optional ProvisioningState *infrav1.VMState `json:"provisioningState,omitempty"` - // ErrorReason will be set in the event that there is a terminal problem + // FailureReason will be set in the event that there is a terminal problem // reconciling the MachinePool and will contain a succinct value suitable // for machine interpretation. // @@ -145,7 +146,7 @@ type ( // +optional FailureReason *errors.MachineStatusError `json:"failureReason,omitempty"` - // ErrorMessage will be set in the event that there is a terminal problem + // FailureMessage will be set in the event that there is a terminal problem // reconciling the MachinePool and will contain a more verbose string suitable // for logging and human consumption. // @@ -163,6 +164,10 @@ type ( // controller's output. // +optional FailureMessage *string `json:"failureMessage,omitempty"` + + // Conditions defines current service state of the AzureMachinePool. + // +optional + Conditions clusterv1.Conditions `json:"conditions,omitempty"` } // AzureMachinePoolInstanceStatus provides status information for each instance in the VMSS @@ -219,6 +224,16 @@ type ( } ) +// GetConditions returns the list of conditions for an AzureMachinePool API object. +func (amp *AzureMachinePool) GetConditions() clusterv1.Conditions { + return amp.Status.Conditions +} + +// SetConditions will set the given conditions on an AzureMachinePool object +func (amp *AzureMachinePool) SetConditions(conditions clusterv1.Conditions) { + amp.Status.Conditions = conditions +} + func init() { SchemeBuilder.Register(&AzureMachinePool{}, &AzureMachinePoolList{}) } diff --git a/exp/api/v1alpha3/zz_generated.deepcopy.go b/exp/api/v1alpha3/zz_generated.deepcopy.go index ed4163ede11..90e80b9862e 100644 --- a/exp/api/v1alpha3/zz_generated.deepcopy.go +++ b/exp/api/v1alpha3/zz_generated.deepcopy.go @@ -23,6 +23,7 @@ package v1alpha3 import ( "k8s.io/apimachinery/pkg/runtime" apiv1alpha3 "sigs.k8s.io/cluster-api-provider-azure/api/v1alpha3" + cluster_apiapiv1alpha3 "sigs.k8s.io/cluster-api/api/v1alpha3" "sigs.k8s.io/cluster-api/errors" ) @@ -167,6 +168,13 @@ func (in *AzureMachinePoolStatus) DeepCopyInto(out *AzureMachinePoolStatus) { *out = new(string) **out = **in } + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make(cluster_apiapiv1alpha3.Conditions, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureMachinePoolStatus.