mirror of
https://github.com/podman-container-tools/podman.git
synced 2026-08-07 17:36:22 +00:00
Currently podman implements --override-arch and --overide-os But Podman has made these aliases for --arch and --os. No reason to have to specify --override, since it is clear what the user intends. Currently if the user specifies an --override-arch field but the image was previously pulled for a different Arch, podman run uses the different arch. This PR also fixes this issue. Fixes: https://github.com/containers/podman/issues/8001 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
36 lines
816 B
Go
36 lines
816 B
Go
package utils
|
|
|
|
import "github.com/spf13/pflag"
|
|
|
|
// AliasFlags is a function to handle backwards compatibility with old flags
|
|
func AliasFlags(f *pflag.FlagSet, name string) pflag.NormalizedName {
|
|
switch name {
|
|
case "healthcheck-command":
|
|
name = "health-cmd"
|
|
case "healthcheck-interval":
|
|
name = "health-interval"
|
|
case "healthcheck-retries":
|
|
name = "health-retries"
|
|
case "healthcheck-start-period":
|
|
name = "health-start-period"
|
|
case "healthcheck-timeout":
|
|
name = "health-timeout"
|
|
case "net":
|
|
name = "network"
|
|
case "timeout":
|
|
name = "time"
|
|
case "namespace":
|
|
name = "ns"
|
|
case "storage":
|
|
name = "external"
|
|
case "purge":
|
|
name = "rm"
|
|
case "override-arch":
|
|
name = "arch"
|
|
case "override-os":
|
|
name = "os"
|
|
case "override-variant":
|
|
name = "variant"
|
|
}
|
|
return pflag.NormalizedName(name)
|
|
}
|