mirror of
https://github.com/containers/podman.git
synced 2025-07-15 03:02:52 +08:00
Bump to Buildah v1.8.2
As the title suggests. Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
This commit is contained in:
30
vendor/github.com/containers/buildah/pkg/parse/parse.go
generated
vendored
30
vendor/github.com/containers/buildah/pkg/parse/parse.go
generated
vendored
@ -287,8 +287,8 @@ func SystemContextFromOptions(c *cobra.Command) (*types.SystemContext, error) {
|
||||
ctx.SignaturePolicyPath = sigPolicy
|
||||
}
|
||||
authfile, err := c.Flags().GetString("authfile")
|
||||
if err == nil && c.Flag("authfile").Changed {
|
||||
ctx.AuthFilePath = authfile
|
||||
if err == nil {
|
||||
ctx.AuthFilePath = getAuthFile(authfile)
|
||||
}
|
||||
regConf, err := c.Flags().GetString("registries-conf")
|
||||
if err == nil && c.Flag("registries-conf").Changed {
|
||||
@ -302,6 +302,13 @@ func SystemContextFromOptions(c *cobra.Command) (*types.SystemContext, error) {
|
||||
return ctx, nil
|
||||
}
|
||||
|
||||
func getAuthFile(authfile string) string {
|
||||
if authfile != "" {
|
||||
return authfile
|
||||
}
|
||||
return os.Getenv("REGISTRY_AUTH_FILE")
|
||||
}
|
||||
|
||||
func parseCreds(creds string) (string, string) {
|
||||
if creds == "" {
|
||||
return "", ""
|
||||
@ -576,3 +583,22 @@ func IsolationOption(c *cobra.Command) (buildah.Isolation, error) {
|
||||
}
|
||||
return defaultIsolation()
|
||||
}
|
||||
|
||||
// ScrubServer removes 'http://' or 'https://' from the front of the
|
||||
// server/registry string if either is there. This will be mostly used
|
||||
// for user input from 'buildah login' and 'buildah logout'.
|
||||
func ScrubServer(server string) string {
|
||||
server = strings.TrimPrefix(server, "https://")
|
||||
return strings.TrimPrefix(server, "http://")
|
||||
}
|
||||
|
||||
// RegistryFromFullName gets the registry from the input. If the input is of the form
|
||||
// quay.io/myuser/myimage, it will parse it and just return quay.io
|
||||
// It also returns true if a full image name was given
|
||||
func RegistryFromFullName(input string) string {
|
||||
split := strings.Split(input, "/")
|
||||
if len(split) > 1 {
|
||||
return split[0]
|
||||
}
|
||||
return split[0]
|
||||
}
|
||||
|
Reference in New Issue
Block a user