Skip to content

Commit

Permalink
virt-handler: Remove unused copy function
Browse files Browse the repository at this point in the history
Following PR kubevirt#13626, this function is no longer used.

Signed-off-by: Orel Misan <[email protected]>
  • Loading branch information
orelmisan committed Feb 3, 2025
1 parent 4360aeb commit c2847a4
Showing 1 changed file with 0 additions and 27 deletions.
27 changes: 0 additions & 27 deletions cmd/virt-handler/virt-handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import (
"context"
"crypto/tls"
"fmt"
"io"
"net/http"
"os"
"os/signal"
Expand Down Expand Up @@ -631,29 +630,3 @@ func main() {
log.InitializeLogging("virt-handler")
app.Run()
}

func copy(sourceFile string, targetFile string) error {

if err := os.RemoveAll(targetFile); err != nil {
return fmt.Errorf("failed to remove target file: %v", err)
}
target, err := os.Create(targetFile)
if err != nil {
return fmt.Errorf("failed to crate target file: %v", err)
}
defer target.Close()
source, err := os.Open(sourceFile)
if err != nil {
return fmt.Errorf("failed to open source file: %v", err)
}
defer source.Close()
_, err = io.Copy(target, source)
if err != nil {
return fmt.Errorf("failed to copy file: %v", err)
}
err = os.Chmod(targetFile, 0555)
if err != nil {
return fmt.Errorf("failed to make file executable: %v", err)
}
return nil
}

0 comments on commit c2847a4

Please sign in to comment.