File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -355,6 +355,10 @@ type PatchOptions struct {
355
355
// It's probably what controllers want to do.
356
356
Force * bool
357
357
358
+ // FieldManager is the name of the user or component submitting
359
+ // this request. It must be set with server-side apply.
360
+ FieldManager string
361
+
358
362
// Raw represets raw patch options, passed directly to the server.
359
363
Raw * metav1.PatchOptions
360
364
}
@@ -378,6 +382,7 @@ func (o *PatchOptions) AsPatchOptions() *metav1.PatchOptions {
378
382
379
383
o .Raw .DryRun = o .DryRun
380
384
o .Raw .Force = o .Force
385
+ o .Raw .FieldManager = o .FieldManager
381
386
return o .Raw
382
387
}
383
388
@@ -400,3 +405,10 @@ var ForceOwnership PatchOptionFunc = func(opts *PatchOptions) {
400
405
var PatchDryRunAll PatchOptionFunc = func (opts * PatchOptions ) {
401
406
opts .DryRun = []string {metav1 .DryRunAll }
402
407
}
408
+
409
+ // FieldManager set the field manager name for the given server-side apply patch.
410
+ func FieldManager (name string ) PatchOptionFunc {
411
+ return func (opts * PatchOptions ) {
412
+ opts .FieldManager = name
413
+ }
414
+ }
You can’t perform that action at this time.
0 commit comments