Skip to content
This repository was archived by the owner on Jan 15, 2026. It is now read-only.

Commit b045df1

Browse files
author
zhouhao
committed
image: add a warning when the platform is not applicable
Signed-off-by: zhouhao <zhouhao@cn.fujitsu.com>
1 parent f3b94b3 commit b045df1

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

image/image.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,10 @@ func unpack(w walker, dest, refName, platform string) error {
179179
}
180180

181181
if ref.MediaType == validRefMediaTypes[0] {
182+
if platform != "" {
183+
fmt.Println("WARNING: reftype manifest does not support platform option, which are only applicable if reftype is index.")
184+
}
185+
182186
m, err := findManifest(w, ref)
183187
if err != nil {
184188
return err
@@ -255,6 +259,10 @@ func createRuntimeBundle(w walker, dest, refName, rootfs, platform string) error
255259
}
256260

257261
if ref.MediaType == validRefMediaTypes[0] {
262+
if platform != "" {
263+
fmt.Println("WARNING: reftype manifest does not support platform option, which are only applicable if reftype is index.")
264+
}
265+
258266
m, err := findManifest(w, ref)
259267
if err != nil {
260268
return err

0 commit comments

Comments
 (0)