@@ -17,6 +17,7 @@ import (
17
17
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
18
18
"k8s.io/client-go/tools/record"
19
19
"k8s.io/klog/v2"
20
+ "k8s.io/utils/ptr"
20
21
21
22
"sigs.k8s.io/controller-runtime/pkg/client"
22
23
coreclientv1 "sigs.k8s.io/controller-runtime/pkg/client"
@@ -105,7 +106,7 @@ func applyConfigMap(ctx context.Context, client coreclientv1.Client, recorder re
105
106
return false , err
106
107
}
107
108
108
- modified := resourcemerge . BoolPtr (false )
109
+ modified := ptr. To [ bool ] (false )
109
110
existingCopy := existing .DeepCopy ()
110
111
111
112
resourcemerge .EnsureObjectMeta (modified , & existingCopy .ObjectMeta , required .ObjectMeta )
@@ -178,7 +179,7 @@ func applyDeployment(ctx context.Context, client coreclientv1.Client, recorder r
178
179
return false , err
179
180
}
180
181
181
- modified := resourcemerge . BoolPtr (false )
182
+ modified := ptr. To [ bool ] (false )
182
183
existingCopy := existing .DeepCopy ()
183
184
184
185
expectedGeneration := ""
@@ -267,7 +268,7 @@ func applyDaemonSet(ctx context.Context, client coreclientv1.Client, recorder re
267
268
return false , err
268
269
}
269
270
270
- modified := resourcemerge . BoolPtr (false )
271
+ modified := ptr. To [ bool ] (false )
271
272
existingCopy := existing .DeepCopy ()
272
273
273
274
expectedGeneration := ""
@@ -347,7 +348,7 @@ func applyPodDisruptionBudget(ctx context.Context, client coreclientv1.Client, r
347
348
return false , fmt .Errorf ("failed to get pdb for update: %v" , err )
348
349
}
349
350
350
- modified := resourcemerge . BoolPtr (false )
351
+ modified := ptr. To [ bool ] (false )
351
352
existingCopy := existing .DeepCopy ()
352
353
353
354
resourcemerge .EnsureObjectMeta (modified , & existingCopy .ObjectMeta , required .ObjectMeta )
@@ -387,7 +388,7 @@ func applyRole(ctx context.Context, client coreclientv1.Client, recorder record.
387
388
return false , fmt .Errorf ("failed to get role for update: %v" , err )
388
389
}
389
390
390
- modified := resourcemerge . BoolPtr (false )
391
+ modified := ptr. To [ bool ] (false )
391
392
existingCopy := existing .DeepCopy ()
392
393
393
394
resourcemerge .EnsureObjectMeta (modified , & existingCopy .ObjectMeta , required .ObjectMeta )
@@ -425,7 +426,7 @@ func applyClusterRole(ctx context.Context, client coreclientv1.Client, recorder
425
426
return false , fmt .Errorf ("failed to get clusterrole for update: %v" , err )
426
427
}
427
428
428
- modified := resourcemerge . BoolPtr (false )
429
+ modified := ptr. To [ bool ] (false )
429
430
existingCopy := existing .DeepCopy ()
430
431
431
432
resourcemerge .EnsureObjectMeta (modified , & existingCopy .ObjectMeta , required .ObjectMeta )
@@ -464,7 +465,7 @@ func applyRoleBinding(ctx context.Context, client coreclientv1.Client, recorder
464
465
return false , fmt .Errorf ("failed to get rolebinding for update: %v" , err )
465
466
}
466
467
467
- modified := resourcemerge . BoolPtr (false )
468
+ modified := ptr. To [ bool ] (false )
468
469
existingCopy := existing .DeepCopy ()
469
470
requiredCopy := required .DeepCopy ()
470
471
@@ -521,7 +522,7 @@ func applyClusterRoleBinding(ctx context.Context, client coreclientv1.Client, re
521
522
return false , fmt .Errorf ("failed to get clusterrolebinding for update: %v" , err )
522
523
}
523
524
524
- modified := resourcemerge . BoolPtr (false )
525
+ modified := ptr. To [ bool ] (false )
525
526
existingCopy := existing .DeepCopy ()
526
527
requiredCopy := required .DeepCopy ()
527
528
0 commit comments