mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-04 23:17:50 +00:00
remove unneeded factory codec methods
This commit is contained in:
@@ -230,7 +230,7 @@ func RunExpose(f cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []stri
|
||||
}
|
||||
|
||||
if inline := cmdutil.GetFlagString(cmd, "overrides"); len(inline) > 0 {
|
||||
codec := runtime.NewCodec(f.JSONEncoder(), f.Decoder(true))
|
||||
codec := runtime.NewCodec(cmdutil.InternalVersionJSONEncoder(), cmdutil.InternalVersionDecoder())
|
||||
object, err = cmdutil.Merge(codec, object, inline)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -241,7 +241,7 @@ func RunExpose(f cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []stri
|
||||
ObjectTyper: typer,
|
||||
RESTMapper: mapper,
|
||||
ClientMapper: resource.ClientMapperFunc(f.ClientForMapping),
|
||||
Decoder: f.Decoder(true),
|
||||
Decoder: cmdutil.InternalVersionDecoder(),
|
||||
}
|
||||
info, err = resourceMapper.InfoForObject(object, nil)
|
||||
if err != nil {
|
||||
@@ -260,7 +260,7 @@ func RunExpose(f cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []stri
|
||||
cmdutil.PrintSuccess(false, out, info.Object, true, "exposed")
|
||||
return nil
|
||||
}
|
||||
if err := kubectl.CreateOrUpdateAnnotation(cmdutil.GetFlagBool(cmd, cmdutil.ApplyAnnotationsFlag), info, f.JSONEncoder()); err != nil {
|
||||
if err := kubectl.CreateOrUpdateAnnotation(cmdutil.GetFlagBool(cmd, cmdutil.ApplyAnnotationsFlag), info, cmdutil.InternalVersionJSONEncoder()); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user