1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2024-12-14 11:57:48 +00:00

Modified error messages

This commit is contained in:
NoSkillGirl 2020-06-21 11:48:57 +05:30
parent c482459e0e
commit 7e2dbd87fe

View file

@ -58,7 +58,7 @@ func Command() *cobra.Command {
}()
if len(resourcePaths) == 0 && !cluster {
return sanitizedError.NewWithError(fmt.Sprintf("Specify path to resource file or cluster name"), err)
return sanitizedError.NewWithError(fmt.Sprintf("resource file or cluster required"), err)
}
policies, openAPIController, err := common.GetPoliciesValidation(policyPaths)
@ -73,7 +73,7 @@ func Command() *cobra.Command {
os.Exit(3)
}
if policyHasVariables(*policy) {
return sanitizedError.NewWithError(fmt.Sprintf("Policy %v is not valid - 'apply' does not support policies with variables", policy.Name), err)
return sanitizedError.NewWithError(fmt.Sprintf("nvalid policy %s. 'apply' does not support policies with variables", policy.Name), err)
}
}
@ -102,7 +102,7 @@ func Command() *cobra.Command {
err = applyPolicyOnResource(policy, resource)
if err != nil {
return sanitizedError.NewWithError(fmt.Errorf("Issues applying policy %v on resource %v", policy.Name, resource.GetName()).Error(), err)
return sanitizedError.NewWithError(fmt.Errorf("failed to apply policy %v on resource %v", policy.Name, resource.GetName()).Error(), err)
}
}
}