diff --git a/staging/operator-lifecycle-manager/cmd/copy-content/main.go b/staging/operator-lifecycle-manager/cmd/copy-content/main.go index 94c4046ef0..eb57e979fe 100644 --- a/staging/operator-lifecycle-manager/cmd/copy-content/main.go +++ b/staging/operator-lifecycle-manager/cmd/copy-content/main.go @@ -31,6 +31,10 @@ func main() { *catalogSource: *catalogDestination, *cacheSource: *cacheDestination, } { + if err := os.RemoveAll(to); err != nil { + fmt.Printf("failed to remove %s: %s", to, err) + os.Exit(1) + } if err := copy.Copy(from, to); err != nil { fmt.Printf("failed to copy %s to %s: %s\n", from, to, err) os.Exit(1) diff --git a/vendor/github.com/operator-framework/operator-lifecycle-manager/cmd/copy-content/main.go b/vendor/github.com/operator-framework/operator-lifecycle-manager/cmd/copy-content/main.go index 94c4046ef0..eb57e979fe 100644 --- a/vendor/github.com/operator-framework/operator-lifecycle-manager/cmd/copy-content/main.go +++ b/vendor/github.com/operator-framework/operator-lifecycle-manager/cmd/copy-content/main.go @@ -31,6 +31,10 @@ func main() { *catalogSource: *catalogDestination, *cacheSource: *cacheDestination, } { + if err := os.RemoveAll(to); err != nil { + fmt.Printf("failed to remove %s: %s", to, err) + os.Exit(1) + } if err := copy.Copy(from, to); err != nil { fmt.Printf("failed to copy %s to %s: %s\n", from, to, err) os.Exit(1)