Skip to content

Commit

Permalink
fix: Policy download test (#1009)
Browse files Browse the repository at this point in the history

#### Summary

Fixes bad sanity test for policy download.

---
  • Loading branch information
roneli committed Jun 26, 2022
1 parent 2eb7ecf commit a3312e9
Show file tree
Hide file tree
Showing 6 changed files with 217 additions and 21 deletions.
11 changes: 9 additions & 2 deletions cmd/policy.go
Expand Up @@ -74,7 +74,11 @@ var (
if err != nil {
return err
}
return c.DownloadPolicy(cmd.Context(), args)
diags := c.DownloadPolicy(cmd.Context(), args)
if diags.HasErrors() {
return fmt.Errorf("policy download has one or more errors, check logs")
}
return nil
},
}

Expand Down Expand Up @@ -165,7 +169,10 @@ var (
}
diags := c.ValidatePolicy(cmd.Context(), args[0])
errors.CaptureDiagnostics(diags, map[string]string{"command": "policy_validate"})
return fmt.Errorf("policy validate has one or more errors, check logs")
if diags.HasErrors() {
return fmt.Errorf("policy validate has one or more errors, check logs")
}
return nil
},
}

Expand Down

0 comments on commit a3312e9

Please sign in to comment.