@@ -1409,22 +1409,19 @@ var _ = Describe("Fake client", func() {
1409
1409
})
1410
1410
1411
1411
It ("should not change the status of typed objects that have a status subresource on update" , func () {
1412
- obj := & corev1.Node {
1412
+ obj := & corev1.Pod {
1413
1413
ObjectMeta : metav1.ObjectMeta {
1414
- Name : "node" ,
1415
- },
1416
- Status : corev1.NodeStatus {
1417
- NodeInfo : corev1.NodeSystemInfo {MachineID : "machine-id" },
1414
+ Name : "pod" ,
1418
1415
},
1419
1416
}
1420
1417
cl := NewClientBuilder ().WithStatusSubresource (obj ).WithObjects (obj ).Build ()
1421
1418
1422
- obj .Status .NodeInfo . MachineID = "updated-machine-id "
1419
+ obj .Status .Phase = "Running "
1423
1420
Expect (cl .Update (context .Background (), obj )).To (Succeed ())
1424
1421
1425
1422
Expect (cl .Get (context .Background (), client .ObjectKeyFromObject (obj ), obj )).To (Succeed ())
1426
1423
1427
- Expect (obj .Status ).To (BeEquivalentTo (corev1.NodeStatus { NodeInfo : corev1. NodeSystemInfo { MachineID : "machine-id" } }))
1424
+ Expect (obj .Status ).To (BeEquivalentTo (corev1.PodStatus { }))
1428
1425
})
1429
1426
1430
1427
It ("should return a conflict error when an incorrect RV is used on status update" , func () {
@@ -1511,25 +1508,20 @@ var _ = Describe("Fake client", func() {
1511
1508
})
1512
1509
1513
1510
It ("should not change the status of typed objects that have a status subresource on patch" , func () {
1514
- obj := & corev1.Node {
1511
+ obj := & corev1.Pod {
1515
1512
ObjectMeta : metav1.ObjectMeta {
1516
1513
Name : "node" ,
1517
1514
},
1518
- Status : corev1.NodeStatus {
1519
- NodeInfo : corev1.NodeSystemInfo {
1520
- MachineID : "machine-id" ,
1521
- },
1522
- },
1523
1515
}
1524
1516
Expect (cl .Create (context .Background (), obj )).To (Succeed ())
1525
1517
original := obj .DeepCopy ()
1526
1518
1527
- obj .Status .NodeInfo . MachineID = "machine-id-from-patch "
1519
+ obj .Status .Phase = "Running "
1528
1520
Expect (cl .Patch (context .Background (), obj , client .MergeFrom (original ))).To (Succeed ())
1529
1521
1530
1522
Expect (cl .Get (context .Background (), client .ObjectKeyFromObject (obj ), obj )).To (Succeed ())
1531
1523
1532
- Expect (obj .Status ).To (BeEquivalentTo (corev1.NodeStatus { NodeInfo : corev1. NodeSystemInfo { MachineID : "machine-id" } }))
1524
+ Expect (obj .Status ).To (BeEquivalentTo (corev1.PodStatus { }))
1533
1525
})
1534
1526
1535
1527
It ("should not change non-status field of typed objects that have a status subresource on status patch" , func () {
0 commit comments