Skip to content

Commit

Permalink
Fix app logic
Browse files Browse the repository at this point in the history
  • Loading branch information
mvshao committed Oct 14, 2024
1 parent 1832682 commit 61f81f7
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions hack/runtime-migrator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,14 @@ func main() {
shootFromConverter, err := converter.ToShoot(runtime)
if err != nil {
log.Print("Error during converting generated RuntimeCR to Shoot object - ", err)
return
continue
}
log.Printf("Converted Shoot: %v\n", shootFromConverter)

// compare Gardener shoot with shoot from converter
result, err := comparator.CompareShoots(shoot, shootFromConverter)
if err != nil {
return
log.Print("Error during comparing shoots - ", err)
continue
}

saveShootToFile("/tmp/"+shoot.Name+"/original_shoot.yaml", shoot)
Expand All @@ -109,13 +110,14 @@ func main() {
resultsDir, err := comparator.SaveComparisonReport(result, cfg.OutputPath, shoot.Name)
if err != nil {
log.Print("Failed to save comparison report - ", err.Error())
continue
} else {
log.Printf("Results stored in %q", resultsDir)
}

if !result.Equal {
log.Print("Generated Shoot and Shoot from converter are not equal, stopping migration of shoot: ", shoot.Name)
return
continue
}

err = saveRuntime(migratorContext, cfg, runtime, kcpClient)
Expand Down

0 comments on commit 61f81f7

Please sign in to comment.