mirror of https://github.com/k3s-io/k3s
Merge pull request #54989 from wackxu/reterr
Automatic merge from submit-queue (batch tested with PRs 52367, 53363, 54989, 54872, 54643). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. should check and return err when visit failure **What this PR does / why we need it**: should check and return err when visit failure **Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:Fixes # **Special notes for your reviewer**: **Release note**: ```release-note NONE ```pull/6/head
commit
5f73021e25
|
@ -233,7 +233,7 @@ func forceReplace(f cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []s
|
|||
if timeout == 0 {
|
||||
timeout = kubectl.Timeout
|
||||
}
|
||||
r.Visit(func(info *resource.Info, err error) error {
|
||||
err = r.Visit(func(info *resource.Info, err error) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -245,6 +245,9 @@ func forceReplace(f cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []s
|
|||
return true, nil
|
||||
})
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
r = f.NewBuilder().
|
||||
Unstructured(f.UnstructuredClientForMapping, mapper, typer).
|
||||
|
|
Loading…
Reference in New Issue