Skip to content

Commit

Permalink
remove previously deprecated attach/download sbom commands
Browse files Browse the repository at this point in the history
Signed-off-by: hectorj2f <[email protected]>
  • Loading branch information
hectorj2f committed Sep 27, 2024
1 parent 677a262 commit 4fd4d2c
Show file tree
Hide file tree
Showing 9 changed files with 0 additions and 474 deletions.
30 changes: 0 additions & 30 deletions cmd/cosign/cli/attach.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
package cli

import (
"fmt"
"os"

"github.com/sigstore/cosign/v2/cmd/cosign/cli/attach"
"github.com/sigstore/cosign/v2/cmd/cosign/cli/options"
"github.com/spf13/cobra"
Expand All @@ -32,7 +29,6 @@ func Attach() *cobra.Command {

cmd.AddCommand(
attachSignature(),
attachSBOM(),
attachAttestation(),
)

Expand Down Expand Up @@ -75,32 +71,6 @@ func attachSignature() *cobra.Command {
return cmd
}

func attachSBOM() *cobra.Command {
o := &options.AttachSBOMOptions{}

cmd := &cobra.Command{
Use: "sbom",
Short: "DEPRECATED: Attach sbom to the supplied container image",
Long: "Attach sbom to the supplied container image\n\n" + options.SBOMAttachmentDeprecation,
Example: " cosign attach sbom <image uri>",
Args: cobra.ExactArgs(1),
PersistentPreRun: options.BindViper,
RunE: func(cmd *cobra.Command, args []string) error {
fmt.Fprintln(os.Stderr, options.SBOMAttachmentDeprecation)
mediaType, err := o.MediaType()
if err != nil {
return err
}
fmt.Fprintf(os.Stderr, "WARNING: Attaching SBOMs this way does not sign them. To sign them, use 'cosign attest --predicate %s --key <key path>'.\n", o.SBOM)
return attach.SBOMCmd(cmd.Context(), o.Registry, o.RegistryExperimental, o.SBOM, mediaType, args[0])
},
}

o.AddFlags(cmd)

return cmd
}

func attachAttestation() *cobra.Command {
o := &options.AttachAttestationOptions{}

Expand Down
149 changes: 0 additions & 149 deletions cmd/cosign/cli/attach/sbom.go

This file was deleted.

29 changes: 0 additions & 29 deletions cmd/cosign/cli/download.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
package cli

import (
"fmt"
"os"

"github.com/spf13/cobra"

"github.com/sigstore/cosign/v2/cmd/cosign/cli/download"
Expand All @@ -33,7 +30,6 @@ func Download() *cobra.Command {

cmd.AddCommand(
downloadSignature(),
downloadSBOM(),
downloadAttestation(),
)

Expand All @@ -59,31 +55,6 @@ func downloadSignature() *cobra.Command {
return cmd
}

func downloadSBOM() *cobra.Command {
o := &options.RegistryOptions{}
do := &options.SBOMDownloadOptions{}

cmd := &cobra.Command{
Use: "sbom",
Short: "DEPRECATED: Download SBOMs from the supplied container image",
Long: "Download SBOMs from the supplied container image\n\n" + options.SBOMAttachmentDeprecation,
Example: " cosign download sbom <image uri>",
Args: cobra.ExactArgs(1),
PersistentPreRun: options.BindViper,
RunE: func(cmd *cobra.Command, args []string) error {
fmt.Fprintln(os.Stderr, options.SBOMAttachmentDeprecation)
fmt.Fprintln(os.Stderr, "WARNING: Downloading SBOMs this way does not ensure its authenticity. If you want to ensure a tamper-proof SBOM, download it using 'cosign download attestation <image uri>'.")
_, err := download.SBOMCmd(cmd.Context(), *o, *do, args[0], cmd.OutOrStdout())
return err
},
}

do.AddFlags(cmd)
o.AddFlags(cmd)

return cmd
}

func downloadAttestation() *cobra.Command {
o := &options.RegistryOptions{}
ao := &options.AttestationDownloadOptions{}
Expand Down
1 change: 0 additions & 1 deletion doc/cosign_attach.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

49 changes: 0 additions & 49 deletions doc/cosign_attach_sbom.md

This file was deleted.

1 change: 0 additions & 1 deletion doc/cosign_download.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 0 additions & 46 deletions doc/cosign_download_sbom.md

This file was deleted.

Loading

0 comments on commit 4fd4d2c

Please sign in to comment.