-
Notifications
You must be signed in to change notification settings - Fork 38
feat(dagger): Allow to bypass policy checks on failures #1773
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -374,6 +374,9 @@ func (att *Attestation) Push( | |
// The passphrase to decrypt the private key | ||
// +optional | ||
passphrase *dagger.Secret, | ||
// Whether not fail if the policy check fails | ||
// +optional | ||
exceptionBypassPolicyCheck *bool, | ||
) (string, error) { | ||
container := att.Container(0) | ||
args := []string{ | ||
|
@@ -388,6 +391,9 @@ func (att *Attestation) Push( | |
if passphrase != nil { | ||
container = container.WithSecretVariable("CHAINLOOP_SIGNING_PASSWORD", passphrase) | ||
} | ||
if exceptionBypassPolicyCheck != nil && *exceptionBypassPolicyCheck { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. very nit: this is basically the same as not using a pointer and just checking for its There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it needs to be a pointer because it's marked as |
||
args = append(args, "--exception-bypass-policy-check") | ||
} | ||
|
||
return container.WithExec(args, execOpts).Stdout(ctx) | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @javirln for checking, so just so I understand moving forward. Is it required to have the +optional annotation in front of each optional value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I have it understood, yes, see the docs here: https://docs.dagger.io/api/arguments/#optional-arguments