vendor: bump buildah to v1.30.1-0.20230501124043-3908816d5310

Signed-off-by: Aditya R <arajan@redhat.com>
This commit is contained in:
Aditya R
2023-05-02 15:22:09 +05:30
parent e1e03a0e34
commit 1c5ab9e7bf
8 changed files with 38 additions and 25 deletions

View File

@@ -510,8 +510,6 @@ func PlatformsFromOptions(c *cobra.Command) (platforms []struct{ OS, Arch, Varia
return platforms, nil
}
const platformSep = "/"
// DefaultPlatform returns the standard platform for the current system
func DefaultPlatform() string {
return platforms.DefaultString()
@@ -520,21 +518,19 @@ func DefaultPlatform() string {
// Platform separates the platform string into os, arch and variant,
// accepting any of $arch, $os/$arch, or $os/$arch/$variant.
func Platform(platform string) (os, arch, variant string, err error) {
split := strings.Split(platform, platformSep)
switch len(split) {
case 3:
variant = split[2]
fallthrough
case 2:
arch = split[1]
os = split[0]
return
case 1:
if platform == "local" {
return Platform(DefaultPlatform())
}
if platform == "local" || platform == "" || platform == "/" {
return Platform(DefaultPlatform())
}
return "", "", "", fmt.Errorf("invalid platform syntax for %q (use OS/ARCH[/VARIANT][,...])", platform)
if platform[len(platform)-1] == '/' || platform[0] == '/' {
// If --platform string has format as `some/plat/string/`
// or `/some/plat/string` make it `some/plat/string`
platform = strings.Trim(platform, "/")
}
platformSpec, err := platforms.Parse(platform)
if err != nil {
return "", "", "", fmt.Errorf("invalid platform syntax for --platform=%q: %w", platform, err)
}
return platformSpec.OS, platformSpec.Architecture, platformSpec.Variant, nil
}
func parseCreds(creds string) (string, string) {