Skip to content
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

remove previously deprecated attach/download sbom commands #3891

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
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
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
Loading