@@ -30,8 +30,8 @@ import (
30
30
"k8s.io/utils/ptr"
31
31
clusterv1 "sigs.k8s.io/cluster-api/api/core/v1beta1"
32
32
"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"
35
35
"sigs.k8s.io/controller-runtime/pkg/client"
36
36
37
37
infrav1 "sigs.k8s.io/cluster-api-provider-azure/api/v1beta1"
@@ -75,7 +75,7 @@ func NewMachineScope(params MachineScopeParams) (*MachineScope, error) {
75
75
return nil , errors .New ("azure machine is required when creating a MachineScope" )
76
76
}
77
77
78
- helper , err := patch .NewHelper (params .AzureMachine , params .Client )
78
+ helper , err := v1beta1patch .NewHelper (params .AzureMachine , params .Client )
79
79
if err != nil {
80
80
return nil , errors .Wrap (err , "failed to init patch helper" )
81
81
}
@@ -94,7 +94,7 @@ func NewMachineScope(params MachineScopeParams) (*MachineScope, error) {
94
94
// MachineScope defines a scope defined around a machine and its cluster.
95
95
type MachineScope struct {
96
96
client client.Client
97
- patchHelper * patch .Helper
97
+ patchHelper * v1beta1patch .Helper
98
98
99
99
azure.ClusterScoper
100
100
Machine * clusterv1.Machine
@@ -611,7 +611,7 @@ func (m *MachineScope) SetFailureReason(v string) {
611
611
612
612
// SetConditionFalse sets the specified AzureMachine condition to false.
613
613
func (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 )
615
615
}
616
616
617
617
// SetAnnotation sets a key value annotation on the AzureMachine.
@@ -656,12 +656,12 @@ func (m *MachineScope) SetAddresses(addrs []corev1.NodeAddress) {
656
656
657
657
// PatchObject persists the machine spec and status.
658
658
func (m * MachineScope ) PatchObject (ctx context.Context ) error {
659
- conditions .SetSummary (m .AzureMachine )
659
+ v1beta1conditions .SetSummary (m .AzureMachine )
660
660
661
661
return m .patchHelper .Patch (
662
662
ctx ,
663
663
m .AzureMachine ,
664
- patch .WithOwnedConditions {Conditions : []clusterv1.ConditionType {
664
+ v1beta1patch .WithOwnedConditions {Conditions : []clusterv1.ConditionType {
665
665
clusterv1 .ReadyCondition ,
666
666
infrav1 .VMRunningCondition ,
667
667
infrav1 .AvailabilitySetReadyCondition ,
@@ -789,35 +789,35 @@ func (m *MachineScope) DeleteLongRunningOperationState(name, service, futureType
789
789
func (m * MachineScope ) UpdateDeleteStatus (condition clusterv1.ConditionType , service string , err error ) {
790
790
switch {
791
791
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 )
793
793
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 )
795
795
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 ())
797
797
}
798
798
}
799
799
800
800
// UpdatePutStatus updates a condition on the AzureMachine status after a PUT operation.
801
801
func (m * MachineScope ) UpdatePutStatus (condition clusterv1.ConditionType , service string , err error ) {
802
802
switch {
803
803
case err == nil :
804
- conditions .MarkTrue (m .AzureMachine , condition )
804
+ v1beta1conditions .MarkTrue (m .AzureMachine , condition )
805
805
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 )
807
807
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 ())
809
809
}
810
810
}
811
811
812
812
// UpdatePatchStatus updates a condition on the AzureMachine status after a PATCH operation.
813
813
func (m * MachineScope ) UpdatePatchStatus (condition clusterv1.ConditionType , service string , err error ) {
814
814
switch {
815
815
case err == nil :
816
- conditions .MarkTrue (m .AzureMachine , condition )
816
+ v1beta1conditions .MarkTrue (m .AzureMachine , condition )
817
817
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 )
819
819
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 ())
821
821
}
822
822
}
823
823
0 commit comments