mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-04 23:17:50 +00:00
collapse printing paths
This commit is contained in:
@@ -155,7 +155,7 @@ func RunReplace(f cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []str
|
||||
|
||||
info.Refresh(obj, true)
|
||||
f.PrintObjectSpecificMessage(obj, out)
|
||||
f.PrintSuccess(shortOutput, out, info.Mapping.Resource, info.Name, false, "replaced")
|
||||
cmdutil.PrintSuccess(shortOutput, out, info.Object, false, "replaced")
|
||||
return nil
|
||||
})
|
||||
}
|
||||
@@ -199,8 +199,6 @@ func forceReplace(f cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []s
|
||||
return err
|
||||
}
|
||||
|
||||
mapper := r.Mapper().RESTMapper
|
||||
|
||||
//Replace will create a resource if it doesn't exist already, so ignore not found error
|
||||
ignoreNotFound := true
|
||||
timeout := cmdutil.GetFlagDuration(cmd, "timeout")
|
||||
@@ -215,9 +213,9 @@ func forceReplace(f cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []s
|
||||
// By default use a reaper to delete all related resources.
|
||||
if cmdutil.GetFlagBool(cmd, "cascade") {
|
||||
glog.Warningf("\"cascade\" is set, kubectl will delete and re-create all resources managed by this resource (e.g. Pods created by a ReplicationController). Consider using \"kubectl rolling-update\" if you want to update a ReplicationController together with its Pods.")
|
||||
err = ReapResult(r, f, out, cmdutil.GetFlagBool(cmd, "cascade"), ignoreNotFound, timeout, gracePeriod, waitForDeletion, shortOutput, mapper, false)
|
||||
err = ReapResult(r, f, out, cmdutil.GetFlagBool(cmd, "cascade"), ignoreNotFound, timeout, gracePeriod, waitForDeletion, shortOutput, false)
|
||||
} else {
|
||||
err = DeleteResult(r, f, out, ignoreNotFound, gracePeriod, shortOutput, mapper)
|
||||
err = DeleteResult(r, out, ignoreNotFound, gracePeriod, shortOutput)
|
||||
}
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -279,7 +277,7 @@ func forceReplace(f cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []s
|
||||
count++
|
||||
info.Refresh(obj, true)
|
||||
f.PrintObjectSpecificMessage(obj, out)
|
||||
f.PrintSuccess(shortOutput, out, info.Mapping.Resource, info.Name, false, "replaced")
|
||||
cmdutil.PrintSuccess(shortOutput, out, info.Object, false, "replaced")
|
||||
return nil
|
||||
})
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user