From f1d973f94530c2d42f56b8e2fc8e23e4ed84385b Mon Sep 17 00:00:00 2001 From: Ryan Thompson Date: Mon, 4 May 2020 17:28:47 -0700 Subject: [PATCH] Makes BackupKeyspaceSchema return an error on failure Ran into an issue where a coworker had introduced some s3 bucket policies that strictly enforced encryption headers. They weren't required because the backup bucket had default server-side encryption enabled and the aws sdk took care of all of that on the backend. However, since this return block did not include the error, the app kept on rolling into the copy step and we were getting 404 errors in the logs because the entire path prefix had been wiped out because of this return. Took me all day to narrow down so thought I'd PR this to save someone else the headache if they ever run into this issue. --- pkg/cain/cqlsh.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/cain/cqlsh.go b/pkg/cain/cqlsh.go index 71ee095..df29b36 100644 --- a/pkg/cain/cqlsh.go +++ b/pkg/cain/cqlsh.go @@ -29,7 +29,7 @@ func BackupKeyspaceSchema(iK8sClient, iDstClient interface{}, namespace, pod, co reader := bytes.NewReader(schema) if err := skbn.Upload(iDstClient, dstPrefix, schemaToPath, "", reader); err != nil { - return "", nil + return "", err } return dstBasePath, nil