[#683] cli: Add context to policy parsing errors
Some checks failed
DCO action / DCO (pull_request) Successful in 6m31s
Vulncheck / Vulncheck (pull_request) Successful in 7m5s
Build / Build Components (1.21) (pull_request) Successful in 9m14s
Build / Build Components (1.20) (pull_request) Successful in 11m2s
Tests and linters / Tests (1.20) (pull_request) Failing after 13m19s
Tests and linters / Tests (1.21) (pull_request) Failing after 13m17s
Tests and linters / Staticcheck (pull_request) Successful in 13m23s
Tests and linters / Lint (pull_request) Successful in 14m54s
Tests and linters / Tests with -race (pull_request) Successful in 15m1s
Some checks failed
DCO action / DCO (pull_request) Successful in 6m31s
Vulncheck / Vulncheck (pull_request) Successful in 7m5s
Build / Build Components (1.21) (pull_request) Successful in 9m14s
Build / Build Components (1.20) (pull_request) Successful in 11m2s
Tests and linters / Tests (1.20) (pull_request) Failing after 13m19s
Tests and linters / Tests (1.21) (pull_request) Failing after 13m17s
Tests and linters / Staticcheck (pull_request) Successful in 13m23s
Tests and linters / Lint (pull_request) Successful in 14m54s
Tests and linters / Tests with -race (pull_request) Successful in 15m1s
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
parent
aa9f8dce3d
commit
97bb1bf36f
1 changed files with 2 additions and 2 deletions
|
@ -185,12 +185,12 @@ func parseContainerPolicy(cmd *cobra.Command, policyString string) (*netmap.Plac
|
|||
return &result, nil
|
||||
}
|
||||
|
||||
if err = result.UnmarshalJSON([]byte(policyString)); err == nil {
|
||||
if err := result.UnmarshalJSON([]byte(policyString)); err == nil {
|
||||
common.PrintVerbose(cmd, "Parsed JSON encoded policy")
|
||||
return &result, nil
|
||||
}
|
||||
|
||||
return nil, errors.New("can't parse placement policy")
|
||||
return nil, fmt.Errorf("can't parse placement policy: %w", err)
|
||||
}
|
||||
|
||||
func parseAttributes(dst *container.Container, attributes []string) error {
|
||||
|
|
Loading…
Add table
Reference in a new issue