Skip to content

Commit de4367f

Browse files
authored
Merge pull request #3118 from kersten/main
📖 chore: Add explanatory comment for continuing to use json-patch v4 in the fake client
2 parents 9f4e0f7 + 2694630 commit de4367f

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

pkg/client/fake/client.go

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,19 @@ import (
2929
"sync"
3030
"time"
3131

32-
// Using v4 to match upstream
32+
/*
33+
Stick with gopkg.in/evanphx/json-patch.v4 here to match
34+
upstream Kubernetes code and avoid breaking changes introduced in v5.
35+
- Kubernetes itself remains on json-patch v4 to avoid compatibility issues
36+
tied to v5’s stricter RFC6902 compliance.
37+
- The fake client code is adapted from client-go’s testing fixture, which also
38+
relies on json-patch v4.
39+
See:
40+
https://github.com/kubernetes/kubernetes/pull/91622 (discussion of why K8s
41+
stays on v4)
42+
https://github.com/kubernetes/kubernetes/pull/120326 (v5.6.0+incompatible
43+
missing a critical fix)
44+
*/
3345
jsonpatch "gopkg.in/evanphx/json-patch.v4"
3446
appsv1 "k8s.io/api/apps/v1"
3547
authenticationv1 "k8s.io/api/authentication/v1"
@@ -1138,7 +1150,7 @@ func (c *fakeClient) deleteObjectLocked(gvr schema.GroupVersionResource, accesso
11381150
}
11391151
}
11401152

1141-
//TODO: implement propagation
1153+
// TODO: implement propagation
11421154
return c.tracker.Delete(gvr, accessor.GetNamespace(), accessor.GetName())
11431155
}
11441156

0 commit comments

Comments
 (0)