@@ -29,6 +29,7 @@ import (
29
29
"sigs.k8s.io/controller-runtime/pkg/client/apiutil"
30
30
31
31
clusterv1beta1 "sigs.k8s.io/cluster-api/api/v1beta1"
32
+ clusterv1 "sigs.k8s.io/cluster-api/api/v1beta2"
32
33
"sigs.k8s.io/cluster-api/util/annotations"
33
34
v1beta2conditions "sigs.k8s.io/cluster-api/util/deprecated/v1beta1/conditions/v1beta2"
34
35
"sigs.k8s.io/cluster-api/util/deprecated/v1beta1/patch"
@@ -41,7 +42,7 @@ type ConditionSetter interface {
41
42
}
42
43
43
44
// EnsurePausedCondition sets the paused condition on the object and returns if it should be considered as paused.
44
- func EnsurePausedCondition (ctx context.Context , c client.Client , cluster * clusterv1beta1 .Cluster , obj ConditionSetter ) (isPaused bool , requeue bool , err error ) {
45
+ func EnsurePausedCondition (ctx context.Context , c client.Client , cluster * clusterv1 .Cluster , obj ConditionSetter ) (isPaused bool , requeue bool , err error ) {
45
46
oldCondition := v1beta2conditions .Get (obj , clusterv1beta1 .PausedV1Beta2Condition )
46
47
newCondition := pausedCondition (c .Scheme (), cluster , obj , clusterv1beta1 .PausedV1Beta2Condition )
47
48
@@ -90,7 +91,7 @@ func EnsurePausedCondition(ctx context.Context, c client.Client, cluster *cluste
90
91
}
91
92
92
93
// pausedCondition sets the paused condition on the object and returns if it should be considered as paused.
93
- func pausedCondition (scheme * runtime.Scheme , cluster * clusterv1beta1 .Cluster , obj ConditionSetter , targetConditionType string ) metav1.Condition {
94
+ func pausedCondition (scheme * runtime.Scheme , cluster * clusterv1 .Cluster , obj ConditionSetter , targetConditionType string ) metav1.Condition {
94
95
if (cluster != nil && cluster .Spec .Paused ) || annotations .HasPaused (obj ) {
95
96
var messages []string
96
97
if cluster != nil && cluster .Spec .Paused {
0 commit comments