Merge pull request #45335 from zhangxiaoyu-zidif/fix-goerrors-new
Automatic merge from submit-queue (batch tested with PRs 45488, 45335, 45909, 46074, 46615) fmt.Errorf replaces errors **What this PR does / why we need it**: fmt.Errorf replaces errors importing errors is redundant. **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes # **Special notes for your reviewer**: **Release note**: ```release-note NONE ```
This commit is contained in:
		@@ -17,7 +17,6 @@ limitations under the License.
 | 
				
			|||||||
package kubectl
 | 
					package kubectl
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import (
 | 
					import (
 | 
				
			||||||
	goerrors "errors"
 | 
					 | 
				
			||||||
	"fmt"
 | 
						"fmt"
 | 
				
			||||||
	"io"
 | 
						"io"
 | 
				
			||||||
	"strconv"
 | 
						"strconv"
 | 
				
			||||||
@@ -616,11 +615,11 @@ func CreateNewControllerFromCurrentController(rcClient coreclient.ReplicationCon
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if len(newRc.Spec.Template.Spec.Containers) > 1 && len(cfg.Container) == 0 {
 | 
						if len(newRc.Spec.Template.Spec.Containers) > 1 && len(cfg.Container) == 0 {
 | 
				
			||||||
		return nil, goerrors.New("Must specify container to update when updating a multi-container pod")
 | 
							return nil, fmt.Errorf("must specify container to update when updating a multi-container pod")
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if len(newRc.Spec.Template.Spec.Containers) == 0 {
 | 
						if len(newRc.Spec.Template.Spec.Containers) == 0 {
 | 
				
			||||||
		return nil, goerrors.New(fmt.Sprintf("Pod has no containers! (%v)", newRc))
 | 
							return nil, fmt.Errorf("pod has no containers! (%v)", newRc)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	newRc.Spec.Template.Spec.Containers[containerIndex].Image = cfg.Image
 | 
						newRc.Spec.Template.Spec.Containers[containerIndex].Image = cfg.Image
 | 
				
			||||||
	if len(cfg.PullPolicy) != 0 {
 | 
						if len(cfg.PullPolicy) != 0 {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user