mirror of
https://github.com/containers/skopeo.git
synced 2025-09-07 09:40:55 +00:00
Update vendor of containers/(common,storage,image)
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
8
vendor/github.com/containers/storage/utils.go
generated
vendored
8
vendor/github.com/containers/storage/utils.go
generated
vendored
@@ -42,13 +42,14 @@ func validateMountOptions(mountOptions []string) error {
|
||||
}
|
||||
|
||||
func applyNameOperation(oldNames []string, opParameters []string, op updateNameOperation) ([]string, error) {
|
||||
result := make([]string, 0)
|
||||
var result []string
|
||||
switch op {
|
||||
case setNames:
|
||||
// ignore all old names and just return new names
|
||||
return dedupeNames(opParameters), nil
|
||||
result = opParameters
|
||||
case removeNames:
|
||||
// remove given names from old names
|
||||
result = make([]string, 0, len(oldNames))
|
||||
for _, name := range oldNames {
|
||||
// only keep names in final result which do not intersect with input names
|
||||
// basically `result = oldNames - opParameters`
|
||||
@@ -62,11 +63,10 @@ func applyNameOperation(oldNames []string, opParameters []string, op updateNameO
|
||||
result = append(result, name)
|
||||
}
|
||||
}
|
||||
return dedupeNames(result), nil
|
||||
case addNames:
|
||||
result = make([]string, 0, len(opParameters)+len(oldNames))
|
||||
result = append(result, opParameters...)
|
||||
result = append(result, oldNames...)
|
||||
return dedupeNames(result), nil
|
||||
default:
|
||||
return result, errInvalidUpdateNameOperation
|
||||
}
|
||||
|
Reference in New Issue
Block a user