2
2
use crate :: controller:: Action ;
3
3
use futures:: { TryFuture , TryFutureExt } ;
4
4
use json_patch:: { AddOperation , PatchOperation , RemoveOperation , TestOperation } ;
5
- use jsonptr:: Pointer ;
5
+ use jsonptr:: PointerBuf ;
6
6
use kube_client:: {
7
7
api:: { Patch , PatchParams } ,
8
8
Api , Resource , ResourceExt ,
@@ -142,12 +142,12 @@ where
142
142
// `Test` ensures that we fail instead of deleting someone else's finalizer
143
143
// (in which case a new `Cleanup` event will be sent)
144
144
PatchOperation :: Test ( TestOperation {
145
- path: Pointer :: from_str( finalizer_path. as_str( ) )
145
+ path: PointerBuf :: from_str( finalizer_path. as_str( ) )
146
146
. map_err( |_err| Error :: InvalidFinalizer ) ?,
147
147
value: finalizer_name. into( ) ,
148
148
} ) ,
149
149
PatchOperation :: Remove ( RemoveOperation {
150
- path: Pointer :: from_str( finalizer_path. as_str( ) )
150
+ path: PointerBuf :: from_str( finalizer_path. as_str( ) )
151
151
. map_err( |_err| Error :: InvalidFinalizer ) ?,
152
152
} ) ,
153
153
] ) ) ,
@@ -164,12 +164,12 @@ where
164
164
let patch = json_patch:: Patch ( if obj. finalizers ( ) . is_empty ( ) {
165
165
vec ! [
166
166
PatchOperation :: Test ( TestOperation {
167
- path: Pointer :: from_str( "/metadata/finalizers" )
167
+ path: PointerBuf :: from_str( "/metadata/finalizers" )
168
168
. map_err( |_err| Error :: InvalidFinalizer ) ?,
169
169
value: serde_json:: Value :: Null ,
170
170
} ) ,
171
171
PatchOperation :: Add ( AddOperation {
172
- path: Pointer :: from_str( "/metadata/finalizers" )
172
+ path: PointerBuf :: from_str( "/metadata/finalizers" )
173
173
. map_err( |_err| Error :: InvalidFinalizer ) ?,
174
174
value: vec![ finalizer_name] . into( ) ,
175
175
} ) ,
@@ -180,12 +180,12 @@ where
180
180
// https://github.com/kube-rs/kube/issues/964#issuecomment-1197311254),
181
181
// so we need to fail and retry if anyone else has added the finalizer in the meantime
182
182
PatchOperation :: Test ( TestOperation {
183
- path: Pointer :: from_str( "/metadata/finalizers" )
183
+ path: PointerBuf :: from_str( "/metadata/finalizers" )
184
184
. map_err( |_err| Error :: InvalidFinalizer ) ?,
185
185
value: obj. finalizers( ) . into( ) ,
186
186
} ) ,
187
187
PatchOperation :: Add ( AddOperation {
188
- path: Pointer :: from_str( "/metadata/finalizers/-" )
188
+ path: PointerBuf :: from_str( "/metadata/finalizers/-" )
189
189
. map_err( |_err| Error :: InvalidFinalizer ) ?,
190
190
value: finalizer_name. into( ) ,
191
191
} ) ,
0 commit comments