57
57
KUBECTL_EXTERNAL_DIFF environment variable can be used to select your own
58
58
diff command. By default, the "diff" command available in your path will be
59
59
run with "-u" (unified diff) and "-N" (treat absent files as empty) options.
60
-
60
+
61
61
Exit status:
62
62
0
63
63
No differences were found.
@@ -92,6 +92,7 @@ type DiffOptions struct {
92
92
FilenameOptions resource.FilenameOptions
93
93
94
94
ServerSideApply bool
95
+ FieldManager string
95
96
ForceConflicts bool
96
97
97
98
OpenAPISchema openapi.Resources
@@ -296,6 +297,7 @@ type InfoObject struct {
296
297
OpenAPI openapi.Resources
297
298
Force bool
298
299
ServerSideApply bool
300
+ FieldManager string
299
301
ForceConflicts bool
300
302
genericclioptions.IOStreams
301
303
}
@@ -316,8 +318,9 @@ func (obj InfoObject) Merged() (runtime.Object, error) {
316
318
return nil , err
317
319
}
318
320
options := metav1.PatchOptions {
319
- Force : & obj .ForceConflicts ,
320
- DryRun : []string {metav1 .DryRunAll },
321
+ Force : & obj .ForceConflicts ,
322
+ FieldManager : obj .FieldManager ,
323
+ DryRun : []string {metav1 .DryRunAll },
321
324
}
322
325
return resource .NewHelper (obj .Info .Client , obj .Info .Mapping ).Patch (
323
326
obj .Info .Namespace ,
@@ -441,6 +444,7 @@ func (o *DiffOptions) Complete(f cmdutil.Factory, cmd *cobra.Command) error {
441
444
}
442
445
443
446
o .ServerSideApply = cmdutil .GetServerSideApplyFlag (cmd )
447
+ o .FieldManager = cmdutil .GetFieldManagerFlag (cmd )
444
448
o .ForceConflicts = cmdutil .GetForceConflictsFlag (cmd )
445
449
if o .ForceConflicts && ! o .ServerSideApply {
446
450
return fmt .Errorf ("--force-conflicts only works with --server-side" )
@@ -529,6 +533,7 @@ func (o *DiffOptions) Run() error {
529
533
OpenAPI : o .OpenAPISchema ,
530
534
Force : force ,
531
535
ServerSideApply : o .ServerSideApply ,
536
+ FieldManager : o .FieldManager ,
532
537
ForceConflicts : o .ForceConflicts ,
533
538
IOStreams : o .Diff .IOStreams ,
534
539
}
0 commit comments