@@ -30,8 +30,8 @@ import (
3030	"k8s.io/utils/ptr" 
3131	clusterv1 "sigs.k8s.io/cluster-api/api/core/v1beta1" 
3232	"sigs.k8s.io/cluster-api/util" 
33- 	"sigs.k8s.io/cluster-api/util/conditions" 
34- 	"sigs.k8s.io/cluster-api/util/patch" 
33+ 	v1beta1conditions  "sigs.k8s.io/cluster-api/util/deprecated/v1beta1 /conditions" 
34+ 	v1beta1patch  "sigs.k8s.io/cluster-api/util/deprecated/v1beta1 /patch" 
3535	"sigs.k8s.io/controller-runtime/pkg/client" 
3636
3737	infrav1 "sigs.k8s.io/cluster-api-provider-azure/api/v1beta1" 
@@ -75,7 +75,7 @@ func NewMachineScope(params MachineScopeParams) (*MachineScope, error) {
7575		return  nil , errors .New ("azure machine is required when creating a MachineScope" )
7676	}
7777
78- 	helper , err  :=  patch .NewHelper (params .AzureMachine , params .Client )
78+ 	helper , err  :=  v1beta1patch .NewHelper (params .AzureMachine , params .Client )
7979	if  err  !=  nil  {
8080		return  nil , errors .Wrap (err , "failed to init patch helper" )
8181	}
@@ -94,7 +94,7 @@ func NewMachineScope(params MachineScopeParams) (*MachineScope, error) {
9494// MachineScope defines a scope defined around a machine and its cluster. 
9595type  MachineScope  struct  {
9696	client       client.Client 
97- 	patchHelper  * patch .Helper 
97+ 	patchHelper  * v1beta1patch .Helper 
9898
9999	azure.ClusterScoper 
100100	Machine       * clusterv1.Machine 
@@ -611,7 +611,7 @@ func (m *MachineScope) SetFailureReason(v string) {
611611
612612// SetConditionFalse sets the specified AzureMachine condition to false. 
613613func  (m  * MachineScope ) SetConditionFalse (conditionType  clusterv1.ConditionType , reason  string , severity  clusterv1.ConditionSeverity , message  string ) {
614- 	conditions .MarkFalse (m .AzureMachine , conditionType , reason , severity , "%s" , message )
614+ 	v1beta1conditions .MarkFalse (m .AzureMachine , conditionType , reason , severity , "%s" , message )
615615}
616616
617617// SetAnnotation sets a key value annotation on the AzureMachine. 
@@ -656,12 +656,12 @@ func (m *MachineScope) SetAddresses(addrs []corev1.NodeAddress) {
656656
657657// PatchObject persists the machine spec and status. 
658658func  (m  * MachineScope ) PatchObject (ctx  context.Context ) error  {
659- 	conditions .SetSummary (m .AzureMachine )
659+ 	v1beta1conditions .SetSummary (m .AzureMachine )
660660
661661	return  m .patchHelper .Patch (
662662		ctx ,
663663		m .AzureMachine ,
664- 		patch .WithOwnedConditions {Conditions : []clusterv1.ConditionType {
664+ 		v1beta1patch .WithOwnedConditions {Conditions : []clusterv1.ConditionType {
665665			clusterv1 .ReadyCondition ,
666666			infrav1 .VMRunningCondition ,
667667			infrav1 .AvailabilitySetReadyCondition ,
@@ -789,35 +789,35 @@ func (m *MachineScope) DeleteLongRunningOperationState(name, service, futureType
789789func  (m  * MachineScope ) UpdateDeleteStatus (condition  clusterv1.ConditionType , service  string , err  error ) {
790790	switch  {
791791	case  err  ==  nil :
792- 		conditions .MarkFalse (m .AzureMachine , condition , infrav1 .DeletedReason , clusterv1 .ConditionSeverityInfo , "%s successfully deleted" , service )
792+ 		v1beta1conditions .MarkFalse (m .AzureMachine , condition , infrav1 .DeletedReason , clusterv1 .ConditionSeverityInfo , "%s successfully deleted" , service )
793793	case  azure .IsOperationNotDoneError (err ):
794- 		conditions .MarkFalse (m .AzureMachine , condition , infrav1 .DeletingReason , clusterv1 .ConditionSeverityInfo , "%s deleting" , service )
794+ 		v1beta1conditions .MarkFalse (m .AzureMachine , condition , infrav1 .DeletingReason , clusterv1 .ConditionSeverityInfo , "%s deleting" , service )
795795	default :
796- 		conditions .MarkFalse (m .AzureMachine , condition , infrav1 .DeletionFailedReason , clusterv1 .ConditionSeverityError , "%s failed to delete. err: %s" , service , err .Error ())
796+ 		v1beta1conditions .MarkFalse (m .AzureMachine , condition , infrav1 .DeletionFailedReason , clusterv1 .ConditionSeverityError , "%s failed to delete. err: %s" , service , err .Error ())
797797	}
798798}
799799
800800// UpdatePutStatus updates a condition on the AzureMachine status after a PUT operation. 
801801func  (m  * MachineScope ) UpdatePutStatus (condition  clusterv1.ConditionType , service  string , err  error ) {
802802	switch  {
803803	case  err  ==  nil :
804- 		conditions .MarkTrue (m .AzureMachine , condition )
804+ 		v1beta1conditions .MarkTrue (m .AzureMachine , condition )
805805	case  azure .IsOperationNotDoneError (err ):
806- 		conditions .MarkFalse (m .AzureMachine , condition , infrav1 .CreatingReason , clusterv1 .ConditionSeverityInfo , "%s creating or updating" , service )
806+ 		v1beta1conditions .MarkFalse (m .AzureMachine , condition , infrav1 .CreatingReason , clusterv1 .ConditionSeverityInfo , "%s creating or updating" , service )
807807	default :
808- 		conditions .MarkFalse (m .AzureMachine , condition , infrav1 .FailedReason , clusterv1 .ConditionSeverityError , "%s failed to create or update. err: %s" , service , err .Error ())
808+ 		v1beta1conditions .MarkFalse (m .AzureMachine , condition , infrav1 .FailedReason , clusterv1 .ConditionSeverityError , "%s failed to create or update. err: %s" , service , err .Error ())
809809	}
810810}
811811
812812// UpdatePatchStatus updates a condition on the AzureMachine status after a PATCH operation. 
813813func  (m  * MachineScope ) UpdatePatchStatus (condition  clusterv1.ConditionType , service  string , err  error ) {
814814	switch  {
815815	case  err  ==  nil :
816- 		conditions .MarkTrue (m .AzureMachine , condition )
816+ 		v1beta1conditions .MarkTrue (m .AzureMachine , condition )
817817	case  azure .IsOperationNotDoneError (err ):
818- 		conditions .MarkFalse (m .AzureMachine , condition , infrav1 .UpdatingReason , clusterv1 .ConditionSeverityInfo , "%s updating" , service )
818+ 		v1beta1conditions .MarkFalse (m .AzureMachine , condition , infrav1 .UpdatingReason , clusterv1 .ConditionSeverityInfo , "%s updating" , service )
819819	default :
820- 		conditions .MarkFalse (m .AzureMachine , condition , infrav1 .FailedReason , clusterv1 .ConditionSeverityError , "%s failed to update. err: %s" , service , err .Error ())
820+ 		v1beta1conditions .MarkFalse (m .AzureMachine , condition , infrav1 .FailedReason , clusterv1 .ConditionSeverityError , "%s failed to update. err: %s" , service , err .Error ())
821821	}
822822}
823823
0 commit comments