mirror of
https://github.com/containers/podman.git
synced 2025-09-19 12:56:57 +08:00
fix(deps): update container-device-interface to v0.6.0
[NO NEW TESTS NEEDED] Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
This commit is contained in:
![29139614+renovate[bot]@users.noreply.github.com](/assets/img/avatar_default.png)
committed by
Valentin Rothberg

parent
1be2ec1d4f
commit
441af003ac
@ -20,6 +20,8 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/container-orchestrated-devices/container-device-interface/pkg/parser"
|
||||
)
|
||||
|
||||
const (
|
||||
@ -101,22 +103,22 @@ func AnnotationKey(pluginName, deviceID string) (string, error) {
|
||||
return "", fmt.Errorf("invalid plugin+deviceID %q, too long", name)
|
||||
}
|
||||
|
||||
if c := rune(name[0]); !isAlphaNumeric(c) {
|
||||
if c := rune(name[0]); !parser.IsAlphaNumeric(c) {
|
||||
return "", fmt.Errorf("invalid name %q, first '%c' should be alphanumeric",
|
||||
name, c)
|
||||
}
|
||||
if len(name) > 2 {
|
||||
for _, c := range name[1 : len(name)-1] {
|
||||
switch {
|
||||
case isAlphaNumeric(c):
|
||||
case parser.IsAlphaNumeric(c):
|
||||
case c == '_' || c == '-' || c == '.':
|
||||
default:
|
||||
return "", fmt.Errorf("invalid name %q, invalid charcter '%c'",
|
||||
return "", fmt.Errorf("invalid name %q, invalid character '%c'",
|
||||
name, c)
|
||||
}
|
||||
}
|
||||
}
|
||||
if c := rune(name[len(name)-1]); !isAlphaNumeric(c) {
|
||||
if c := rune(name[len(name)-1]); !parser.IsAlphaNumeric(c) {
|
||||
return "", fmt.Errorf("invalid name %q, last '%c' should be alphanumeric",
|
||||
name, c)
|
||||
}
|
||||
|
Reference in New Issue
Block a user