mirror of
https://github.com/containers/skopeo.git
synced 2025-09-21 09:57:19 +00:00
Update module github.com/containers/common to v0.52.0
Signed-off-by: Renovate Bot <bot@renovateapp.com>
This commit is contained in:
8
vendor/github.com/containers/common/pkg/auth/auth.go
generated
vendored
8
vendor/github.com/containers/common/pkg/auth/auth.go
generated
vendored
@@ -94,7 +94,7 @@ func Login(ctx context.Context, systemContext *types.SystemContext, opts *LoginO
|
||||
switch len(args) {
|
||||
case 0:
|
||||
if !opts.AcceptUnspecifiedRegistry {
|
||||
return errors.New("please provide a registry to login to")
|
||||
return errors.New("please provide a registry to log in to")
|
||||
}
|
||||
if key, err = defaultRegistryWhenUnspecified(systemContext); err != nil {
|
||||
return err
|
||||
@@ -109,7 +109,7 @@ func Login(ctx context.Context, systemContext *types.SystemContext, opts *LoginO
|
||||
}
|
||||
|
||||
default:
|
||||
return errors.New("login accepts only one registry to login to")
|
||||
return errors.New("login accepts only one registry to log in to")
|
||||
}
|
||||
|
||||
authConfig, err := config.GetCredentials(systemContext, key)
|
||||
@@ -299,7 +299,7 @@ func Logout(systemContext *types.SystemContext, opts *LogoutOptions, args []stri
|
||||
switch len(args) {
|
||||
case 0:
|
||||
if !opts.AcceptUnspecifiedRegistry {
|
||||
return errors.New("please provide a registry to logout from")
|
||||
return errors.New("please provide a registry to log out from")
|
||||
}
|
||||
if key, err = defaultRegistryWhenUnspecified(systemContext); err != nil {
|
||||
return err
|
||||
@@ -314,7 +314,7 @@ func Logout(systemContext *types.SystemContext, opts *LogoutOptions, args []stri
|
||||
}
|
||||
|
||||
default:
|
||||
return errors.New("logout accepts only one registry to logout from")
|
||||
return errors.New("logout accepts only one registry to log out from")
|
||||
}
|
||||
|
||||
err = config.RemoveAuthentication(systemContext, key)
|
||||
|
14
vendor/github.com/containers/common/pkg/report/formatter.go
generated
vendored
14
vendor/github.com/containers/common/pkg/report/formatter.go
generated
vendored
@@ -49,6 +49,15 @@ type Formatter struct {
|
||||
writer io.Writer // Destination for formatted output
|
||||
}
|
||||
|
||||
// stringsCutPrefix is equivalent to Go 1.20’s strings.CutPrefix.
|
||||
// Replace this function with a direct call to the standard library after we update to Go 1.20.
|
||||
func stringsCutPrefix(s, prefix string) (string, bool) {
|
||||
if !strings.HasPrefix(s, prefix) {
|
||||
return s, false
|
||||
}
|
||||
return s[len(prefix):], true
|
||||
}
|
||||
|
||||
// Parse parses golang template returning a formatter
|
||||
//
|
||||
// - OriginPodman implies text is a template from podman code. Output will
|
||||
@@ -64,11 +73,12 @@ func (f *Formatter) Parse(origin Origin, text string) (*Formatter, error) {
|
||||
// To be backwards compatible with the previous behavior we try to replace and
|
||||
// parse the template. If it fails use the original text and parse again.
|
||||
var normText string
|
||||
textWithoutTable, hasTable := stringsCutPrefix(text, "table ")
|
||||
switch {
|
||||
case strings.HasPrefix(text, "table "):
|
||||
case hasTable:
|
||||
f.RenderTable = true
|
||||
normText = "{{range .}}" + NormalizeFormat(text) + "{{end -}}"
|
||||
text = "{{range .}}" + text + "{{end -}}"
|
||||
text = "{{range .}}" + textWithoutTable + "{{end -}}"
|
||||
case OriginUser == origin:
|
||||
normText = EnforceRange(NormalizeFormat(text))
|
||||
text = EnforceRange(text)
|
||||
|
Reference in New Issue
Block a user