Cleanup CopyFile

This commit is contained in:
Shiming Zhang 2022-10-09 10:54:50 +08:00
parent 575031b68f
commit 3a54e3e56a

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