-
Notifications
You must be signed in to change notification settings - Fork 547
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add --platform flag to cosign sbom download (#1975)
* Add --platform option to download sbom Signed-off-by: Adolfo García Veytia (Puerco) <puerco@chainguard.dev> * Const not found error and humanize not found err Signed-off-by: Adolfo García Veytia (Puerco) <puerco@chainguard.dev> * Download specified sbom with --platform This commit implements the --platform flag of `cosign sbom download` that allows the user to fetch an sbom for a specific arch. Signed-off-by: Adolfo García Veytia (Puerco) <puerco@chainguard.dev> * Update platform string handling This commit modifies the --platform flag in cosign download to improve the handling of platform strings and matching. Signed-off-by: Adolfo García Veytia (Puerco) <puerco@chainguard.dev> * Spin out platform fn and improve help This commit refactors the platforms logic to its own image and improves the user help when there is no sbom at the index level. cosign will now show the user which platforms are available to use with --platform. Signed-off-by: Adolfo García Veytia (Puerco) <puerco@chainguard.dev> * Add sbom platform cases to e2e Add single image with platform case and update args in calls to download functions Signed-off-by: Adolfo García Veytia (Puerco) <puerco@chainguard.dev> * Update cosign download doc Signed-off-by: Adolfo García Veytia (Puerco) <puerco@chainguard.dev> * Add platformList.String method Refacor listing platform to a method of platformList Signed-off-by: Adolfo García Veytia (Puerco) <puerco@chainguard.dev> * Drop manual walk of signed index This commit drops the findSignedImage() function in favor of the SignedImge() function of the OCI package. Signed-off-by: Adolfo García Veytia (Puerco) <puerco@chainguard.dev>
- Loading branch information
Showing
6 changed files
with
175 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// | ||
// Copyright 2022 The Sigstore Authors. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package options | ||
|
||
import "github.com/spf13/cobra" | ||
|
||
// DownloadOptions is the struct for control | ||
type SBOMDownloadOptions struct { | ||
Platform string // Platform to download sboms | ||
} | ||
|
||
var _ Interface = (*SBOMDownloadOptions)(nil) | ||
|
||
// AddFlags implements Interface | ||
func (o *SBOMDownloadOptions) AddFlags(cmd *cobra.Command) { | ||
cmd.Flags().StringVar(&o.Platform, "platform", "", | ||
"download SBOM for a specific platform image") | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters