resources: Panic on Copy of Resource with .Err

Fixes #10006
This commit is contained in:
Bjørn Erik Pedersen committed 2022-06-14 09:47:41 +02:00
1 parent 5a9ecb82a3
commit 66da1b7b2f
1 file changed
+3
+3
View File
@@ -128,6 +128,9 @@ type resourceCopier interface {
// Copy copies r to the targetPath given.
func Copy(r resource.Resource, targetPath string) resource.Resource {
if r.Err() != nil {
panic(fmt.Sprintf("Resource has an .Err: %s", r.Err()))
}
return r.(resourceCopier).cloneTo(targetPath)
}