Skip to content

Commit

Permalink
Serve the virt-v2v output
Browse files Browse the repository at this point in the history
Until now we served the virt-v2v output from the conversion pod only
when the source is OVA, now it will always serve it as we use it also
for vSphere.

Signed-off-by: Liran Rotenberg <[email protected]>
  • Loading branch information
liranr23 committed Jun 17, 2024
1 parent d22bfeb commit de3d83d
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions virt-v2v/cold/entrypoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,23 +56,21 @@ func main() {
os.Exit(1)
}

if source == OVA {
var err error
xmlFilePath, err = getXMLFile(DIR, "xml")
if err != nil {
fmt.Println("Error gettin XML file:", err)
os.Exit(1)
}
var err error
xmlFilePath, err = getXMLFile(DIR, "xml")
if err != nil {
fmt.Println("Error getting XML file:", err)
os.Exit(1)

Check warning on line 63 in virt-v2v/cold/entrypoint.go

View check run for this annotation

Codecov / codecov/patch

virt-v2v/cold/entrypoint.go#L59-L63

Added lines #L59 - L63 were not covered by tests
}

http.HandleFunc("/ovf", ovfHandler)
http.HandleFunc("/shutdown", shutdownHandler)
server = &http.Server{Addr: ":8080"}
http.HandleFunc("/ovf", ovfHandler)
http.HandleFunc("/shutdown", shutdownHandler)
server = &http.Server{Addr: ":8080"}

Check warning on line 68 in virt-v2v/cold/entrypoint.go

View check run for this annotation

Codecov / codecov/patch

virt-v2v/cold/entrypoint.go#L66-L68

Added lines #L66 - L68 were not covered by tests

fmt.Println("Starting server on :8080")
if err := server.ListenAndServe(); err != http.ErrServerClosed {
fmt.Printf("Error starting server: %v\n", err)
os.Exit(1)
}
fmt.Println("Starting server on :8080")
if err := server.ListenAndServe(); err != http.ErrServerClosed {
fmt.Printf("Error starting server: %v\n", err)
os.Exit(1)

Check warning on line 73 in virt-v2v/cold/entrypoint.go

View check run for this annotation

Codecov / codecov/patch

virt-v2v/cold/entrypoint.go#L70-L73

Added lines #L70 - L73 were not covered by tests
}
}

Expand Down

0 comments on commit de3d83d

Please sign in to comment.