mirror of
https://github.com/containers/podman.git
synced 2025-12-02 11:08:36 +08:00
Update to runc main, removing pin to an older version
We were pinned to a specific commit to ensure that tests kept passing. Hopefully they pass now, as we need to grab latest runc for CVE fixes. Also grab Buildah main to fix a build issue on FreeBSD. After a botched manual vendor, I used Ed's treadmill script and squashed it into this commit to make Git happy. Thanks bunches Ed. Signed-off-by: Matt Heon <mheon@redhat.com>
This commit is contained in:
59
vendor/github.com/containers/buildah/pkg/cli/build.go
generated
vendored
59
vendor/github.com/containers/buildah/pkg/cli/build.go
generated
vendored
@@ -1,8 +1,10 @@
|
||||
package cli
|
||||
|
||||
// the cli package contains urfave/cli related structs that help make up
|
||||
// the command line for buildah commands. it resides here so other projects
|
||||
// that vendor in this code can use them too.
|
||||
// the cli package contains spf13/cobra related structs that help make up
|
||||
// the command line for buildah commands. this file's contents are better
|
||||
// suited for pkg/parse, but since pkg/parse imports pkg/util which also
|
||||
// imports pkg/parse, having it there would create a cyclic dependency, so
|
||||
// here we are.
|
||||
|
||||
import (
|
||||
"errors"
|
||||
@@ -17,6 +19,7 @@ import (
|
||||
"github.com/containers/buildah/pkg/parse"
|
||||
"github.com/containers/buildah/pkg/util"
|
||||
"github.com/containers/common/pkg/auth"
|
||||
cutil "github.com/containers/common/pkg/util"
|
||||
"github.com/containers/image/v5/docker/reference"
|
||||
"github.com/containers/image/v5/types"
|
||||
"github.com/opencontainers/runtime-spec/specs-go"
|
||||
@@ -88,20 +91,10 @@ func GenBuildOptions(c *cobra.Command, inputArgs []string, iopts BuildOptions) (
|
||||
removeAll = append(removeAll, iopts.BudResults.Authfile)
|
||||
}
|
||||
|
||||
// Allow for --pull, --pull=true, --pull=false, --pull=never, --pull=always
|
||||
// --pull-always and --pull-never. The --pull-never and --pull-always options
|
||||
// will not be documented.
|
||||
pullPolicy := define.PullIfMissing
|
||||
if strings.EqualFold(strings.TrimSpace(iopts.Pull), "true") {
|
||||
pullPolicy = define.PullIfNewer
|
||||
pullPolicy, err := parse.PullPolicyFromOptions(c)
|
||||
if err != nil {
|
||||
return options, nil, nil, err
|
||||
}
|
||||
if iopts.PullAlways || strings.EqualFold(strings.TrimSpace(iopts.Pull), "always") {
|
||||
pullPolicy = define.PullAlways
|
||||
}
|
||||
if iopts.PullNever || strings.EqualFold(strings.TrimSpace(iopts.Pull), "never") {
|
||||
pullPolicy = define.PullNever
|
||||
}
|
||||
logrus.Debugf("Pull Policy for pull [%v]", pullPolicy)
|
||||
|
||||
args := make(map[string]string)
|
||||
if c.Flag("build-arg-file").Changed {
|
||||
@@ -224,21 +217,6 @@ func GenBuildOptions(c *cobra.Command, inputArgs []string, iopts BuildOptions) (
|
||||
return options, nil, nil, err
|
||||
}
|
||||
|
||||
pullFlagsCount := 0
|
||||
if c.Flag("pull").Changed {
|
||||
pullFlagsCount++
|
||||
}
|
||||
if c.Flag("pull-always").Changed {
|
||||
pullFlagsCount++
|
||||
}
|
||||
if c.Flag("pull-never").Changed {
|
||||
pullFlagsCount++
|
||||
}
|
||||
|
||||
if pullFlagsCount > 1 {
|
||||
return options, nil, nil, errors.New("can only set one of 'pull' or 'pull-always' or 'pull-never'")
|
||||
}
|
||||
|
||||
if (c.Flag("rm").Changed || c.Flag("force-rm").Changed) && (!c.Flag("layers").Changed && !c.Flag("no-cache").Changed) {
|
||||
return options, nil, nil, errors.New("'rm' and 'force-rm' can only be set with either 'layers' or 'no-cache'")
|
||||
}
|
||||
@@ -356,6 +334,24 @@ func GenBuildOptions(c *cobra.Command, inputArgs []string, iopts BuildOptions) (
|
||||
}
|
||||
}
|
||||
|
||||
var sbomScanOptions []define.SBOMScanOptions
|
||||
if c.Flag("sbom").Changed || c.Flag("sbom-scanner-command").Changed || c.Flag("sbom-scanner-image").Changed || c.Flag("sbom-image-output").Changed || c.Flag("sbom-merge-strategy").Changed || c.Flag("sbom-output").Changed || c.Flag("sbom-image-output").Changed || c.Flag("sbom-purl-output").Changed || c.Flag("sbom-image-purl-output").Changed {
|
||||
sbomScanOption, err := parse.SBOMScanOptions(c)
|
||||
if err != nil {
|
||||
return options, nil, nil, err
|
||||
}
|
||||
if !cutil.StringInSlice(contextDir, sbomScanOption.ContextDir) {
|
||||
sbomScanOption.ContextDir = append(sbomScanOption.ContextDir, contextDir)
|
||||
}
|
||||
for _, abc := range additionalBuildContext {
|
||||
if !abc.IsURL && !abc.IsImage {
|
||||
sbomScanOption.ContextDir = append(sbomScanOption.ContextDir, abc.Value)
|
||||
}
|
||||
}
|
||||
sbomScanOption.PullPolicy = pullPolicy
|
||||
sbomScanOptions = append(sbomScanOptions, *sbomScanOption)
|
||||
}
|
||||
|
||||
options = define.BuildOptions{
|
||||
AddCapabilities: iopts.CapAdd,
|
||||
AdditionalBuildContexts: additionalBuildContext,
|
||||
@@ -416,6 +412,7 @@ func GenBuildOptions(c *cobra.Command, inputArgs []string, iopts BuildOptions) (
|
||||
Runtime: iopts.Runtime,
|
||||
RuntimeArgs: runtimeFlags,
|
||||
RusageLogFile: iopts.RusageLogFile,
|
||||
SBOMScanOptions: sbomScanOptions,
|
||||
SignBy: iopts.SignBy,
|
||||
SignaturePolicyPath: iopts.SignaturePolicy,
|
||||
SkipUnusedStages: types.NewOptionalBool(iopts.SkipUnusedStages),
|
||||
|
||||
29
vendor/github.com/containers/buildah/pkg/cli/common.go
generated
vendored
29
vendor/github.com/containers/buildah/pkg/cli/common.go
generated
vendored
@@ -1,6 +1,6 @@
|
||||
package cli
|
||||
|
||||
// the cli package contains urfave/cli related structs that help make up
|
||||
// the cli package contains spf13/cobra related structs that help make up
|
||||
// the command line for buildah commands. it resides here so other projects
|
||||
// that vendor in this code can use them too.
|
||||
|
||||
@@ -90,6 +90,14 @@ type BudResults struct {
|
||||
Rm bool
|
||||
Runtime string
|
||||
RuntimeFlags []string
|
||||
SbomPreset string
|
||||
SbomScannerImage string
|
||||
SbomScannerCommand []string
|
||||
SbomMergeStrategy string
|
||||
SbomOutput string
|
||||
SbomImgOutput string
|
||||
SbomPurlOutput string
|
||||
SbomImgPurlOutput string
|
||||
Secrets []string
|
||||
SSH []string
|
||||
SignaturePolicy string
|
||||
@@ -110,6 +118,7 @@ type BudResults struct {
|
||||
OSFeatures []string
|
||||
OSVersion string
|
||||
CWOptions string
|
||||
SBOMOptions []string
|
||||
}
|
||||
|
||||
// FromAndBugResults represents the results for common flags
|
||||
@@ -253,7 +262,7 @@ func GetBudFlags(flags *BudResults) pflag.FlagSet {
|
||||
fs.String("os", runtime.GOOS, "set the OS to the provided value instead of the current operating system of the host")
|
||||
fs.StringArrayVar(&flags.OSFeatures, "os-feature", []string{}, "set required OS `feature` for the target image in addition to values from the base image")
|
||||
fs.StringVar(&flags.OSVersion, "os-version", "", "set required OS `version` for the target image instead of the value from the base image")
|
||||
fs.StringVar(&flags.Pull, "pull", "true", "pull the image from the registry if newer or not present in store, if false, only pull the image if not present, if always, pull the image even if the named image is present in store, if never, only use the image present in store if available")
|
||||
fs.StringVar(&flags.Pull, "pull", "true", "pull base and SBOM scanner images from the registry if newer or not present in store, if false, only pull base and SBOM scanner images if not present, if always, pull base and SBOM scanner images even if the named images are present in store, if never, only use images present in store if available")
|
||||
fs.Lookup("pull").NoOptDefVal = "true" //allow `--pull ` to be set to `true` as expected.
|
||||
fs.BoolVar(&flags.PullAlways, "pull-always", false, "pull the image even if the named image is present in store")
|
||||
if err := fs.MarkHidden("pull-always"); err != nil {
|
||||
@@ -269,6 +278,14 @@ func GetBudFlags(flags *BudResults) pflag.FlagSet {
|
||||
fs.BoolVar(&flags.Rm, "rm", true, "remove intermediate containers after a successful build")
|
||||
// "runtime" definition moved to avoid name collision in podman build. Defined in cmd/buildah/build.go.
|
||||
fs.StringSliceVar(&flags.RuntimeFlags, "runtime-flag", []string{}, "add global flags for the container runtime")
|
||||
fs.StringVar(&flags.SbomPreset, "sbom", "", "scan working container using `preset` configuration")
|
||||
fs.StringVar(&flags.SbomScannerImage, "sbom-scanner-image", "", "scan working container using scanner command from `image`")
|
||||
fs.StringArrayVar(&flags.SbomScannerCommand, "sbom-scanner-command", nil, "scan working container using `command` in scanner image")
|
||||
fs.StringVar(&flags.SbomMergeStrategy, "sbom-merge-strategy", "", "merge scan results using `strategy`")
|
||||
fs.StringVar(&flags.SbomOutput, "sbom-output", "", "save scan results to `file`")
|
||||
fs.StringVar(&flags.SbomImgOutput, "sbom-image-output", "", "add scan results to image as `path`")
|
||||
fs.StringVar(&flags.SbomPurlOutput, "sbom-purl-output", "", "save scan results to `file``")
|
||||
fs.StringVar(&flags.SbomImgPurlOutput, "sbom-image-purl-output", "", "add scan results to image as `path`")
|
||||
fs.StringArrayVar(&flags.Secrets, "secret", []string{}, "secret file to expose to the build")
|
||||
fs.StringVar(&flags.SignBy, "sign-by", "", "sign the image using a GPG key with the specified `FINGERPRINT`")
|
||||
fs.StringVar(&flags.SignaturePolicy, "signature-policy", "", "`pathname` of signature policy file (not usually used)")
|
||||
@@ -324,6 +341,14 @@ func GetBudFlagsCompletions() commonComp.FlagCompletions {
|
||||
flagCompletion["output"] = commonComp.AutocompleteNone
|
||||
flagCompletion["pull"] = commonComp.AutocompleteDefault
|
||||
flagCompletion["runtime-flag"] = commonComp.AutocompleteNone
|
||||
flagCompletion["sbom"] = commonComp.AutocompleteNone
|
||||
flagCompletion["sbom-scanner-image"] = commonComp.AutocompleteNone
|
||||
flagCompletion["sbom-scanner-command"] = commonComp.AutocompleteNone
|
||||
flagCompletion["sbom-merge-strategy"] = commonComp.AutocompleteNone
|
||||
flagCompletion["sbom-output"] = commonComp.AutocompleteDefault
|
||||
flagCompletion["sbom-image-output"] = commonComp.AutocompleteNone
|
||||
flagCompletion["sbom-purl-output"] = commonComp.AutocompleteDefault
|
||||
flagCompletion["sbom-image-purl-output"] = commonComp.AutocompleteNone
|
||||
flagCompletion["secret"] = commonComp.AutocompleteNone
|
||||
flagCompletion["sign-by"] = commonComp.AutocompleteNone
|
||||
flagCompletion["signature-policy"] = commonComp.AutocompleteNone
|
||||
|
||||
Reference in New Issue
Block a user