mirror of
https://github.com/containers/podman.git
synced 2025-12-01 18:49:18 +08:00
vendor: update c/common + libhvee to latest main
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
29
vendor/github.com/containers/common/internal/deepcopy.go
generated
vendored
Normal file
29
vendor/github.com/containers/common/internal/deepcopy.go
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
package internal
|
||||
|
||||
import (
|
||||
v1 "github.com/opencontainers/image-spec/specs-go/v1"
|
||||
"golang.org/x/exp/maps"
|
||||
"golang.org/x/exp/slices"
|
||||
)
|
||||
|
||||
// DeepCopyDescriptor copies a Descriptor, deeply copying its contents
|
||||
func DeepCopyDescriptor(original *v1.Descriptor) *v1.Descriptor {
|
||||
tmp := *original
|
||||
if original.URLs != nil {
|
||||
tmp.URLs = slices.Clone(original.URLs)
|
||||
}
|
||||
if original.Annotations != nil {
|
||||
tmp.Annotations = maps.Clone(original.Annotations)
|
||||
}
|
||||
if original.Data != nil {
|
||||
tmp.Data = slices.Clone(original.Data)
|
||||
}
|
||||
if original.Platform != nil {
|
||||
tmpPlatform := *original.Platform
|
||||
if original.Platform.OSFeatures != nil {
|
||||
tmpPlatform.OSFeatures = slices.Clone(original.Platform.OSFeatures)
|
||||
}
|
||||
tmp.Platform = &tmpPlatform
|
||||
}
|
||||
return &tmp
|
||||
}
|
||||
Reference in New Issue
Block a user