mirror of
https://github.com/containers/podman.git
synced 2025-12-03 03:39:44 +08:00
Bumps [github.com/containers/image/v5](https://github.com/containers/image) from 5.0.0 to 5.1.0. - [Release notes](https://github.com/containers/image/releases) - [Commits](https://github.com/containers/image/compare/v5.0.0...v5.1.0) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
25 lines
530 B
Go
25 lines
530 B
Go
package copy
|
|
|
|
import (
|
|
"strings"
|
|
|
|
"github.com/containers/image/v5/types"
|
|
)
|
|
|
|
// isOciEncrypted returns a bool indicating if a mediatype is encrypted
|
|
// This function will be moved to be part of OCI spec when adopted.
|
|
func isOciEncrypted(mediatype string) bool {
|
|
return strings.HasSuffix(mediatype, "+encrypted")
|
|
}
|
|
|
|
// isEncrypted checks if an image is encrypted
|
|
func isEncrypted(i types.Image) bool {
|
|
layers := i.LayerInfos()
|
|
for _, l := range layers {
|
|
if isOciEncrypted(l.MediaType) {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|