Skip to content

Commit

Permalink
Merge pull request #193 from saschagrunert/sign-recursive
Browse files Browse the repository at this point in the history
Add `sign.Options.Recursive` config
  • Loading branch information
k8s-ci-robot committed May 15, 2023
2 parents 9053bae + 7ed9eb2 commit 60b5cd6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions sign/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ type Options struct {
// MaxCacheItems is the maximumg amount of items the internal caches can hold.
// Defaults to 10000.
MaxCacheItems uint64

// If a multi-arch image is specified, additionally sign each discrete image.
// Defaults to false.
Recursive bool
}

// Default returns a default Options instance.
Expand Down
3 changes: 2 additions & 1 deletion sign/sign.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ func (s *Signer) SignImageWithOptions(options *Options, reference string) (objec
if err := options.verifySignOptions(); err != nil {
return nil, fmt.Errorf("checking signing options: %w", err)
}
s.log().Debugf("Using options: %+v", options)

resetFn, err := s.enableExperimental()
if err != nil {
Expand Down Expand Up @@ -175,7 +176,7 @@ func (s *Signer) SignImageWithOptions(options *Options, reference string) (objec
if err := s.impl.SignImageInternal(
options.ToCosignRootOptions(), ko, regOpts, options.Annotations,
images, "", options.AttachSignature, options.OutputSignaturePath,
options.OutputCertificatePath, "", true, false, "", false,
options.OutputCertificatePath, "", true, options.Recursive, "", false,
); err != nil {
return nil, fmt.Errorf("sign reference: %s: %w", reference, err)
}
Expand Down

0 comments on commit 60b5cd6

Please sign in to comment.