Merge pull request #85035 from gongguan/fix_diff_panic

fix kubectl diff panic
This commit is contained in:
Kubernetes Prow Robot 2019-11-11 12:56:18 -08:00 committed by GitHub
commit f610133f69
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -257,6 +257,7 @@ type InfoObject struct {
Force bool
ServerSideApply bool
ForceConflicts bool
genericclioptions.IOStreams
}
var _ Object = &InfoObject{}
@ -325,7 +326,7 @@ func (obj InfoObject) Merged() (runtime.Object, error) {
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
}
@ -492,6 +493,7 @@ func (o *DiffOptions) Run() error {
Force: force,
ServerSideApply: o.ServerSideApply,
ForceConflicts: o.ForceConflicts,
IOStreams: o.Diff.IOStreams,
}
err = differ.Diff(obj, printer)