Revert "support patch list of primitives"

This reverts commit 34891ad9f6.
This commit is contained in:
ymqytw
2016-11-22 21:06:36 -08:00
parent 18f4395f80
commit 3cc294b1e0
27 changed files with 1661 additions and 2659 deletions

View File

@@ -38,7 +38,6 @@ import (
type PauseConfig struct {
resource.FilenameOptions
f cmdutil.Factory
Pauser func(info *resource.Info) (bool, error)
Mapper meta.RESTMapper
Typer runtime.ObjectTyper
@@ -100,7 +99,6 @@ func (o *PauseConfig) CompletePause(f cmdutil.Factory, cmd *cobra.Command, out i
return cmdutil.UsageError(cmd, cmd.Use)
}
o.f = f
o.Mapper, o.Typer = f.Object()
o.Encoder = f.JSONEncoder()
@@ -134,7 +132,7 @@ func (o *PauseConfig) CompletePause(f cmdutil.Factory, cmd *cobra.Command, out i
func (o PauseConfig) RunPause() error {
allErrs := []error{}
for _, patch := range set.CalculatePatches(o.f, o.Infos, o.Encoder, false, o.Pauser) {
for _, patch := range set.CalculatePatches(o.Infos, o.Encoder, o.Pauser) {
info := patch.Info
if patch.Err != nil {
allErrs = append(allErrs, fmt.Errorf("error: %s %q %v", info.Mapping.Resource, info.Name, patch.Err))

View File

@@ -38,7 +38,6 @@ import (
type ResumeConfig struct {
resource.FilenameOptions
f cmdutil.Factory
Resumer func(object *resource.Info) (bool, error)
Mapper meta.RESTMapper
Typer runtime.ObjectTyper
@@ -98,7 +97,6 @@ func (o *ResumeConfig) CompleteResume(f cmdutil.Factory, cmd *cobra.Command, out
return cmdutil.UsageError(cmd, cmd.Use)
}
o.f = f
o.Mapper, o.Typer = f.Object()
o.Encoder = f.JSONEncoder()
@@ -138,7 +136,7 @@ func (o *ResumeConfig) CompleteResume(f cmdutil.Factory, cmd *cobra.Command, out
func (o ResumeConfig) RunResume() error {
allErrs := []error{}
for _, patch := range set.CalculatePatches(o.f, o.Infos, o.Encoder, false, o.Resumer) {
for _, patch := range set.CalculatePatches(o.Infos, o.Encoder, o.Resumer) {
info := patch.Info
if patch.Err != nil {