Merge pull request #112933 from wzshiming/clean/copy-file

Cleanup CopyFile
This commit is contained in:
Kubernetes Prow Robot 2022-10-09 09:39:19 -07:00 committed by GitHub
commit a5481453f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -36,7 +36,10 @@ func SetKubernetesVersion(cfg *kubeadmapiv1.ClusterConfiguration) {
// CopyFile copy file from src to dest.
func CopyFile(src, dest string) error {
fileInfo, _ := os.Stat(src)
fileInfo, err := os.Stat(src)
if err != nil {
return err
}
contents, err := os.ReadFile(src)
if err != nil {
return err