mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 19:31:44 +00:00
Merge pull request #85035 from gongguan/fix_diff_panic
fix kubectl diff panic
This commit is contained in:
commit
f610133f69
@ -257,6 +257,7 @@ type InfoObject struct {
|
|||||||
Force bool
|
Force bool
|
||||||
ServerSideApply bool
|
ServerSideApply bool
|
||||||
ForceConflicts bool
|
ForceConflicts bool
|
||||||
|
genericclioptions.IOStreams
|
||||||
}
|
}
|
||||||
|
|
||||||
var _ Object = &InfoObject{}
|
var _ Object = &InfoObject{}
|
||||||
@ -325,7 +326,7 @@ func (obj InfoObject) Merged() (runtime.Object, error) {
|
|||||||
ResourceVersion: resourceVersion,
|
ResourceVersion: resourceVersion,
|
||||||
}
|
}
|
||||||
|
|
||||||
_, result, err := patcher.Patch(obj.Info.Object, modified, obj.Info.Source, obj.Info.Namespace, obj.Info.Name, nil)
|
_, result, err := patcher.Patch(obj.Info.Object, modified, obj.Info.Source, obj.Info.Namespace, obj.Info.Name, obj.ErrOut)
|
||||||
return result, err
|
return result, err
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -492,6 +493,7 @@ func (o *DiffOptions) Run() error {
|
|||||||
Force: force,
|
Force: force,
|
||||||
ServerSideApply: o.ServerSideApply,
|
ServerSideApply: o.ServerSideApply,
|
||||||
ForceConflicts: o.ForceConflicts,
|
ForceConflicts: o.ForceConflicts,
|
||||||
|
IOStreams: o.Diff.IOStreams,
|
||||||
}
|
}
|
||||||
|
|
||||||
err = differ.Diff(obj, printer)
|
err = differ.Diff(obj, printer)
|
||||||
|
Loading…
Reference in New Issue
Block a user