Return errors, fix linter

This commit is contained in:
Till Faelligen 2022-12-01 09:39:18 +01:00
parent ba37b1993b
commit d0cc7615ef
No known key found for this signature in database
GPG key ID: ACCDC9606D472758

View file

@ -476,12 +476,15 @@ func loadAndRunTests(dockerClient *client.Client, volumeName, v string, branchTo
"-password", "someRandomPassword", "-password", "someRandomPassword",
}, },
}) })
if err != nil {
return fmt.Errorf("failed to ContainerExecCreate: %w", err)
}
resp, err := InspectExecResp(context.Background(), dockerClient, respID.ID) resp, err := InspectExecResp(context.Background(), dockerClient, respID.ID)
if err != nil { if err != nil {
log.Fatalf("failed to inspect exec: %s", err) return fmt.Errorf("failed to InspectExecResp: %w", err)
} }
if !strings.Contains(resp.StdErr, "AccessToken") || resp.ExitCode != 0 { if !strings.Contains(resp.StdErr, "AccessToken") || resp.ExitCode != 0 {
log.Fatalf("Failed to create-account: %s", resp.StdErr) return fmt.Errorf("failed to create-account (exit code %d): %s", resp.ExitCode, resp.StdErr)
} }
return nil return nil
} }