Skip to content

Commit 2827f27

Browse files
committed
merge branch 'pr-124'
LGTMs: @cyphar Closes #124
2 parents 0348467 + 2a8db49 commit 2827f27

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

oci/config/convert/runtime.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,14 @@ import (
3131
"github.com/pkg/errors"
3232
)
3333

34+
// Annotations described by the OCI image-spec document (these represent fields
35+
// in an image configuration that do not have a native representation in the
36+
// runtime-spec).
3437
const (
35-
authorAnnotation = "org.opencontainers.image.author"
36-
createdAnnotation = "org.opencontainers.image.created"
37-
stopSignalAnnotation = "org.opencontainers.image.StopSignal"
38+
authorAnnotation = "org.opencontainers.image.author"
39+
createdAnnotation = "org.opencontainers.image.created"
40+
stopSignalAnnotation = "org.opencontainers.image.StopSignal"
41+
exposedPortsAnnotation = "org.opencontainers.image.exposedPorts"
3842
)
3943

4044
// ToRuntimeSpec converts the given OCI image configuration to a runtime
@@ -149,7 +153,7 @@ func MutateRuntimeSpec(g rgen.Generator, rootfs string, image ispec.Image) error
149153
ports = append(ports, port)
150154
}
151155
sort.Strings(ports)
152-
g.AddAnnotation("org.opencontainers.image.exposedPorts", strings.Join(ports, ","))
156+
g.AddAnnotation(exposedPortsAnnotation, strings.Join(ports, ","))
153157

154158
for vol := range image.Config.Volumes {
155159
// XXX: This is _fine_ but might cause some issues in the future.

0 commit comments

Comments
 (0)