Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions extras/dagger/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Copy link
Member

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?

Copy link
Member Author

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

Function arguments can be marked as optional. In this case, the Dagger CLI will not display an error if the argument is omitted in the function call.

) (string, error) {
container := att.Container(0)
args := []string{
Expand All @@ -388,6 +391,9 @@ func (att *Attestation) Push(
if passphrase != nil {
container = container.WithSecretVariable("CHAINLOOP_SIGNING_PASSWORD", passphrase)
}
if exceptionBypassPolicyCheck != nil && *exceptionBypassPolicyCheck {
Copy link
Member

Choose a reason for hiding this comment

The 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 true value

Copy link
Member Author

Choose a reason for hiding this comment

The 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 optional for dagger

args = append(args, "--exception-bypass-policy-check")
}

return container.WithExec(args, execOpts).Stdout(ctx)
}
Expand Down
Loading