2
2
// The .NET Foundation licenses this file to you under the Apache 2.0 License.
3
3
// See the LICENSE file in the project root for more information.
4
4
5
+ using System . Runtime . Versioning ;
6
+
5
7
using Json . Patch ;
6
8
7
9
using k8s ;
@@ -338,6 +340,10 @@ TEntity UpdateStatus<TEntity>(TEntity entity)
338
340
/// <param name="cancellationToken">Cancellation token to monitor for cancellation requests.</param>
339
341
/// <returns>The patched entity.</returns>
340
342
/// <exception cref="InvalidOperationException">Thrown if the entity to be patched does not exist on the API.</exception>
343
+ [ RequiresPreviewFeatures ( "This method is using the JsonPatch feature which is in preview." +
344
+ "Return values may change (e.g. if the patch was actually applied" +
345
+ "when no changes were detected. Also, the filtering may not include" +
346
+ "all volatile properties yet." ) ]
341
347
Task < TEntity > PatchAsync < TEntity > (
342
348
TEntity entity ,
343
349
Func < IReadOnlyList < PatchOperation > , IReadOnlyList < PatchOperation > > ? operationsFilter = null ,
@@ -370,6 +376,10 @@ Task<TEntity> PatchAsync<TEntity>(
370
376
/// <param name="operationsFilter">The filter that is applied to the <see cref="PatchOperation"/>s in the <see cref="JsonPatch"/> to determine if changes are present.</param>
371
377
/// <param name="cancellationToken">Cancellation token to monitor for cancellation requests.</param>
372
378
/// <returns>The patched entity.</returns>
379
+ [ RequiresPreviewFeatures ( "This method is using the JsonPatch feature which is in preview." +
380
+ "Return values may change (e.g. if the patch was actually applied" +
381
+ "when no changes were detected. Also, the filtering may not include" +
382
+ "all volatile properties yet." ) ]
373
383
Task < TEntity > PatchAsync < TEntity > (
374
384
TEntity from ,
375
385
TEntity to ,
@@ -391,6 +401,10 @@ Task<TEntity> PatchAsync<TEntity>(
391
401
/// <param name="patch">The <see cref="JsonPatch"/> representing the changes to apply.</param>
392
402
/// <param name="cancellationToken">Cancellation token to monitor for cancellation requests.</param>
393
403
/// <returns>The patched entity.</returns>
404
+ [ RequiresPreviewFeatures ( "This method is using the JsonPatch feature which is in preview." +
405
+ "Return values may change (e.g. if the patch was actually applied" +
406
+ "when no changes were detected. Also, the filtering may not include" +
407
+ "all volatile properties yet." ) ]
394
408
Task < TEntity > PatchAsync < TEntity > ( TEntity entity , JsonPatch patch , CancellationToken cancellationToken = default )
395
409
where TEntity : IKubernetesObject < V1ObjectMeta > =>
396
410
PatchAsync ( entity , patch . ToKubernetesPatch ( ) , cancellationToken ) ;
@@ -430,6 +444,10 @@ Task<TEntity> PatchAsync<TEntity>(
430
444
/// <param name="entity">The entity containing the desired updates.</param>
431
445
/// <returns>The patched entity.</returns>
432
446
/// <exception cref="InvalidOperationException">Thrown if the entity to be patched does not exist on the API.</exception>
447
+ [ RequiresPreviewFeatures ( "This method is using the JsonPatch feature which is in preview." +
448
+ "Return values may change (e.g. if the patch was actually applied" +
449
+ "when no changes were detected. Also, the filtering may not include" +
450
+ "all volatile properties yet." ) ]
433
451
TEntity Patch < TEntity > ( TEntity entity )
434
452
where TEntity : IKubernetesObject < V1ObjectMeta >
435
453
=> PatchAsync ( entity ) . GetAwaiter ( ) . GetResult ( ) ;
@@ -441,6 +459,10 @@ TEntity Patch<TEntity>(TEntity entity)
441
459
/// <param name="from">The current/original entity.</param>
442
460
/// <param name="to">The updated entity with desired changes.</param>
443
461
/// <returns>The patched entity.</returns>
462
+ [ RequiresPreviewFeatures ( "This method is using the JsonPatch feature which is in preview." +
463
+ "Return values may change (e.g. if the patch was actually applied" +
464
+ "when no changes were detected. Also, the filtering may not include" +
465
+ "all volatile properties yet." ) ]
444
466
TEntity Patch < TEntity > ( TEntity from , TEntity to )
445
467
where TEntity : IKubernetesObject < V1ObjectMeta >
446
468
=> PatchAsync ( from , to ) . GetAwaiter ( ) . GetResult ( ) ;
@@ -452,6 +474,10 @@ TEntity Patch<TEntity>(TEntity from, TEntity to)
452
474
/// <param name="entity">The entity to patch.</param>
453
475
/// <param name="patch">The <see cref="JsonPatch"/> representing the changes to apply.</param>
454
476
/// <returns>The patched entity.</returns>
477
+ [ RequiresPreviewFeatures ( "This method is using the JsonPatch feature which is in preview." +
478
+ "Return values may change (e.g. if the patch was actually applied" +
479
+ "when no changes were detected. Also, the filtering may not include" +
480
+ "all volatile properties yet." ) ]
455
481
TEntity Patch < TEntity > ( TEntity entity , JsonPatch patch )
456
482
where TEntity : IKubernetesObject < V1ObjectMeta >
457
483
=> PatchAsync ( entity , patch ) . GetAwaiter ( ) . GetResult ( ) ;
0 commit comments