Skip to content

Commit 3467244

Browse files
authored
fix(cli): wrong error message on bypass (#1769)
Signed-off-by: Miguel Martinez <miguel@chainloop.dev>
1 parent b866e7e commit 3467244

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

app/cli/cmd/attestation_push.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,13 @@ func newAttestationPushCmd() *cobra.Command {
127127
cmd.Flags().StringVar(&signServerCAPath, "signserver-ca-path", "", "custom CA to be used for SignServer communications")
128128
cmd.Flags().StringVar(&signServerAuthUser, "signserver-auth-user", "", "")
129129
cmd.Flags().StringVar(&signServerAuthPass, "signserver-auth-pass", "", "")
130-
cmd.Flags().BoolVar(&bypassPolicyCheck, "exception-bypass-policy-check", false, "do not fail this command on policy violations enforcement")
130+
cmd.Flags().BoolVar(&bypassPolicyCheck, exceptionFlagName, false, "do not fail this command on policy violations enforcement")
131131

132132
return cmd
133133
}
134134

135-
var ErrBlockedByPolicyViolation = errors.New("the operator requires all policies to pass before continuing, please fix them and try again or temporarily bypass the policy check using --exception_bypass_policy_check")
135+
const exceptionFlagName = "exception-bypass-policy-check"
136+
137+
var ErrBlockedByPolicyViolation = fmt.Errorf("the operator requires all policies to pass before continuing, please fix them and try again or temporarily bypass the policy check using --%s", exceptionFlagName)
136138

137139
const exceptionBypassPolicyCheck = "Attention: You have opted to bypass the policy enforcement check and an operator has been notified of this exception.\nPlease make sure you are back on track with the policy evaluations and remove the --exception_bypass_policy_check as soon as possible."

0 commit comments

Comments
 (0)